Hi there!
I made a golang library to access this new API rest here :https://github.com/TheForgotten69/go-opensubtitles
For now the expiration is set to 24 hours, as it might change my recommandation would be to have a system in place that refreshes the token once a query gets a 401 response.The new REST API looks so much more developer friendly and simple than the old one.
But the author fails to mention about how long after authentication the authorised token will remain valid, will it remain valid for the lifetime or it will get expired after some few mins/hrs..? Do we need to authenticate with username abs password all the time to acquire the token after it got expired... which in my opinion is not so convenient,
Looking forward to a fast response,
Thank you
Code: Select all
{
"message": "Not enough parameters"
}
Code: Select all
curl --location --request GET 'https://www.opensubtitles.com/api/v1/subtitles?languages=ca' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Api-Key: REDACTED' \
--header 'Cookie: osdb_locale=en; __cfduid=d011738bb5663588739407b26add4ba2c1609053117; languages=ca'
Hello! Nice work on the API
However I can't get it to work right now. I'm trying to search using the subtitles endpoint and I always get the following repsonse:
Here's my requestCode: Select all
{ "message": "Not enough parameters" }
Code: Select all
curl --location --request GET 'https://www.opensubtitles.com/api/v1/subtitles?languages=ca' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'Api-Key: REDACTED' \ --header 'Cookie: osdb_locale=en; __cfduid=d011738bb5663588739407b26add4ba2c1609053117; languages=ca'
I see! Thanks for the quick response.
the issue here is that you just search with a language.... that's not enough parameters (you can't just list all subtitles per languages like this if it's what you were trying to achieve). you need to send together a query, or some id.
The cookies appearing in the response was an error, it'll be gone very soon.
Code: Select all
https://www.opensubtitles.com/api/v1/subtitles?languages=ca&order_by=upload_date
Would take a bit of a different approach, making something like /discover/latest, taking a language parameter, that could do ?Do you think this could be re-implemented in the future? For me it's useful because there are not many uploads in my language so it's great to be able to get this without specifying a query.Code: Select all
https://www.opensubtitles.com/api/v1/subtitles?languages=ca&order_by=upload_date
Thank you very much.
That would be great!! Maybe just returning the last 15-20 results is enough because sometimes there will be no uploads during the last 7 daysWould take a bit of a different approach, making something like /discover/latest, taking a language parameter, that could do ?
While I'm there, how many results you want ? or last uploads in last 7 days ?
So I created the desired endpoint:That would be great!! Maybe just returning the last 15-20 results is enough because sometimes there will be no uploads during the last 7 daysWould take a bit of a different approach, making something like /discover/latest, taking a language parameter, that could do ?
While I'm there, how many results you want ? or last uploads in last 7 days ?
Working great for me.So I created the desired endpoint:That would be great!! Maybe just returning the last 15-20 results is enough because sometimes there will be no uploads during the last 7 daysWould take a bit of a different approach, making something like /discover/latest, taking a language parameter, that could do ?
While I'm there, how many results you want ? or last uploads in last 7 days ?
https://opensubtitles.stoplight.io/docs ... latest/get
Will return 60 results in case someone wants to display longer lists
hmm, a little tricky, it's all using global cached values for now.... but doable for sure, giving it a decent position in my to-do list.Any chance of getting the parameter 'year' added as well? Then it would be possible to get the latest uploaded narrowed to just the latest titles, i.e. year=2021
Users browsing this forum: No registered users and 29 guests