morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.79k stars 217 forks source link

blank result from subscene.com #891

Closed dausruddin closed 4 years ago

dausruddin commented 4 years ago

Describe the bug I use only subscene.com in my Bazarr installation. Since recently, Subscene won't produce any result. The search result is empty. But I can browse subscene.com perfectly fine in my browser.

To Reproduce Steps to reproduce the behavior:

  1. Search subtitle manually
  2. Result will be blanked

Expected behavior Automatic search working and manual search too.

Screenshots image

Software (please complete the following information):

Additional context

Throttling subscene for 10 minutes, until 20/03/27 22:43, because of: error. Exception info: 'BrotliDecompress failed'
morpheus65535 commented 4 years ago

Works fine for me with 0.8.4.3 in dev branch:

image

Could be corrupted cache. Maybe you can try to empty bazarr/config/cache directory?

dausruddin commented 4 years ago

Sorry but I don't have that path. But I have ./data/cache. Is this what you meant? Anyway I deleted all file inside ./data/cache and issue still persist.

So, I decided to reinstall. I deleted Bazarr folder and clone the git repo again. Unfortunately after setting up, the error still produced, and search result stays blank.

Throttling subscene for 10 minutes, until 20/03/28 09:56, because of: error. Exception info: 'BrotliDecompress failed'

Is there any files Bazarr create outside of its own folder?

morpheus65535 commented 4 years ago

Do you have valid username/password set for Subscene?

What anti-captcha provider are you using?

Whatever I try, it's always working for me...

dausruddin commented 4 years ago

Sorry for late reply. Unfortunately I don't have any anti-captcha configured because they were working for me for at least a couple of months.

I wanted to try anti-captcha, but they don't have a really cheap plan for me to test. Would be a waste if the issue persist after I bought a plan.

morpheus65535 commented 4 years ago

Subscene require anti-captcha. Period.

10$us for a life time (I literally used 0.50%us in the last year) should be cheap enough to be afforded by anyone.

Over the last month, over 37 000 subtitles have been downloaded from Subscene using Bazarr. I guess we can say that it's working... ;-)

dausruddin commented 4 years ago

There goes my $11.60.....

Proof I bought a plan. Bought using your referral link. image

Proof I loaded the key in my Bazarr image

Still getting the same error image

I also already setup my subscene credentials in Bazarr image

morpheus65535 commented 4 years ago

@pannal although I cannot reproduce this behaviour, maybe you can see something wrong here?

dausruddin commented 4 years ago

Somehow after many times re-cloning repo between dev and stable, then running them over and over with errors popping up, it is working fine now. Also it returns result much faster than ever.

These are some errors I got out of nowhere with 500 error code returned in browser, then somehow after so many retry, it works again

Traceback (most recent call last):
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 866, in _handle
    return route.call(**args)
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 1744, in wrapper
    rv = callback(*a, **ka)
  File "bazarr/main.py", line 133, in wrapper
    return func(*a, **ka)
  File "bazarr/main.py", line 261, in wizard
    base_url=base_url)
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 3623, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 3413, in render
    self.execute(stdout, env)
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 3400, in execute
    eval(self.co, env)
  File "/home/user/bazarr/views/wizard.tpl", line 114, in <module>
    % include('wizard_subtitles')
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 3390, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/home/user/bazarr/bazarr/../libs/bottle.py", line 3400, in execute
    eval(self.co, env)
  File "/home/user/bazarr/views/wizard_subtitles.tpl", line 113, in <module>
    <option value="{{language['code2']}}">{{language['name']}}</option>
TypeError: string indices must be integers
Traceback (most recent call last):
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 866, in _handle
    return route.call(**args)
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 1744, in wrapper
    rv = callback(*a, **ka)
  File "bazarr/main.py", line 133, in wrapper
    return func(*a, **ka)
  File "bazarr/main.py", line 778, in movies
    max_page = int(math.ceil(missing_count / (page_size + 0.0)))
TypeError: unsupported operand type(s) for /: 'str' and 'float'
Traceback (most recent call last):
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 866, in _handle
    return route.call(**args)
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 1744, in wrapper
    rv = callback(*a, **ka)
  File "bazarr/main.py", line 133, in wrapper
    return func(*a, **ka)
  File "bazarr/main.py", line 771, in movies
    missing_count = database.execute("SELECT COUNT(*) as count FROM table_movies", only_one=True)
TypeError: string indices must be integers
dausruddin commented 4 years ago

Ok. After I had subscene working, I stopped bazar and run using systemd instead. Now the issue came back.

Then I rename bazarr folder from bazarr-dev to something else and run it, now i'm getting this error Now bazarr is running fine again, but subscene still not working.

Traceback (most recent call last):
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 866, in _handle
  File "/home/user/bazarr-dev/bazarr/../libs/bottle.py", line 1744, in wrapper
  File "bazarr/main.py", line 133, in wrapper
    return func(*a, **ka)
  File "bazarr/main.py", line 892, in movie
    tmdbid = movies_details['tmdbId']
TypeError: string indices must be integers
dausruddin commented 4 years ago

I don't know why bazarr randomly throwing random errors like mentioned above. Here is another

Traceback (most recent call last):
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 866, in _handle
    return route.call(**args)
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 1744, in wrapper
    rv = callback(*a, **ka)
  File "bazarr/main.py", line 133, in wrapper
    return func(*a, **ka)
  File "bazarr/main.py", line 1675, in system
    return template('system', bazarr_version=bazarr_version,
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 3623, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 3413, in render
    self.execute(stdout, env)
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 3400, in execute
    eval(self.co, env)
  File "/home/user/bzd/views/system.tpl", line 53, in <module>
    % include('menu.tpl')
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 3390, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/home/user/bzd/bazarr/../libs/bottle.py", line 3400, in execute
    eval(self.co, env)
  File "/home/user/bzd/views/menu.tpl", line 78, in <module>
    % wanted_series = database.execute("SELECT COUNT(*) as count FROM table_episodes WHERE missing_subtitles != '[]'" + monitored_only_query_string_sonarr, only_one=True)['count']
TypeError: string indices must be integers
dausruddin commented 4 years ago

Boommm somehow bazarr is working again, including subscene. I cannot even understand what is happening, but I'm going to leave bazarr for now because I might get the issue next time I restarted it.

I'm going to play with it more later, maybe I can find the pattern.

morpheus65535 commented 4 years ago

Your bazarr.db seems to be somehow corrupted or maybe you got a permission issue over it.

dausruddin commented 4 years ago

I tried opening the db file using DB Browser for SQLite on my Windows, also using command-line sqlite3 on my Linux server and they both can open the database and browse through the data. I doubt there is a permission issue because I am running Bazarr using the same user as I'm logged in.


So my guesses are:

Can we force a provider search? When I'm trying subscene which is throttled, it will quickly returning {"data": null} (the search interface still loading, maybe can fix that to show error message instead of infinite loading). I can only retry subscene after the 10 minutes passed by. It is hard to keep testing when I have 10 minutes cooldown.

Edit: Looks like it. Subscene is working fine on my Python 3.8.2 (pyenv) and not on my Python 3.6.9 (system). Also I force provider search by deleting subscene throttled entry in data/config/config.ini, then restart Bazarr.

morpheus65535 commented 4 years ago

Hey, thanks for this thorough investigation! :-)

We had a lot of issues with Python 3.6.9 lately and I was already thinking about adjust requirement to use >=3.7. I think I'll do it right now. In fact, over the last 7 days, only 0.32% of Bazarr users were using 3.6.9. The impact won't be that big.

As for resetting throttling status, you've got the right trick by emptying the value in config.ini and restarting Bazarr.

So I guess we can consider this issue solved by using 3.8.2, right?

dausruddin commented 4 years ago

Yes I think this issue is solved. Thanks😁

But are you sure want to drop Python 3.6 support? Because that is the latest Python3 version on Ubuntu 18.04 by default.

morpheus65535 commented 4 years ago

Yes I am, some of our dependencies have dropped support for 3.6.x anyway.

dausruddin commented 4 years ago

Okay. Thanks a lot for this awesome software😁