0

我正在尝试使用带有管道的 bash 更新我的下载状态,并连接到我的电报机器人。

aria2c $url --summary-interval=5 2>&1 |
tee output.log |
grep --line-buffered ETA |
while read text; do
    echo "Downloaded $text"
curl -X POST -H 'Content-Type: application/json' -d "{\"message_id\":$msg_id, \"chat_id\": \"$ch_id\", \"text\": \"$text\", \"disable_notification\": true}" https://api.telegram.org/bot$TG_TOKEN/editMessageText
done

但这会每秒更新一次,因为电报会阻止编辑 msg(发送 5-6 条消息后)30 秒。所以我希望它每 5 秒更新一次。

我也试过--download-result=hide这个也行不通。Ofcrs 那是合乎逻辑的。

还有什么办法吗?

4

0 回答 0