• [gentoo-user] yt-dlp config file different than old youtube-dl

    From Dale@21:1/5 to All on Sat Jan 8 06:30:01 2022
    Howdy all, 

    I followed a thread about youtube-dl not being updated and it was
    recommended to switch to yt-dlp.  So, I switched.  Then I found out that
    it doesn't use the old youtube-dl.conf file.  It downloaded a HUGE
    video.  The thing was 1080P.  O_O  Anyway, I created a new config file, yt-dlp.conf in /etc and copied the options to it.  That didn't work
    well.  I found a website with tips and I thought I changed things to
    where it will work like the old tool but it spits on my keyboard and
    exits.  Obviously, I'm not doing something right here.  Here's some info:

    [IP-] [  ] net-misc/yt-dlp-2021.12.27

    My .conf file for yt-dlp:

    --format 'bv*[ext=webm,ext=mp4][width<=?1280]+bestaudio/best'  #My test line -i

    This is the line from the old youtube-dl.conf that worked for it:

    --format 'bestvideo[ext=webm,ext=mp4][width<=?1280]+bestaudio/best' 

    -i

    This is what it spits out when I try to download a video.


    dale@fireball ~/Desktop/Documents/Firefox/Firefox Multi-Account
    Containers $ youtube-dl https://www.youtube.com/watch?v=808xcfzkDRU https://www.youtube.com/watch?v=rL5cuGOzf54 https://www.youtube.com/watch?v=Gy7lyvAfOSw https://www.youtube.com/watch?v=FfN5L5zAJUo
    Traceback (most recent call last):
      File "/usr/lib/python-exec/python3.9/yt-dlp", line 33, in <module>
        sys.exit(load_entry_point('yt-dlp==2021.12.27', 'console_scripts', 'yt-dlp')())
      File "/usr/lib/python3.9/site-packages/yt_dlp/__init__.py", line 842,
    in main
        _real_main(argv)
      File "/usr/lib/python3.9/site-packages/yt_dlp/__init__.py", line 803,
    in _real_main
        with YoutubeDL(ydl_opts) as ydl:
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 630,
    in __init__
        else self.build_format_selector(self.params['format']))
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2194, in build_format_selector
        return _build_selector_function(parsed_selector)
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2067, in _build_selector_function
        fs = [_build_selector_function(s) for s in selector]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2067, in <listcomp>
        fs = [_build_selector_function(s) for s in selector]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2078, in _build_selector_function
        fs = [_build_selector_function(s) for s in selector.selector]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2078, in <listcomp>
        fs = [_build_selector_function(s) for s in selector.selector]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2088, in _build_selector_function
        selector_1, selector_2 = map(_build_selector_function, selector.selector)
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2158, in _build_selector_function
        filters = [self._build_format_filter(f) for f in selector.filters]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    2158, in <listcomp>
        filters = [self._build_format_filter(f) for f in selector.filters]
      File "/usr/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line
    1816, in _build_format_filter
        raise SyntaxError('Invalid filter specification %r' % filter_spec) SyntaxError: Invalid filter specification 'ext=webm,ext=mp4'
    dale@fireball ~/Desktop/Documents/Firefox/Firefox Multi-Account Containers $

    There's nothing sensitive there so nothing is edited or changed to
    prevent it from being public.  It is as it was on my screen. 

    What I'm trying for, I prefer mp4 videos but webm will do.  I'd like the maximum size to be something like a 720P tall or 1280P wide.  I really
    don't need a 1080P tall or larger to watch on my 24" monitor.  Sometimes
    even 720P is to much, if it's just someone talking about things.  I only
    need a higher res when it is showing how to repair something small or something.  I think 720P would be good enough, always has anyway.  I
    think it is happy with that setting tho.  This seems to work but who
    knows what it will download.

    --format 'bestvideo[width<=?1280]+bestaudio/best'

    The part it really doesn't like seems to be this: 

    SyntaxError: Invalid filter specification 'ext=webm,ext=mp4'

    Can someone tell me what the new and improved yt-dlp wants in its conf
    file to try for mp4 first and then webm?  Nothing I tried seems to
    work.  :-(

    Thanks for the help.

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arve Barsnes@21:1/5 to Dale on Sat Jan 8 10:30:01 2022
    On Sat, 8 Jan 2022 at 06:27, Dale <rdalek1967@gmail.com> wrote:
    The part it really doesn't like seems to be this:

    SyntaxError: Invalid filter specification 'ext=webm,ext=mp4'

    Can someone tell me what the new and improved yt-dlp wants in its conf
    file to try for mp4 first and then webm? Nothing I tried seems to
    work. :-(

    I have never used extension filtering before, but it might not be
    possible to specify a list, so then you need to make one extra format
    in your syntax. This worked for me:

    --format 'bv*[ext=webm][width<=?1280]+bestaudio/bv*[ext=mp4][width<=?1280]+bestaudio/best'

    Regards,
    Arve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Arve Barsnes on Sat Jan 8 17:20:01 2022
    Arve Barsnes wrote:
    On Sat, 8 Jan 2022 at 06:27, Dale <rdalek1967@gmail.com> wrote:
    The part it really doesn't like seems to be this:

    SyntaxError: Invalid filter specification 'ext=webm,ext=mp4'

    Can someone tell me what the new and improved yt-dlp wants in its conf
    file to try for mp4 first and then webm? Nothing I tried seems to
    work. :-(
    I have never used extension filtering before, but it might not be
    possible to specify a list, so then you need to make one extra format
    in your syntax. This worked for me:

    --format 'bv*[ext=webm][width<=?1280]+bestaudio/bv*[ext=mp4][width<=?1280]+bestaudio/best'

    Regards,
    Arve




    That doesn't spit on my keyboard so it's a good start at least.  Time
    will tell.  It's currently downloading a webm video.  I'd prefer a mp4
    but it may not be available for that video.  Time will tell tho.  Later
    on it might grab a mp4 and then I'll know it is getting mp4 when it
    can.  Honestly tho, webm does work well. 

    Thanks much.  Will post updates later on how it's doing.  I'm also going
    to study that to see if I can grasp what its doing.  What's different
    about it. 

    Dale

    :-)  :-) 

    P. S.  Can't wait for fiber internet to get here.  They ran the cable a
    while back.  It's getting closer.  :-D 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nikos Chantziaras@21:1/5 to Dale on Sat Jan 8 19:50:02 2022
    On 08/01/2022 07:26, Dale wrote:
    This is the line from the old youtube-dl.conf that worked for it:

    --format 'bestvideo[ext=webm,ext=mp4][width<=?1280]+bestaudio/best'

    The "--format-sort" option is much better for this. To prefer 720p video
    or lower, but not higher:

    --format-sort=width:1280,height:720,vcodec:av1

    The AV1 codec preference is nowadays default, but I like to specify it
    anyway. AV1 has the smallest video size but at the same time the highest
    video quality as well. If AV1 is not available, it will fall back to VP9 (higher quality, bigger size,) and then to H.264 (lower quality, smaller
    size.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)