如何从电报中获取真实尺寸(不是拇指)的照片? [英] How to get photo in real size (not thumb) from telegram?

查看:20
本文介绍了如何从电报中获取真实尺寸(不是拇指)的照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 getFile(),然后使用类似 https://api.telegram.org/file/bot<token>/<file_path> 的链接下载照片.但我只收到他的缩略图

I am using getFile() and then download photo with a link like https://api.telegram.org/file/bot<token>/<file_path>. But I received only his thumbnails

谁能问我如何下载真实尺寸的照片?

Can anyone ask me how to download photo in real size?

推荐答案

您从 Telegram 收到的 photo 对象包含一个具有不同大小的 file_id 的数组.索引越高,大小越大,所以你只需要选择正确的file_id.

The photo object you receive from Telegram contains an array with the file_id of different sizes. The higher the index, the bigger the size, so you just need to pick the right file_id .

它可能看起来像这样:

[{
    "file_id":"AgADBAADxxxx",
    "file_size":19374,
    "width":253,
    "height":320
},{
    "file_id":"AgADBAACxxxx",
    "file_size":75657,
    "width":632,
    "height":800
}]

这篇关于如何从电报中获取真实尺寸(不是拇指)的照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆