bazarr icon indicating copy to clipboard operation
bazarr copied to clipboard

Provider regielive JSON Decode error

Open Bruny07 opened this issue 3 years ago • 3 comments

Describe the bug Since a few days regielive.ro provider throws a JSON Decode error when trying to search for a subtitle

Software (please complete the following information):

  • Bazarr: v0.9.7
  • Sonarr version 3.0.6.1265
  • OS: Linux

Additional context

28/08/2021 13:27:55|DEBUG |urllib3.connectionpool |Starting new HTTP connection (1): api.opensubtitles.org:80| 28/08/2021 13:27:55|DEBUG |urllib3.connectionpool |Starting new HTTP connection (1): api.regielive.ro:80| 28/08/2021 13:27:55|DEBUG |urllib3.connectionpool |http://api.opensubtitles.org:80 "POST /xml-rpc HTTP/1.1" 200 190| 28/08/2021 13:27:55|INFO |subliminal_patch.providers.opensubtitles|No subtitles found| 28/08/2021 13:27:55|DEBUG |urllib3.connectionpool |http://api.regielive.ro:80 "POST /kodi/cauta.php HTTP/1.1" 301 162| 28/08/2021 13:27:55|DEBUG |urllib3.connectionpool |Starting new HTTPS connection (1): api.regielive.ro:443| 28/08/2021 13:27:56|DEBUG |urllib3.connectionpool |https://api.regielive.ro:443 "GET /kodi/cauta.php HTTP/1.1" 404 None| 28/08/2021 13:27:56|ERROR |subliminal_patch.core |Unexpected error in provider 'regielive': Traceback (most recent call last): File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/core.py", line 170, in list_subtitles_provider results = self[provider].list_subtitles(video, provider_languages) File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/providers/regielive.py", line 108, in list_subtitles return self.query(video, self.language) File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/providers/regielive.py", line 92, in query logger.info(response.json()) File "/app/bazarr/bin/bazarr/../libs/requests/models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from Nonejson.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)|Traceback (most recent call last): File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/core.py", line 170, in list_subtitles_provider results = self[provider].list_subtitles(video, provider_languages) File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/providers/regielive.py", line 108, in list_subtitles return self.query(video, self.language) File "/app/bazarr/bin/bazarr/../libs/subliminal_patch/providers/regielive.py", line 92, in query logger.info(response.json()) File "/app/bazarr/bin/bazarr/../libs/requests/models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.8/json/init.py", line 357, in loads return _default_decoder.decode(s) File "/usr/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from Nonejson.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 1)| 28/08/2021 13:27:56|INFO |root |Throttling regielive for 10 minutes, until 21/08/28 13:37, because of: JSONDecodeError. Exception info: 'Expecting value: line 2 column 1 (char 1)'| 28/08/2021 13:27:56|INFO |socketio.server |emitting event "data" to all [/]| 28/08/2021 13:27:56|INFO |subliminal_patch.core |Discarding provider regielive|

Bruny07 avatar Aug 28 '21 11:08 Bruny07

Seems like the API URL reused from Kodi addons isn't working properly anymore and return a 404.

@GermanG are you able to take a look at it and see if there's something we can do about it? I'll try to contact the site admin by email.

morpheus65535 avatar Aug 28 '21 13:08 morpheus65535

Confirmed, the API as I knew it is not there anymore. The host api.regilive.ro is still there but it's just a "hello" result there and nothing else, my provider was based on the kodi plugin because I couldn't find any better documentation, just looked again and found my own gist as a top result in google. :/ Played a while with urls with no luck, I hope you have better luck contacting the site admin @morpheus65535 The only alternative I can see is rewrite a scrap based one.

GermanG avatar Aug 29 '21 08:08 GermanG

@GermanG thanks for your time, I'll keep you informed if I ever get any news from the site admin.

morpheus65535 avatar Aug 29 '21 12:08 morpheus65535

I created a "wrapper" for the regielive API with local caching (in order to make it light on the regielive website). It's a drop in replacement, so if anyone wants to use it they can just replace the URL and it magically works. I used it successfully on my local machine since the api stopped working.

I can post the URL if morpheus thinks it's okay.

alexandrucatalinene avatar Dec 15 '22 10:12 alexandrucatalinene

Or you can create a PR with the new url, is it still regielive.ro?

GermanG avatar Dec 15 '22 11:12 GermanG

@alexandrucatalinene of course I'll be happy to receive a PR for this. :-)

morpheus65535 avatar Dec 15 '22 15:12 morpheus65535

Should be fixed by @alexandrucatalinene PR. Feel free to test and confirm!

morpheus65535 avatar Dec 20 '22 11:12 morpheus65535

Fixed in development branch by #2032

morpheus65535 avatar Jan 09 '23 12:01 morpheus65535