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.
gooz
Posts: 4
Joined: Sun Oct 15, 2023 8:58 pm

API user_id Search not working

Sun Oct 15, 2023 9:08 pm

I'm trying to request the Opensubtitles uploads of a given user_id but it's returning:

{'errors': ['Not enough parameters'], 'status': 400}

The request body is:
headers = {
'Api-Key': <API_KEY>,
'Content-Type': 'application/json',
'User-Agent': 'MyApp v1.2.3',
}

params = {
'user_id': '8411358',
}

r = requests.get('https://api.opensubtitles.com/api/v1/subtitles', params=params, headers=headers)

According to the API documentation the user_id parameter should be used alone though:
user_id integer
To be used alone - for user uploads listing

How to correctly perform this search?

os_dev
Posts: 194
Joined: Wed Oct 17, 2018 3:42 pm

Re: API user_id Search not working

Mon Oct 16, 2023 5:14 pm

oh, thanks for pointing out, just a typo, it should be "uploader_id"

gooz
Posts: 4
Joined: Sun Oct 15, 2023 8:58 pm

Re: API user_id Search not working

Mon Oct 16, 2023 5:48 pm

oh, thanks for pointing out, just a typo, it should be "uploader_id"
Oh, that's it. Thanks for the fix.

It seems to be working now, however the response gives empty results:
{
'total_pages': 0,
'total_count': 0,
'per_page': 60,
'page': 1,
'data': []
}
Should I add another parameter?

os_dev
Posts: 194
Joined: Wed Oct 17, 2018 3:42 pm

Re: API user_id Search not working

Tue Oct 17, 2023 9:43 am

oh, thanks for pointing out, just a typo, it should be "uploader_id"
Oh, that's it. Thanks for the fix.

It seems to be working now, however the response gives empty results:
{
'total_pages': 0,
'total_count': 0,
'per_page': 60,
'page': 1,
'data': []
}
Should I add another parameter?

no, just the user_id... the key is to find it, so when I say the user_id, I don't mean "os_dev" or "gooz", I mean the user_id you get at /infos/user

gooz
Posts: 4
Joined: Sun Oct 15, 2023 8:58 pm

Re: API user_id Search not working

Tue Oct 17, 2023 4:48 pm

no, just the user_id... the key is to find it, so when I say the user_id, I don't mean "os_dev" or "gooz", I mean the user_id you get at /infos/user
Oh, I see...

Yes, I was using the integer user ID, but from the opensubtitles.org domain not the opensubtitles.com.

I just noticed the IDs are different!

Now, the problem is several subtitles that have an uploader on .org are showing as NULL in the .com.

For example:

This film has all the 7 uploaders identified here:
https://www.opensubtitles.org/en/search ... ie-1219863

But only 3 here:
https://www.opensubtitles.com/en/all/se ... _sources-1

Is there a way to retrieve the uploader information from .org using the API?

os_dev
Posts: 194
Joined: Wed Oct 17, 2018 3:42 pm

Re: API user_id Search not working

Fri Oct 20, 2023 2:06 pm

no, just the user_id... the key is to find it, so when I say the user_id, I don't mean "os_dev" or "gooz", I mean the user_id you get at /infos/user
Oh, I see...

Yes, I was using the integer user ID, but from the opensubtitles.org domain not the opensubtitles.com.

I just noticed the IDs are different!

Now, the problem is several subtitles that have an uploader on .org are showing as NULL in the .com.

For example:

This film has all the 7 uploaders identified here:
https://www.opensubtitles.org/en/search ... ie-1219863

But only 3 here:
https://www.opensubtitles.com/en/all/se ... _sources-1

Is there a way to retrieve the uploader information from .org using the API?
yeah there will stil be issues with subtitles synchronisation for a while, so I added the field "legacy_uploader_id" in both responses from the api, and possible requests for the subtitles search.

please try it out, will add it to the documentation shortly.

gooz
Posts: 4
Joined: Sun Oct 15, 2023 8:58 pm

Re: API user_id Search not working

Fri Oct 20, 2023 6:44 pm


yeah there will stil be issues with subtitles synchronisation for a while, so I added the field "legacy_uploader_id" in both responses from the api, and possible requests for the subtitles search.

please try it out, will add it to the documentation shortly.

Oh, that's perfect. Works like a charm now.

I can't thank you enough!

Return to “Developing”

Who is online

Users browsing this forum: No registered users and 28 guests