jdlorimer / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
216 stars 38 forks source link

Import Error (from Pocket) #53

Closed petergerten closed 6 years ago

petergerten commented 6 years ago

When trying to import from pocket I get this error:

Debug info:
Anki 2.1.0beta24 Python 3.6.3 Qt 5.10.0 PyQt 5.9.2
Platform: Linux
Flags: frz=False ao=True

Caught exception:
  File "/home/hart/.local/share/Anki2/addons21/1081195335/importer.py", line 143, in importPocket
  File "/home/hart/.local/share/Anki2/addons21/1081195335/importer.py", line 59, in importWebpage
    def importWebpage(self, url=None):
  File "/home/hart/.local/share/Anki2/addons21/1081195335/importer.py", line 31, in _fetchWebpage
    url = 'http://' + url
<class 'UnicodeDecodeError'>: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
ghost commented 6 years ago

As for myself, I get the following error when I answer "Yes" to "I have authenticated with Pocket" before the webpage has loaded.

Anki 2.1.0beta27 Python 3.6.2 Qt 5.9.2 PyQt 5.9
Platform: Linux
Flags: frz=True ao=True

Caught exception:
  File "/home/.../.local/share/Anki2/addons21/1081195335/importer.py", line 166, in importPocket
    accessToken = response.json()['access_token']
  File "site-packages/requests/models.py", line 894, in json
  File "json/__init__.py", line 354, in loads
  File "json/decoder.py", line 342, in decode
<class 'json.decoder.JSONDecodeError'>: Extra data: line 1 column 5 (char 4)

It might be because I've been playing with the code lately, even though I get this error with the original add-on as well.

Everything goes well, however, when I wait for the webpage to load before answering "Yes".

Does your error happen in both cases?

jdlorimer commented 6 years ago

I'll close this one until there is more information. Feel free to open it again, Peter.