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.
FlameCRO
Posts: 2
Joined: Wed Dec 01, 2021 12:53 pm

requests.exceptions.TooManyRedirects API problem

Wed Dec 01, 2021 12:58 pm

Hello first of all thanks for all the hard work you provide to us.

I have a question regarding OS API regarding multiple language selection when searching new opensubtitles API
As stated in documentation language and string separated with , but obviously not working as to many redirects happen

This is the error i get

requests.exceptions.TooManyRedirects: Exceeded 30 redirects.

[*] payload = open_search.set_payload(moviehash=movie.file_hash, query=movie.title, imdb_id=movie.imdb_id, languages=lang, year=movie.year)[*]


https://github.com/razorblade23/Subtitl ... in.py#L364
Here is the Perma link to the code

Any help?

And regarding the forum and site, had to create a new account for this forum, aren't the forum and opensubtitles.org connected to same account?

User avatar
oss
Site Admin
Posts: 5879
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: requests.exceptions.TooManyRedirects API problem

Fri Dec 03, 2021 12:51 pm

Hi,

it is always good idea to actually write what you are searching, because it can be different error, and hard to understand from your text.

This works:

Code: Select all

curl -v -X GET 'https://api.opensubtitles.com//api/v1/subtitles?languages=fr,en&query=new.amsterdam.2018.s01e01.720p.hdtv.x264-syncopy.mkv' --header 'Api-Key: {api_key}'
write your code which doesnt work

for account - forum.opensubtitles.org and www.opensubtitles.org are using different accounts, and also www.opensubtitles.com is different (you have to import account from www.opensubtitles.org into www.opensubtitles.com) - we are moving everything (forum, blog...) on .com domain, where everything will work, like one would expect :)

FlameCRO
Posts: 2
Joined: Wed Dec 01, 2021 12:53 pm

Re: requests.exceptions.TooManyRedirects API problem

Fri Dec 03, 2021 1:28 pm

No matter if it's a tv show episode or a movie, searching for multiple languages at once doesn't work for me. Keep in mind when searching for a single language - it works, but selecting more languages ie en, hr two languages u get that to many redirects error

This works,

Code: Select all

https://api.opensubtitles.com/api/v1/subtitles?imdb_id=120744&languages=hr&moviehash=fbba534c1cc7d654&query=the+man+in+the+iron+mask&year=1998

Code: Select all

{'moviehash': 'fbba534c1cc7d654', 'query': 'The Man In The Iron Mask', 'imdb_id': '0120744', 'languages': 'hr', 'year': 1998}

But this gets me to many redirects

Code: Select all

{'moviehash': 'fbba534c1cc7d654', 'query': 'The Man In The Iron Mask', 'imdb_id': '0120744', 'languages': 'hr,en', 'year': 1998}

As stated in api's documentation, language codes separated with , should work.. not in my case. What am I doing wrong?


Edit: apparently i was mistyping some stuff. It works now!
Thank you


Another question, i just did the import account.
The old account works on opensubtitles.org and opensubtitles.com but not on forum.opensubtitles.org
It just works the one i created two days ago, is the problem present cause i used the same account and email like on old site to create on forum?
Last edited by FlameCRO on Fri Dec 03, 2021 1:51 pm, edited 1 time in total.

User avatar
oss
Site Admin
Posts: 5879
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: requests.exceptions.TooManyRedirects API problem

Tue Dec 14, 2021 12:24 pm

forum users another accounts, so yeah, you have to have 3 accounts for now. This will going to change with new system, where it will be all interconnected (and opensubtitles.org will be later turned off)

I hope all works for you.

Return to “Programs using OS”

Who is online

Users browsing this forum: No registered users and 30 guests