emericg / OpenSubtitlesDownload

Automatically find and download the right subtitles for your favorite videos!
https://emeric.io/OpenSubtitlesDownload
GNU General Public License v3.0
581 stars 63 forks source link

opensubtitles.org API available only for logged users #51

Closed emericg closed 6 months ago

emericg commented 4 years ago

Here is a communication from opensubtitles.org

API REQUESTS MUST BE AUTHENTICATED

With Covid-19 pandemic requests for our API went skyrocket, our servers could not handle so much traffic, so we decided to limit API usage just to authenticated requests for User Agents. In short it means, you have to provide opensubtitles.org username and password in LogIn() method.

We are avare some of user agents doesn't implement authentication for numerous reasons.

What you can do for fix, if your app is affected:
- let your users know about this change
- implement LogIn() into your app with user authentication
- contact us for pricing, so your app can send unathenticated requests (e.g. if you have free and pro version of your app, it is possible free will work only with authenticated requests and pro works as before)

More info on [our forum](https://forum.opensubtitles.org/viewtopic.php?f=11&t=17110)

We are actively blocking IPs, which are sending unathenticated requests

Following a recent policy change from opensubtitles.org, the API is now available only for logged users.
To continue using applications like OpenSubtitlesDownload you simply need to:

Updated Now as far as I can tell, most users are experiencing these 401 errors, if not every users. Maybe this limitation triggers only for softwares with high volume of requests, for instance I cannot use kodi embedded subtitles downloader without using an account, but I've been using OpenSubtitlesDownload without account from the same IP.

So let's use this thread to discuss issues with using accounts.
Let me know if you've had success with OpenSubtitlesDownload without using an user account, or if you needed to set one up!

ManuLinares commented 4 years ago

This is my output today:

>> Opensubtitles.org servers refused the connection: 401 Unauthorized.
Please check:
- Your Internet connection status
 - www.opensubtitles.org availability
 - Your downloads limit (200 subtitles per 24h)
The subtitles search and download service is powered by opensubtitles.org. Be sure to donate if you appreciate the service provided!
joseph-giron commented 3 years ago

This is my output today:

>> Opensubtitles.org servers refused the connection: 401 Unauthorized.
Please check:
- Your Internet connection status
 - www.opensubtitles.org availability
 - Your downloads limit (200 subtitles per 24h)
The subtitles search and download service is powered by opensubtitles.org. Be sure to donate if you appreciate the service provided!

So register on opensubtitles.org, add the username and password to lines 61 and 62 of OpenSubtitlesDownload.py. Done.

damagu commented 3 years ago

I tried to use OpenSubtitlesDownload.py for the 1st time today because for quite a while now when I've tried to get subs via Kodi it's failed and I finally decided to try another method. I already registered with opensubtitles.org so when I opened the script to see how it worked and saw you can (or need to) enter a username and password, I went ahead and added them.

Even though I've done that, when I try to use the script I get the same messae as ManuLinares has reported.

Now... this might be related but I'm not sure... Australian ISPs are now required to block access to opensubtitles.org (as well as other subtitle services) so I'm running openvpn to tunnel out of Australia. Currently I have openvpn set to the US so when I use: wget http://ipecho.net/plain -O - -q; echo 173.XXX.XXX.XXX ... the ip address shown is one from the US . However, when I use wget to try to get something from opensubtitles.org: wget https://www.opensubtitles.org/en/subtitleserve/sub/8323684 --2020-08-23 13:21:50-- https://www.opensubtitles.org/en/subtitleserve/sub/8323684 Resolving www.opensubtitles.org (www.opensubtitles.org)... 202.XXX.XX.XXX Connecting to www.opensubtitles.org (www.opensubtitles.org)|202.XXX.XX.XXX|:443... failed: No route to host. ...I was expecting wget to fail seeing as opensubtitles.org now needs login info, but I definitely didn't expect to see an Australian IP in the output.

I don't know why this is happening or what it means or whether it might explain why the OpenSubtitlesDownload.py script isn't working for me but I thought I should mention it just in case.

Any help would be appreciated.

emericg commented 3 years ago

So register on opensubtitles.org, add the username and password to lines 61 and 62 of OpenSubtitlesDownload.py. Done.

Same thing happened to me today, 401 errors solved by using my account. I always had to use my account with kodi for instance, but never with OpenSubtitlesDownload.py, so I don't really know why now?

FriendlyTroll commented 3 years ago

Just some info regarding using an OpenSubtitles account.

For me this didn't work if I had some long password with underscores like "batboy_cost_smudge_cornbread_overlying_vertical_alto". I'm not sure if this is the issue with the script itself, because the login did work on OpenSubtitles web page with that long password.

When I changed the password to something shorter, with no underscores the script started working again.

emericg commented 3 years ago

Allright thanks for the report, I"ll have a lot at this issue tomorrow!

emericg commented 3 years ago

Ok it looks like OpenSubtitles actually limits password to 32 characters, the other ones are just cutted, so I did the similar thing and you should now be able to use long password with underscore again.

I also took this opportunity to improve the 401 error handling. Now there should be a proper explanation directly in the application, indicating how and why the log in is required.

FriendlyTroll commented 3 years ago

Hi thanks a lot for your effort!

I can confirm it works now with longer password.

damagu commented 3 years ago

Just letting you know that since I posted my comment, I found out that Australia has started blocking subtitle providers. So my local machine which runs kodi and I used to use to grab subs is not able to connect to opensubs or any other block subtitle site. Now I'll either have to download them to my seedbox and then transfer them to the local machine afterwards (which is what I've been doing recently) or I have to run openvpn on the kodi box so that I can get around the blocks and gain access to the subs sites.

emericg commented 3 years ago

In France changing the DNS used in the computers or directly in the routers is usually enough to bypass blocked sites, maybe that's worth a try?

emericg commented 6 months ago

opensubtitles.org is no more, and neither is this issue. everyone needs a new account now :)