尝试使用curl从电报bot发送用户视频 [英] Trying to send user video from telegram bot using curl

查看:143
本文介绍了尝试使用curl从电报bot发送用户视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用命令:

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

发送视频文件 myvideo.mp4可以从我的机器人中以令牌值 token发送给电报用户chatID。

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

但是从电报cli发送时与 https://github.com/vysheng/tg (我在使用机器人之前就曾使用过)在以下情况下文件显示为黑色是在iPad或iBook电报客户端上打开的,但是如果我将其保存到相机胶卷中,则可以打开文件并在其中播放视频。该文件的大小为640x480,约为3Mb。
使用类似的技术发送消息或照片也可以正常工作
我需要进行一些调整才能使其正常工作吗?我已经看到了很多发送消息的示例或照片,bu

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. 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. The file is 640x480 and about 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.

推荐答案

尝试一下

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

这篇关于尝试使用curl从电报bot发送用户视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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