Page 1 of 1

API user_id Search not working

Posted: Sun Oct 15, 2023 9:08 pm
by gooz
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?

Re: API user_id Search not working

Posted: Mon Oct 16, 2023 5:14 pm
by os_dev
oh, thanks for pointing out, just a typo, it should be "uploader_id"

Re: API user_id Search not working

Posted: Mon Oct 16, 2023 5:48 pm
by gooz
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?

Re: API user_id Search not working

Posted: Tue Oct 17, 2023 9:43 am
by os_dev
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

Re: API user_id Search not working

Posted: Tue Oct 17, 2023 4:48 pm
by gooz
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?

Re: API user_id Search not working

Posted: Fri Oct 20, 2023 2:06 pm
by os_dev
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.

Re: API user_id Search not working

Posted: Fri Oct 20, 2023 6:44 pm
by gooz

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!