• LemmyPlaceDN@europe.pub
    link
    fedilink
    English
    arrow-up
    19
    ·
    edit-2
    8 hours ago

    In the past years I have downloaded and archived about 200 GB of my favorite YouTube videos using yt-dlp. Most of them are short or low resolution for storage reasons, so it’s a lot more videos than you’d think. Now they can’t be taken away from me and I can watch them whenever I want.

    • DarkFuture@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 days ago

      So yt-dlp can be a bit rough for non-power users. There is a fantastic GUI wrapper for it called Stacher7. I use it daily.

      • Zarobi@aussie.zone
        link
        fedilink
        English
        arrow-up
        7
        ·
        edit-2
        1 day ago

        I dunno if I would call it rough; it’s just a CLI tool. You write yt-dlp and then paste in the URL.

        Maybe I’m doing that xkcd comic where I overestimate average people’s familiarity with CLI though. It only gets complicated if you want to customise it beyond the basic flags in your global config file. I set it to include chapters and download subtitles for example. Once I get home I’ll try and remember to paste my config file here.

        Edit: ~/yt-dlp.conf

        # Save the files to this directory with this format
        --paths /mnt/Vidoes/inprogress/youtube
        --output "%(uploader)s - %(title)s.%(ext)s"
        
        # Include subtitles and chapter metadata
        --write-subs
        --embed-chapters
        
        # Resume incomplete downloads
        --continue
        
        # I use Vivaldi exclusively with a burner account to find videos to download so that Google thinks my activity is more organic
        --cookies-from-browser vivaldi
        
        # Optional - Only needed if you have issues downloading subtitles. I had to git clone and build "bgutil-ytdlp-pot-provider" to generate tokens to download files properly. This part was just copy pasted from their instructions
        --extractor-args "youtubepot-bgutilscript:server_home=/home/[username]/git/bgutil-ytdlp-pot-provider/server"
        
        # Optional quality filter - Possibly the only complicated part. This tells YT-DLP to prefer downloading H264 MP4 files, because my old as fuck android tablet doesn't support any other format. It also forces 1080p video, because I found after downloading too many videos YouTube will downgrade you to 360p and I'd rather get an error message than watch a 360p video. Some 720p only videos I edit this temporarily
        --format "bv[height=1080][vcodec^=avc1][ext=mp4]+ba[ext=m4a]/b[height=1080][vcodec^=avc1][ext=mp4]/bv*[height=1080]+ba/b[height=1080]"
        

        You will need to delete any # comments in your own config - I don’t think they’re supported. I included them for explanation.

      • ComradeMiao@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 days ago

        You think typing yt-dlp URL is rough for users? I cannot think of a simpler command line command other than maybe ls.

        • DarkFuture@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          23 hours ago

          command line command

          There you go. That alone makes it more complicated than Stacher7. All I know is I went to the yt-dlp homepage, started reading how to use it, then realized someone probably made it easier, did a quick Google search, and found Stacher7 which required no learning at all.

        • WhyJiffie@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          4
          ·
          1 day ago

          not really though. it is more like this, simplified:

          yt-dlp URL --output /path/with/all/the/funky/patameters.%(ext) --all-the-worlds-parameters-for-good-format-quality-subs-whateverelse
          

          yes if you want to download a single video or two, the basic command works somewhat, but not usable if you want to download lots of videos from multiple channels

          • ComradeMiao@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 day ago

            You’re making up cases that don’t need to exist. The basic command and its defaults works fine. It can download every video from every channel. Don’t need anything else.

            • WhyJiffie@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              1
              ·
              21 hours ago

              when downloading lots of videos, you will have to take some compromises for it to be economical. like you probably dont need full quality, especially when its 4k or something insane like that. so you will want to use a very simple parameter like this:

              -f "bestvideo[height<=?720]+bestaudio/best"
              

              already memorized it, right?

              or, what if you would accidentally redownload a video? you forgot you already downloaded a specific video, so you rerun it. maybe even its content has changed since then. or you are downloading a playlist or a whole channel, and you dont want to redownload existing ones all the time. what you do?

              --no-overwrites
              --archive-file filename
              --force-write-archive
              

              or if you dont want to download formats that might be a pain in the ass to play later:

              --prefer-free-formats
              

              but yeah, you can ignore all of this and be surprised later when you can’t sustain your archive anymore. or use a gui tool that shows these settings in a prominent place so you can decide in time.

              oh and don’t forget links that your terminal could misinterpret as a standalone command to run, because it has an ampersand or something like in it. the average user is not experienced with the terminal to quote every URL