Closed sabydjuli closed 3 years ago
begin from line 119, change it like this
org_data = getter.get()
try:
**thisdata** = gzip.decompress(org_data)
except:
**thisdata** = org_data
try:
data = **thisdata**.decode('utf-8')
except:
try:
data = **thisdata**.decode('euc-jp')
except:
raise Exception('Unknown encoding.')
no **
Thank you @persia7emily for the solution, it works perfectly now!
I've used the code multiple times before this without issue, but today I tried to use it and got the following error despite doing the same as before...
Traceback (most recent call last): File "xx", line 125, in get_download_info data = org_data.decode('utf-8') UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "xx", line 128, in get_download_info data = org_data.decode('EUC-JP') UnicodeDecodeError: 'euc_jp' codec can't decode byte 0x8b in position 1: illegal multibyte sequence
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "xx", line 307, in
start_download(url)
File "xx", line 97, in start_download
download_info = get_download_info(url)
File "xx", line 130, in get_download_info
raise Exception('Unknow encoding.')
Exception: Unknow encoding.
Any help would be much appreciated, thank you!