Forum rules
Under no circumstances is spamming or advertising of any kind allowed. Do not post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate others security. Profanity or any kind of insolent behavior to other members (regardless of rank) will not be tolerated. Remember, what you don’t find offensive can be offensive to other members. Please treat each other with the kind of reverence you’d expect from other members.
Failure to comply with any of the above will result in users being banned without notice. If any further details are needed, contact: “The team” using the link at the bottom of the forum page. Thank you.
tomburke25
Posts: 1
Joined: Sun Nov 22, 2020 1:57 pm

Python REST API module

Sun Nov 22, 2020 6:04 pm

I recently tried to use the python-opensubtitles XMLRPC module by Alexandre González (https://github.com/agonzalezro/python-o ... /README.md) , but found it lacking some of the features I needed.

Specifically, I was trying to get subtitles for videos with forced subtitles only (I didn't want to be enabling subtitles just for a quick Spanish part, only to disable them once the movie reverted to English)

After some searching, I found the API has a field for this "foreign_parts_only" .

However, I couldn't find any way of adding this field to the query. I didn't want to retrieve 20+ results and filter them out, as this felt like I was unnecessarily using server bandwidth. I may be completely wrong here, and I simply missed the relevant sections.

The XMLRPC API documentation was a little hard to follow. I discovered the new REST API (https://opensubtitles.stoplight.io/) is extremely well documented and easy to follow.

This API is still in BETA and any updates may break my python code, but if anyone is interested, please look up the code on the github link below.

https://github.com/tomburke25/python-op ... s-rest-api

Hope this can be of use to anyone looking to experiment with the new API system

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 0 guests