Peertube V7.0 import problem

Hello!

I used 6.3.3 version and imported videos from YouTube without any problem. After updating to 7.0 I’m unable to import anything from YouTube, getting this error:

Job: 4
Type: video-import
Processed on 12/26/24, 11:11:06.671 PM
Finished on 12/26/24, 11:11:10.373 PM
{
  "type": "youtube-dl",
  "videoImportId": 4,
  "fileExt": ".webm",
  "generateTranscription": true,
  "preventException": false
}
ExecaError: Command failed with exit code 1: /usr/bin/python3 /data/bin/yt-dlp --merge-output-format mp4 -f 'bestvideo[vcodec!*=av01][vcodec!*=vp9.2]+bestaudio/best[vcodec!*=av01][vcodec!*=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' -o /data/tmp/60884894fcbce110875d72a5d2d8e0e2b94db7cbadec3bf8c5053f7df3f2029e-import 'https://youtu.be/[truncated link]'

ERROR: unable to download video data: HTTP Error 403: Forbidden

[youtube] Extracting URL: https://youtu.be/ [truncated link]
[youtube] 112PH61FSmA: Downloading webpage
[youtube] 112PH61FSmA: Downloading ios player API JSON
[youtube] 112PH61FSmA: Downloading mweb player API JSON
[youtube] 112PH61FSmA: Downloading m3u8 information
[info] 112PH61FSmA: Downloading 1 format(s): 313+251
    at getFinalError (file:///app/node_modules/execa/lib/return/final-error.js:6:9)
    at makeError (file:///app/node_modules/execa/lib/return/result.js:108:16)
    at getAsyncResult (file:///app/node_modules/execa/lib/methods/main-async.js:167:4)
    at handlePromise (file:///app/node_modules/execa/lib/methods/main-async.js:150:17)
    at async YoutubeDLCLI.run (file:///app/dist/core/helpers/youtube-dl/youtube-dl-cli.js:148:24)
    at async YoutubeDLWrapper.downloadVideo (file:///app/dist/core/helpers/youtube-dl/youtube-dl-wrapper.js:74:13)
    at async processFile (file:///app/dist/core/lib/job-queue/handlers/video-import.js:84:24)
    at async Object.processVideoImport [as video-import] (file:///app/dist/core/lib/job-queue/handlers/video-import.js:45:13)
    at async Object.wrapPromiseFun (file:///app/dist/core/lib/plugins/hooks.js:8:24)
    at async /app/node_modules/bullmq/dist/cjs/classes/worker.js:512:32
    at async Worker.retryIfFailed (/app/node_modules/bullmq/dist/cjs/classes/worker.js:741:24)

Many thanks for any advice!

Hi,

Can you try with another youtube video?

I tried with multiple videos, both public and unlisted, same result (403 error)

Can you try to run the yt-dlp command manually from your docker container?

Sorry, not sure how to do that exactly…

sudo docker exec -it peertube-peertube-1 yt-dlp gives no result (OCI runtime exec failed: exec failed: unable to start container process: exec: "yt-dlp": executable file not found in $PATH: unknown). If I try sudo docker exec -it peertube-peertube-1 sh then yt-dlp is just not found again…

Command is

 /usr/bin/python3 /data/bin/yt-dlp --merge-output-format mp4 -f 'bestvideo[vcodec!*=av01][vcodec!*=vp9.2]+bestaudio/best[vcodec!*=av01][vcodec!*=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' -o /data/tmp/60884894fcbce110875d72a5d2d8e0e2b94db7cbadec3bf8c5053f7df3f2029e-import 'https://youtu.be/[truncated link]'

My result from docker:

# /usr/bin/python3 /data/bin/yt-dlp --merge-output-format mp4 -f 'bestvideo[vcodec!*=av01][vcodec!*=vp9.2]+bestaudio/best[vcodec!*=av01][vcodec!*=vp9.2]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/best' -o /data/tmp/60884894fcbce110875d72a5d2d8e0e2b94db7cbadec3bf8c5053f7df3f2029e-import 'https://youtu.be/watch?v=jS0-rTyH6hk'

[generic] Extracting URL: https://youtu.be/watch?v=jS0-rTyH6hk

[generic] watch?v=jS0-rTyH6hk: Downloading webpage

[redirect] Following redirect to https://www.youtube.com/watch?v=jS0-rTyH6hk&v=watch&feature=youtu.be

[youtube] Extracting URL: https://www.youtube.com/watch?v=jS0-rTyH6hk&v=watch&feature=youtu.be

[youtube] jS0-rTyH6hk: Downloading webpage

[youtube] jS0-rTyH6hk: Downloading ios player API JSON

[youtube] jS0-rTyH6hk: Downloading mweb player API JSON

[youtube] jS0-rTyH6hk: Downloading m3u8 information

[info] jS0-rTyH6hk: Downloading 1 format(s): 271+251

ERROR: unable to download video data: HTTP Error 403: Forbidden

Your server IP may have been blocked by youtube :confused:

Is there any option to use proxy? I saw this in documentation, but not sure how to set this up inside docker…

Yes: PeerTube/config/production.yaml.example at develop · Chocobozzz/PeerTube · GitHub

With docker you can create a production.yaml with keys that cannot be defined by env variables in the config directory inside your docker volumes.