So the plugin stopped working some weeks ago (at least on Windows). Running tests shows problem with urllib failing to make the connection
Code:
Failed to make identify query: 'https://www.kobo.com/search?Query=Turn+Coat+Jim+Butcher&fcmedia=Book&fclanguages=all'
Traceback (most recent call last):
File "mechanize\_urllib2_fork.py", line 1238, in do_open
File "http\client.py", line 1347, in getresponse
File "http\client.py", line 307, in begin
File "http\client.py", line 268, in _read_status
File "socket.py", line 669, in readinto
File "ssl.py", line 1241, in recv_into
File "ssl.py", line 1099, in read
socket.timeout: The read operation timed out
Seems like if request doesn't have
at least Accept, Accept-Language, and Accept-Encoding, it will fail with timeout
Adding this in __init__.py in identify() and download_cover() seems to fix some tests (some times (?); tbh this smells like cloudflare anti-bot protection or something)
Code:
br.set_current_header('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
br.set_current_header('Accept-Language', 'en-US,en-UK,en')
br.set_current_header('Accept-Encoding', 'gzip')
but it's not enough to fix the plugin (still no metadata or cover search results)
further testing shows that if you bump timeout to 60, it improves the rate of successfull responses dramatically (even though it never waits for 60 or even 30 seconds; it's a mystery)
and with that I made it work in UI as well