文件引用的GetUserPhotosRequest方法



我尝试获取文件文件引用,但无法解码结果

with TelegramClient('anon', api_id, api_hash) as client:
result = client(functions.photos.GetUserPhotosRequest(
user_id='******',
offset=0,
max_id=0,
limit=0
))
array_of_photos = result.photos
for photo in array_of_photos:
usert_photo = photo.file_reference
print(usert_photo.decode('utf-8'))

结果:

b'x00_Fx1a:xc6x1ex9exc0xd9x18x95xffx02x01rxff8dxf2xb9'
b"x00_Fx18xb6xd51xbax1ekx17x0cxc6Ix15x96xb4x89xb3xa6'"
b'x00_Fx18xa6xc0xf72*FNxe0|x11x9f+Mxfexe8Ab'

错误:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xad in position 7: invalid start byte

该引用不能解码为字符串,应存储为字节。

相关内容

  • 没有找到相关文章

最新更新