Open TapasKumarKundu opened 3 years ago
From the manual
--match-filter FILTER Generic video filter. Specify any key (see the "OUTPUT TEM‐ PLATE" for a list of available keys) to match if the key is present, !key to check if the key is not present, ...
is_live
is a valid possible key according to the referenced section, good.
$ youtube-dl -j DWcJFNfaw9c
{'is_live': true, ...
$ youtube-dl -v --match-filter '!is_live' -j DWcJFNfaw9c
[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--match-filter', '!is_live', '-j', 'DWcJFNfaw9c']
[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.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[debug] Default format spec: bestvideo+bestaudio/best
$
So (a) is_live
is present for the item in your example (b) it's true
, and !is_live
blocks the download (maybe it would have done so even with 'is_live': false
?).
The issue is that -F
produces output and returns before the filter is applied. Compare your output with this:
$ youtube-dl -v --match-filter '!is_live' --flat-playlist "https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow/live"
[debug] System config: ['--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-v', '--match-filter', '!is_live', '--flat-playlist', 'https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow/live']
[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.5.2 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube:tab] UCSJ4gkVC6NrvII8umztf0Ow: Downloading webpage
[youtube] DWcJFNfaw9c: Downloading webpage
[youtube] DWcJFNfaw9c: Downloading m3u8 information
[youtube] DWcJFNfaw9c: Downloading MPD manifest
[debug] Default format spec: best/bestvideo+bestaudio
[download] lofi hip hop radio - beats to sleep/chill to 2021-07-25 12:50 does not pass filter !is_live, skipping ..
$
Also, with bash
, use ''
around the filter instead of ""
.
Checklist
Verbose log
Description
I am trying with following command to see if --match-file "is_live" works or not. youtube-dl -v --match-filter "!is_live" -F "https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow/live"
My expectation was above command will print error. but instead it is printing details about live video !!
Could you please fix this bug