ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.36k stars 10.04k forks source link

PeerTube video downloads no longer seem to be working #29782

Open xerxespersrex opened 3 years ago

xerxespersrex commented 3 years ago

Checklist

Verbose log

[ethanm@artix ~]$ youtube-dl -v "https://videos.denshi.live/w/u3EJKA6xNDeUuYLwJEyKYC"
[debug] System config: []
[debug] User config: ['-o', '~/Videos/downloaded/%(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://videos.denshi.live/w/u3EJKA6xNDeUuYLwJEyKYC']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.9.6 (CPython) - Linux-5.13.8-artix1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4
[debug] Proxy map: {}
[generic] u3EJKA6xNDeUuYLwJEyKYC: Requesting header
WARNING: Falling back on generic information extractor.
[generic] u3EJKA6xNDeUuYLwJEyKYC: Downloading webpage
[generic] u3EJKA6xNDeUuYLwJEyKYC: Extracting information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://videos.denshi.live/w/e31f3e1b-36c0-4aad-80a1-2a75787d0500'
[download] Destination: /home/ethanm/Videos/downloaded/The internet is 'decentralized'... Except for ISPs.unknown_video
[download] 100% of 15.74KiB in 00:00

Description

I watch videos from the PeerTube instances videos.lukesmith.xyz and videos.denshi.live. Approximately a month ago I was able to download and watch videos from videos.lukesmith.xyz using youtube-dl just fine, but today I tried downloading some from either PeerTube instance and youtube-dl just spits out the page's html source code instead of a video file.

Usually I use RSS/Atom and then run youtube-dl on the link provided in the feed (which appears to be different from the one available by visiting the site directly, interestingly), but both links are causing the same behavior.

xerxespersrex commented 3 years ago

For some reason ctrl-enter or some button combination I accidentally pressed submits the issue, I wasn't done editing it...

I also wanted to add that I usually use the command "youtube-dl --no-playlist -f 'bestvideo[height<=?720][fps<=?30]+bestaudio/best' $1" to download, but neither this command nor just running base youtube-dl (with or without my config to output to my Videos folder) successfully downloads the videos.

xerxespersrex commented 3 years ago

The original video was taken down, but here's a different PeerTube video and link from a different instance (videos.lukesmith.xyz) that does the same thing:

[ethanm@artix ~]$ youtube-dl -v "https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519"
[debug] System config: []
[debug] User config: ['-o', '~/Videos/downloaded/%(title)s.%(ext)s']
[debug] Custom config: []
[debug] Command-line args: ['-v', 'https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.9.6 (CPython) - Linux-5.13.10-artix1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4
[debug] Proxy map: {}
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Downloading webpage
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Extracting information
[debug] Default format spec: bestvideo+bestaudio/best
[debug] Invoking downloader on 'https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519'
[download] Destination: /home/ethanm/Videos/downloaded/Matrix vs. XMPP - Which is Better for Actually Secure Messaging (Unlike Telegram, Whatsapp, etc.).unknown_video
[download] 100% of 18.41KiB in 00:00
dirkf commented 3 years ago

For 'https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519', try https://videos.lukesmith.xyz/videos/watch/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519'

These aren't instances known to the PeerTube extractor. yt-dl invokes the generic extractor, which should discover the PeerTube "incompatible browser" message and then pass the URL to the PeerTube extractor.

This doesn't happen because the PeerTube extractor routine that discovers unknown PeerTube instances expects to see URLs with '/videos/watch' (or '/videos/embed') and the RSS service that you use has started to report URLs with '/w' instead. In extractor/peertube.py, we need to change the pattern in line 486:

            r'https?://(?P<host>[^/]+)/(?:w|videos/(?:watch|embed))/(?P<id>%s)'

Then:

# youtube-dl -v -F 'https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519'
[debug] System config: [u'--restrict-filenames', u'--prefer-ffmpeg', u'-f', u'best[height<=?1080][fps<=?60]', u'-o', u'/media/drive1/Video/%(title)s.%(ext)s']
[debug] User config: [u'-f', u'(best/bestvideo+bestaudio)[height<=?1080][fps<=?60][tbr<=?1900]']
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-F', u'https://videos.lukesmith.xyz/w/8fbf5fd7-3d52-43b4-bf0f-baf0a6355519']
[debug] Encodings: locale ASCII, fs ASCII, out ASCII, pref ASCII
[debug] youtube-dl version 2021.06.06.1
[debug] Python version 2.7.1 (CPython) - Linux-2.6.18-7.1-7405b0-smp-with-libc0
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Requesting header
WARNING: Falling back on generic information extractor.
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Downloading webpage
[generic] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Extracting information
[download] Downloading playlist: Matrix vs. XMPP: Which is Better for Actually Secure Messaging? (Unlike Telegram, Whatsapp, etc.)
[generic] playlist Matrix vs. XMPP: Which is Better for Actually Secure Messaging? (Unlike Telegram, Whatsapp, etc.): Collected 1 video ids (downloading 1 of them)
[download] Downloading video 1 of 1
[PeerTube] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Downloading video JSON
[PeerTube] 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519: Downloading description JSON
[info] Available formats for 8fbf5fd7-3d52-43b4-bf0f-baf0a6355519:
format code  extension  resolution note
360p         mp4        360p       30fps, 78.78MiB
480p         mp4        480p       30fps, 140.63MiB
1080p        mp4        1080p      60fps, 523.53MiB (best)
[download] Finished downloading playlist: Matrix vs. XMPP: Which is Better for Actually Secure Messaging? (Unlike Telegram, Whatsapp, etc.)
#