Closed tinfoil-hat-net closed 2 days ago
Hello,
Please paste your server logs
Same problem here. yt-dlp has been seeing this issue due to changes on YouTube's side to aggressively block IP's after some amount of time. It's unclear if they ever remove the IP restriction.
Using the IP of remote runners could be a workaround, so that the PeerTube server's IP is not directly connecting to YouTube.
error[11/10/2024, 11:32:52 AM] An error occurred while importing the video https://www.youtube.com/watch?v=AZXvhIpYwak.
{ "err": { "stack": "ExecaError: Command failed with exit code 1: /usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f 'bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' 'https://www.youtube.com/watch?v=AZXvhIpYwak'\n\nERROR: [youtube] AZXvhIpYwak: Sign in to confirm you’re not a bot. This helps protect our community. Learn more\n at getFinalError (file:///var/www/peertube/node_modules/execa/lib/return/final-error.js:6:9)\n at makeError (file:///var/www/peertube/node_modules/execa/lib/return/result.js:108:16)\n at getAsyncResult (file:///var/www/peertube/node_modules/execa/lib/methods/main-async.js:167:4)\n at handlePromise (file:///var/www/peertube/node_modules/execa/lib/methods/main-async.js:150:17)\n at async YoutubeDLCLI.run (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-cli.js:141:24)\n at async YoutubeDLCLI.getInfo (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-cli.js:89:22)\n at async YoutubeDLWrapper.getInfoForDownload (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-wrapper.js:23:22)\n at async buildYoutubeDLImport (file:///var/www/peertube/dist/core/lib/video-pre-import.js:104:25)\n at async handleYoutubeDlImport (file:///var/www/peertube/dist/core/controllers/api/videos/import.js:114:38)", "message": "Cannot fetch information from import for URL https://www.youtube.com/watch?v=AZXvhIpYwak", "code": 0, "cause": { "stack": "ExecaError: Command failed with exit code 1: /usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f 'bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' 'https://www.youtube.com/watch?v=AZXvhIpYwak'\n\nERROR: [youtube] AZXvhIpYwak: Sign in to confirm you’re not a bot. This helps protect our community. Learn more\n at getFinalError (file:///var/www/peertube/node_modules/execa/lib/return/final-error.js:6:9)\n at makeError (file:///var/www/peertube/node_modules/execa/lib/return/result.js:108:16)\n at getAsyncResult (file:///var/www/peertube/node_modules/execa/lib/methods/main-async.js:167:4)\n at handlePromise (file:///var/www/peertube/node_modules/execa/lib/methods/main-async.js:150:17)\n at async YoutubeDLCLI.run (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-cli.js:141:24)\n at async YoutubeDLCLI.getInfo (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-cli.js:89:22)\n at async YoutubeDLWrapper.getInfoForDownload (file:///var/www/peertube/dist/core/helpers/youtube-dl/youtube-dl-wrapper.js:23:22)\n at async buildYoutubeDLImport (file:///var/www/peertube/dist/core/lib/video-pre-import.js:104:25)\n at async handleYoutubeDlImport (file:///var/www/peertube/dist/core/controllers/api/videos/import.js:114:38)", "message": "Command failed with exit code 1: /usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f 'bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' 'https://www.youtube.com/watch?v=AZXvhIpYwak'\n\nERROR: [youtube] AZXvhIpYwak: Sign in to confirm you’re not a bot. This helps protect our community. Learn more", "shortMessage": "Command failed with exit code 1: /usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f 'bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' 'https://www.youtube.com/watch?v=AZXvhIpYwak'", "command": "/usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best https://www.youtube.com/watch?v=AZXvhIpYwak", "escapedCommand": "/usr/bin/python3 /home/yunohost.app/peertube/storage/bin/yt-dlp --dump-json -f 'bestvideo[vcodec!=av01][vcodec!=vp9.2]+bestaudio/best[vcodec!=av01][vcodec!=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' 'https://www.youtube.com/watch?v=AZXvhIpYwak'", "cwd": "/var/www/peertube", "durationMs": 4034.717259, "failed": true, "timedOut": false, "isCanceled": false, "isGracefullyCanceled": false, "isTerminated": false, "isMaxBuffer": false, "isForcefullyTerminated": false, "exitCode": 1, "stdout": "", "stderr": "ERROR: [youtube] AZXvhIpYwak: Sign in to confirm you’re not a bot. This helps protect our community. Learn more", "stdio": [ null, "", "ERROR: [youtube] AZXvhIpYwak: Sign in to confirm you’re not a bot. This helps protect our community. Learn more" ], "ipcOutput": [], "pipedFrom": [] } } }
error[11/10/2024, 11:32:52 AM] Client log: Backend returned code 400, errorMessage is: Cannot fetch information from import for URL https://www.youtube.com/watch?v=AZXvhIpYwak
{ "tags": [ "client" ], "username": "root", "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0", "meta": "{\"url\":\"https://[SERVER URL]/api/v1/videos/imports/\"}", "url": "https://[SERVER URL]/videos/upload#import-url" }
error[11/10/2024, 11:32:52 AM] Client log: Error: Cannot fetch information from import for URL https://www.youtube.com/watch?v=AZXvhIpYwak
{ "tags": [ "client" ], "username": "root", "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0", "url": "https://[SERVER URL]/videos/upload#import-url" }
Another possible solution would be to add a PO token field to the web configuration, and pass along in the command line.
https://github.com/yt-dlp/yt-dlp/wiki/Extractors#po-token-guide
Thanks for reporting this issue, but this is a duplicate of https://github.com/Chocobozzz/PeerTube/issues/6522
Describe the current behavior
Hi, I can import videos via X/Twitter but not from youtube, I tried multible videos, that are public available and not age restriced, not unlisted, I get an error message "Cannot fetch Information from Import URL". Download a Video from Invidious is also not possible. My Peertube was manually set up some years ago on a LXC Container, this is the first time, I encountered problems with it. If you need Addidtional information, let me know
Steps to reproduce
Describe the expected behavior
Import Youtube Video from URL
Additional information
PeerTube instance:
Browser name, version and platforms on which you could reproduce the bug: BraveBrowser
Link to browser console log if relevant:
Link to server log if relevant (
journalctl
or/var/www/peertube/storage/logs/
):