Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--match-filter "!is_live" : does not work for youtube live channel url #29647

Open
5 tasks done
TapasKumarKundu opened this issue Jul 25, 2021 · 1 comment
Open
5 tasks done

Comments

@TapasKumarKundu
Copy link

TapasKumarKundu commented Jul 25, 2021

Checklist

  • I'm reporting a broken site support
  • I've verified that I'm running youtube-dl version 2021.06.06
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones

Verbose log

tkundu2@tkundu-desktop:~$ youtube-dl -v --match-filter "!is_live" -F "https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow/live"
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--match-filter', u'!is_live', u'-F', u'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 2.7.17 (CPython) - Linux-5.4.0-77-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.8, ffprobe 3.4.8, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube:tab] UCSJ4gkVC6NrvII8umztf0Ow: Downloading webpage
[youtube] DWcJFNfaw9c: Downloading webpage
[youtube] DWcJFNfaw9c: Downloading m3u8 information
[youtube] DWcJFNfaw9c: Downloading MPD manifest
[info] Available formats for DWcJFNfaw9c:
format code  extension  resolution note
91           mp4        256x144     290k , avc1.42c00b, 15.0fps, mp4a.40.5
92           mp4        426x240     546k , avc1.4d4015, 30.0fps, mp4a.40.5
93           mp4        640x360    1209k , avc1.4d401e, 30.0fps, mp4a.40.2
94           mp4        854x480    1568k , avc1.4d401f, 30.0fps, mp4a.40.2
95           mp4        1280x720   2969k , avc1.4d401f, 30.0fps, mp4a.40.2
96           mp4        1920x1080  5420k , avc1.640028, 30.0fps, mp4a.40.2 (best)
tkundu2@tkundu-desktop:~$ 

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

@TapasKumarKundu TapasKumarKundu changed the title "--match-filter is_live" no longers works for youtube live stream video --match-filter "!is_live" : does not for youtube live channel url Jul 25, 2021
@TapasKumarKundu TapasKumarKundu changed the title --match-filter "!is_live" : does not for youtube live channel url --match-filter "!is_live" : does not work for youtube live channel url Jul 25, 2021
@dirkf
Copy link
Contributor

dirkf commented Jul 25, 2021

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 "".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants