python-opensubtitles
python-opensubtitles copied to clipboard
Python3 upload error
Hello there,
I have issues uploading subtitles, my code is simple:
...
if not already_in_db:
params = {'baseinfo': {
'idmovieimdb': imdb_id
},
'cd1': {
'subhash': sub_hash,
'subfilename': filename,
'subcontent': get_gzip_base64_encoded(file)
}}
url = ost.upload_subtitles(params)
And I have the project using the setup.py file installed and use Python 3.7 on Debian 10.
The issue is that the upload does not work (instead of the url None is returned) and if I use the debugger I get the following output:
The file is located in /usr/lib/python3.7/xmlrpc/client.py .
But the code runs without issues if I use Python2 instead.
I hope this helps fixing the issue and thank you for this project 😃
Sorry @HelloThere4587, I completely missed this issue.
Did you manage to make it work somehow with python 3? If not, could you provide all the test info: hashes, gzip of the subtitle, etc... that you used to reach that point where it fails?
Hi,
I got similar issue. And I fix it with this method :
if not already_in_db:
params = {'baseinfo': {
'idmovieimdb': imdb_id
},
'cd1': {
'subhash': sub_hash,
'subfilename': filename,
'subcontent': str(get_gzip_base64_encoded(file)) # add str here.
}}
url = ost.upload_subtitles(params)