Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

using command:

(使用命令:)

curl -s _X POST "https://api.telegram.org/bot<token>/sendVideo -F chat_id=<chatID> -F video="@myvideo.mp4"

sends a video file "myvideo.mp4" ok to the telegram user chatID from my bot with token value "token" .

(从我的机器人向令牌用户chatID发送一个视频文件“ myvideo.mp4”,并带有令牌值“ token”。)

However unlike when sending from the telegram-cli https://github.com/vysheng/tg (I used previous to bots being available) the file appears black when opened on an iPad or iBook telegram client.

(但是,与从电报cli https://github.com/vysheng/tg发送时(我之前曾使用过bot时使用过)发送的文件不同,在iPad或iBook电报客户端上打开时,文件显示为黑色。)

However if I save it from there to the Camera Roll I can open the file and play the video there.

(但是,如果我从那里将其保存到“相机胶卷”中,则可以打开文件并在那里播放视频。)

On an iMac desktop telegram client I can click the file and open it with QuickTime player OK.

(在iMac桌面电报客户端上,我可以单击文件并使用QuickTime Player OK打开它。)

The file is 640x480 and about 3Mb.

(该文件为640x480,约为3Mb。)

Sending messages or photos using a similar technique works fine.

(使用类似的技术发送消息或照片效果很好。)

Any ideas what I need to tweak to get this to work properly?

(有什么需要调整才能正常工作的想法吗?)

I have seen lots of examples for sending messsages or photos, but can find none for sending videos.

(我已经看到了许多发送邮件或照片的示例,但找不到发送视频的示例。)

  ask by rbn translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
446 views
Welcome To Ask or Share your Answers For Others

1 Answer

尝试这个

curl -F video=@"/path/to/video/file" https://api.telegram.org/bot<token>/sendVideo?chat_id=<chat_id>


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...