-
-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opensubtitle API deprecation, New REST API and VIP account #1063
Comments
The project https://github.com/emericg/OpenSubtitlesDownload is another example. |
Just a little FYI, but dusking/opensubtitles-com isn't working for me at this date and time. I double checked that my credentials entered for the script were valid and correct.
I'm on Windows. |
Is there any way to get autosub or subliminal to skip opensubtitles and try the other sites now until this is fixed? It's a blocker issue as it is for me now and I'd really like my mpv autosub script to work again. |
You can add it to
|
What a great find! That should make it really easy to update the Open Subtitles provider in subliminal for someone who is familiar with Python and subliminal. Since that's not me, and my end goal is to download subtitles with the press of a key in mpv, I just adapted the autosub.lua mpv script I was using to work with this project instead of subliminal. Works like a charm! It can also run alongside autosub.lua. Maybe someone else finds it useful as well (such as @vandonsel):
|
@kaoneko I had no idea they were operating under two different TLDs and with a completely different API/Codebases, damn. Thanks for pointing that out. |
Hmm... just out of curiosity - wouldn't switching domain from .org to .com fix the issue? or the api is completely different? |
No, the new API is a complete rewrite and works differently, so code needs to be rewritten to communicate with the new API. It's not just a domain name change. |
Under mac with brew it was somewhat more convoluted and required virt_evn:
But afterwards it worked:
|
Hmm, but isn't this issue about opensubtitles**.com**? I tried passing |
Can you test now that #1077 is merged ?
Don't forget to pull the changes to
Thanks! |
I checked
|
Hi, I tried the development version and it worked just fine:
But it takes about 10 seconds to download the subtitle, whereas opensubtitlescom does it in less than 2. That one fails when using the command where it's supposed to use some hash of the video file though, it only worked when I searched by file name and downloaded the first result. Does the slowness of subliminal have something to do with calculating a file hash? Big Buck Bunny Part Two is a whopping 8 GB so that might take a while. Can't wait to see it by the way, part one was quite nice, with Buck Bunny getting stranded on that sand planet with them crazy big worms! I'll see if I can find some time to watch it now that I got the subtitles too 😉 |
So... while I quickly encountered
|
Thanks for.testing!
You only need to.login to download the file (actually to get the download link), for searching you only need to provide an api key. This key is for.testing for now, it allows downloading 100 subs a day instead of 5 (this is just temporary).
But I think you need to have your own account (username and password) to download subtitles, no?
Regarding the hash, it could be what is taking so.much time, but I am not familiar with the code for hashing. And it cannot be skipped I think, it's a mandatory refiner.
…On 24 May 2024 20:38:05 GMT+01:00, kaoneko ***@***.***> wrote:
So... while I quickly encountered `429 Client Error: Too Many Requests for url: https://api.opensubtitles.com/api/v1/login` with `ost` while testing, subliminal just kept working. Turns out it doesn't even matter what credentials I use. It uses an API key? This is just for testing?
> ```
> #: Opensubtitles.com API key for subliminal
> OPENSUBTITLESCOM_API_KEY = "mij33pjc3kOlup1qOKxnWWxvle2kFbMH"
> ```
> opensubtitlescom.py
--
Reply to this email directly or view it on GitHub:
#1063 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
The subliminal development version seems to require something to be given as the username and password, but not actually use it. And it took about 10 seconds, even though there was no video file on my computer called "The Matrix". So it's just a search term, no hashing is taking place. Also, the subliminal process uses A LOT of CPU towards the end, hitting 99% and engaging the fan in my computer. Compare this to using |
oh hm, the 99% CPU usage is something definitely worth investigating.. for what it's worth, i can reproduce subliminal using more CPU than expected, but it's nowhere near 100% for me |
To be more precise: it nears 100% of 1 out of 4 CPUs on a 2015 |
Can you try with another provider ( It can be because |
You need to add And actually, OpenSubtitlesCom is not working at all from the command line because no languages are defined! |
Where's the option documented? What does it do? |
With I'm having that
|
|
time subliminal --debug --opensubtitlescom who cares download -sl en "The Matrix"Collecting videos [------------------------------------] 0% The MatrixDEBUG:subliminal.cli:Collecting path The Matrix DEBUG:subliminal.core:Found subtitles {} INFO:subliminal.core:Refining video with hash ERROR:subliminal.utils:Unexpected error. Failed to refine video 'The Matrix' Traceback (most recent call last): File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/core.py", line 552, in refine refiner_manager[refiner].plugin(video, **dict((refiner_configs or {}).get(refiner, {}), **kwargs)) File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/refiners/hash.py", line 29, in refine if video.size <= 10485760: TypeError: '<=' not supported between instances of 'NoneType' and 'int' INFO:subliminal.core:Refining video with metadata INFO:subliminal.core:Refining video with omdb ERROR:subliminal.utils:HTTP error 401. Failed to refine video 'The Matrix' Traceback (most recent call last): File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/core.py", line 552, in refine refiner_manager[refiner].plugin(video, **dict((refiner_configs or {}).get(refiner, {}), **kwargs)) File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/refiners/omdb.py", line 161, in refine results = search(video.title, 'movie', video.year) File "/home/kaoneko/.local/lib/python3.8/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1634, in get_or_create_for_user_func return self.get_or_create( File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1094, in get_or_create with Lock( File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/lock.py", line 185, in __enter__ return self._enter() File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/lock.py", line 94, in _enter generated = self._enter_create(value, createdtime) File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/lock.py", line 178, in _enter_create return self.creator() File "/home/kaoneko/.local/lib/python3.8/site-packages/dogpile/cache/region.py", line 1048, in gen_value created_value = creator( File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/refiners/omdb.py", line 82, in search results = omdb_client.search(title, type, year) File "/home/kaoneko/.local/lib/python3.8/site-packages/subliminal/refiners/omdb.py", line 64, in search r.raise_for_status() File "/home/kaoneko/.local/lib/python3.8/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://www.omdbapi.com/?r=json&v=1&s=The+Matrix&type=movie&page=1 Collecting videos [####################################] 100% 1 video collected / 0 video ignored / 0 error Downloading subtitles [------------------------------------] 0% The MatrixINFO:subliminal.core:Skipping provider 'argenteam': not a valid video INFO:subliminal.core:Skipping provider 'gestdown': not a valid video INFO:subliminal.core:Listing subtitles with provider 'opensubtitles' and languages {<Language [en]>} INFO:subliminal.core:Initializing provider opensubtitles INFO:subliminal.core:Skipping provider 'opensubtitlescom': no language to search for INFO:subliminal.core:Listing subtitles with provider 'podnapisi' and languages {<Language [en]>} INFO:subliminal.providers.opensubtitles:Logging in INFO:subliminal.core:Skipping provider 'tvsubtitles': not a valid video INFO:subliminal.core:Skipping provider 'thesubdb': not a valid video INFO:subliminal.core:Initializing provider podnapisi INFO:subliminal.providers.podnapisi:Searching subtitles {'keywords': 'The Matrix', 'language': 'en', 'movie_type': 'movie'} DEBUG:subliminal.providers.opensubtitles:Logged in with token 'YJa1qeaxuMLhrP9qWAry7onPpN3' INFO:subliminal.providers.opensubtitles:Searching subtitles [{'tag': 'The Matrix', 'sublanguageid': 'eng'}, {'query': 'The Matrix', 'sublanguageid': 'eng'}] DEBUG:subliminal.providers.opensubtitles:Found subtitle <OpenSubtitlesSubtitle '1957484378' [en]> by fulltext ...99 more of those... DEBUG:subliminal.providers.podnapisi:Found subtitle <PodnapisiSubtitle '3FFH' [en]> ...95 more of those... INFO:subliminal.score:Computing score of <OpenSubtitlesSubtitle '1957484378' [en]> for video <Movie [The Matrix]> with {'hearing_impaired': False} DEBUG:subliminal.score:Using scores {'hash': 269, 'title': 135, 'year': 45, 'country': 45, 'release_group': 15, 'streaming_service': 15, 'source': 7, 'audio_codec': 3, 'resolution': 2, 'video_codec': 2, 'hearing_impaired': 1} DEBUG:subliminal.score:Found matches {'country'} DEBUG:subliminal.score:Matched hearing_impaired INFO:subliminal.score:Computed score 46 with final matches {'hearing_impaired', 'country'} ...hundreds of those... DEBUG:subliminal.score:Found matches {'country'} DEBUG:subliminal.score:Matched hearing_impaired INFO:subliminal.score:Computed score 46 with final matches {'hearing_impaired', 'country'} INFO:subliminal.core:Downloading subtitle <OpenSubtitlesSubtitle '1951678630' [en]> INFO:subliminal.providers.opensubtitles:Downloading subtitle <OpenSubtitlesSubtitle '1951678630' [en]> DEBUG:subliminal.core:All languages downloaded Downloading subtitles [####################################] 100% DEBUG:subliminal.core:Terminating initialized providers INFO:subliminal.core:Terminating provider podnapisi INFO:subliminal.core:Terminating provider opensubtitles INFO:subliminal.providers.opensubtitles:Logging out DEBUG:subliminal.providers.opensubtitles:Logged out INFO:subliminal.core:Saving <OpenSubtitlesSubtitle '1951678630' [en]> to 'The Matrix.srt' Downloaded 1 subtitle |
I just pushed #1088 |
|
subliminal --debug --opensubtitlescom 'realusername' 'realpassword' download -p opensubtitlescom -sfl en "The Matrix"
|
|
@vitusson I have to uninstall the previous dev version and install it again to get the update. |
Thanks @Lovecraft-github , now I get the same result as you |
Yeah, very good news. I've been using it with autosub.lua in mpv this night and is usable again. |
Not sure if this is already known, but it seems like there's some kind of rate limit. After downloading 80 subtitles successfully and then 19 more, I get an error:
I have experienced this pattern of successfully downloading and then later failing to download twice. It seems to reset after some time, which is what gives me the impression of a rate limiter. |
It seems you are hitting the limit of the API key, that is of 100 downloads a day in test mode, then it goes down to 10 a day. |
This issue can be closed after the new release. Open a new issue if you still find error related to the |
The old opensubtitle.org API has been deprecated and only will work in the future for VIP accounts.
With these changes, the method used by subliminal is no longer working and only download a subtitle with an ad.
The info at this time is a bit confusing and trends to imply that only VIPs will can download subtitles with the API.
But it seems to be only true for the old API from dot org.
For example, I found this project https://github.com/dusking/opensubtitles-com that use the new APi from dot com and it can download subtitles only with the user and password without pay.
Is there any chance that it will be used in subliminal in the future?
The text was updated successfully, but these errors were encountered: