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()
-
authentication is working fine
-
drive.CreatFile({'id':id}
returnsGoogleDriveFile({'id': '1qiMxB207qvTNFyeVvgPalP-fyFqrx9jf'})
-
I've checked manually if the
file id
is correct using https://drive.google.com/uc?export=view&id=1qiMxB207qvTNFyeVvgPalP-fyFqrx9jf, it worked fine: Chrome started the download of the file.
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