This unacceptable error occurs when using ytdl-core and telegraf javascript, all because of these two lines of code:
let video = ytdl('https://www.youtube.com/watch?v=ipAnwilMncI').pipe(fs.createWriteStream(`${ctx.from.id}.webm`));
ctx.replyWithVideo(video)
full text of the error:
C:\Program Files\nodejs\node.exe .\index.js
Uncaught TelegramError Error: 400: Bad Request: invalid file HTTP URL specified: Wrong port number specified in the URL
at callApi (node_modules\telegraf\lib\core\network\client.js:293:19)
at processTicksAndRejections (internal/process/task_queues:95:5)
Process exited with code 1
Node.js
I tried to send not as a video but as a document but it did not help