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.
korrath83
Posts: 1
Joined: Sun Jul 23, 2023 3:35 pm

Bazarr 1.2.4 Issue

Sun Jul 23, 2023 3:42 pm

Hi,

I signed up for VIP membership yesterday and have been trying to incorporate opensubtitles.com into bazarr and having followed all guidance on the bazarr discord and github I have read that this now appears to be an issue with open subtitles. Since 1.2.4 has been released the authentication error has changed from too many request even though it was 0/1000 to now saying login failed. I have reset the bazarr cache, attempted a full clean install of bazarr and also changed my password to something much more simple on opensubtitles.com but yet i still received the "login failed" with the logs.

Any help would be appreicated.

Thanks

tecnobrat
Posts: 2
Joined: Sun Jul 23, 2023 11:17 pm

Re: Bazarr 1.2.4 Issue

Sun Jul 23, 2023 11:19 pm

I just did a little debugging. It appears bazarr is receiving a `invalid token` error when trying to use the download endpoint of the API.

Searching appears to be working, but downloads return a 401 with the above error.

I did some extra debugging. If I use curl with the same API key and token as bazarr is using, it fails. However I created my own API key in my OS account, and I used that instead of the hardcoded bazarr API key (using curl again) and it worked.

So my guess is there is either something wrong with the bazarr API key, or something wrong on OS's API.

Here is a slightly redacted log from bazarr: https://gist.github.com/tecnobrat/7079c ... a4ef6c4193

And my testing:
[bstolz@owl ~] curl --request POST \
--url https://api.opensubtitles.com/api/v1/download \
--header 'Accept: application/json' \
--header 'Authorization: Bearer REDACTED' \
--header 'Content-Type: application/json' \
--header 'Api-Key: s38zmzVlW7IlYruWi7mHwDYl2SfMQoC1' \
--data '{ "file_id": 7203216 }'

{"message":"invalid token","uk":"app_166_REDACTED","uid":2,"ts":1690146711}%

[bstolz@owl ~] curl --request POST \
--url https://api.opensubtitles.com/api/v1/download \
--header 'Accept: application/json' \
--header 'Authorization: Bearer REDACTED' \
--header 'Content-Type: application/json' \
--header 'Api-Key: MY_API_KEY' \
--data '{ "file_id": 7203216 }'

{"link":"REDACTED","file_name":"American Gods (2017) - S01E03 - Head Full of Snow [Bluray-1080p][10bit][x265][AAC 5.1]-RAR.srt","requests":1,"remaining":4,"message":"Your quota will be renewed in 2 hours and 47 minutes (2023-07-23 23:59:59 UTC) ts=1690146745 ","reset_time":"2 hours and 47 minutes","reset_time_utc":"2023-07-23T23:59:59.999Z","uk":"app_50246_REDACTED","uid":2,"ts":1690146745}
Now that I look closer, I'm 99% sure this issue is on OS's end. I have a VIP account and its saying that my limit there is only 5, which means that OS thinks I am making this request unauthenticated.
Last edited by tecnobrat on Sun Jul 23, 2023 11:31 pm, edited 4 times in total.

User avatar
oss
Site Admin
Posts: 5890
Joined: Sat Feb 25, 2006 11:26 pm
Contact: Website

Re: Bazarr 1.2.4 Issue

Mon Jul 24, 2023 7:01 am

Hi

thanks for report. It is quite strange - but lets fix it. So what I did is in curl:
- called /login, have token, /download endpoint with token -> I get link
- if you are logged in, /login will always sends you same token (thats new)
- you can call /logout with DELETE method and jwt token to log out you and then /login will get new token.

you can also send me your JWT token via PM to have a look, wondering if it is expired.

tldm
Posts: 1
Joined: Mon Jul 24, 2023 4:04 pm

Re: Bazarr 1.2.4 Issue

Mon Jul 24, 2023 4:12 pm

I have also been having the same issue for the last couple of days. Getting the invalid token error until around 10:00 UTC. after that everything works for a little while.

Manually clearing the token seems to work for a temporary fix though, Thanks.

Also,it may be worth noting in the API documentation that the "API Key" header is required for the logout request.

tecnobrat
Posts: 2
Joined: Sun Jul 23, 2023 11:17 pm

Re: Bazarr 1.2.4 Issue

Mon Jul 24, 2023 4:37 pm

I did inspect the JWT, and it was not expired.

However, I did try it again this morning and now its working. My JWT is valid and the response shows the correct VIP rate limits.

The expiry on my current JWT is in 23 hours. The token i was using last night expired in a few hours, but it was still valid (and yes, I paid attention to UTC).

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

Re: Bazarr 1.2.4 Issue

Mon Jul 24, 2023 5:08 pm

I did inspect the JWT, and it was not expired.

However, I did try it again this morning and now its working. My JWT is valid and the response shows the correct VIP rate limits.

The expiry on my current JWT is in 23 hours. The token i was using last night expired in a few hours, but it was still valid (and yes, I paid attention to UTC).
everything should work now, there was a little mixup of expiration times in the caching mechanism that was fixed this morning.

Return to “Programs using OS”

Who is online

Users browsing this forum: No registered users and 21 guests