googlearchive/PyDrive

GetContentString() returns UnicodeDecodeError: 'utf-8' codec can't decode byte

Closed this issue · 0 comments

drive = GoogleDrive(await gAuth())
return drive.CreateFile({'id': id}).GetContentString()

The error displayed is the following: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 42: invalid continuation byte. I don't know how to provide you the string that the function fail to process, if needed I'll try to get it anyway. The file is a .MOV video.

I've also tried with the option that @RNabel suggest here #74, so

f = drive.CreateFile({'id': id})
f.FetchContent()
content_string = f.content.getvalue().decode('unicode_escape')

the error returned this time is UnicodeDecodeError: 'unicodeescape' codec can't decode bytes in position 34583-34584: truncated \uXXXX escape