带有 getUserPhotos 的电报照片格式
Telegram photo format with getUserPhotos
我使用 getUserPhotos 获取个人资料照片。我应该为 html src
属性使用的主要标准来源是什么? (我什至在电报的文档中进行了搜索,但没有得到解决方案。)
我的部分结果(类型是photos.Photos):
Array
(
[_] => photos.photosSlice
[count] => 14
[photos] => Array
(
[0] => Array
(
[_] => photo
[has_stickers] =>
[id] => 195744071274310414
[access_hash] => -5116812755800708610
[date] => 1472714208
[sizes] => Array
(
[0] => Array
(
[_] => photoSize
[type] => a
[location] => Array
(
[_] => fileLocation
[dc_id] => 4
[volume_id] => 425426808
[local_id] => 100105
[secret] => -7781982930425156181
)
[w] => 160
[h] => 160
[size] => 11694
)
...
您需要做的是使用以下方法下载您的文件或图片:
upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
其中 InputFileLocation
定义如下,可以从上面问题中的 PhotoSize.location
获得:
inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
有关文件下载的更多详细信息:https://core.telegram.org/api/files#downloading-files
我使用 getUserPhotos 获取个人资料照片。我应该为 html src
属性使用的主要标准来源是什么? (我什至在电报的文档中进行了搜索,但没有得到解决方案。)
我的部分结果(类型是photos.Photos):
Array
(
[_] => photos.photosSlice
[count] => 14
[photos] => Array
(
[0] => Array
(
[_] => photo
[has_stickers] =>
[id] => 195744071274310414
[access_hash] => -5116812755800708610
[date] => 1472714208
[sizes] => Array
(
[0] => Array
(
[_] => photoSize
[type] => a
[location] => Array
(
[_] => fileLocation
[dc_id] => 4
[volume_id] => 425426808
[local_id] => 100105
[secret] => -7781982930425156181
)
[w] => 160
[h] => 160
[size] => 11694
)
...
您需要做的是使用以下方法下载您的文件或图片:
upload.getFile#e3a6cfb5 location:InputFileLocation offset:int limit:int = upload.File;
其中 InputFileLocation
定义如下,可以从上面问题中的 PhotoSize.location
获得:
inputFileLocation#14637196 volume_id:long local_id:int secret:long = InputFileLocation;
有关文件下载的更多详细信息:https://core.telegram.org/api/files#downloading-files