Hacker News new | ask | show | jobs
by j1elo 1264 days ago
Afrer reading the description, this project seems to be solely focused on downloading all of a specific channel's videos.

I've been taking my first steps at having a home server, and one of the things I'd love to do with it is having an archive of the videos that I have saved in my private playlists on YouTube. In my mind, the service would periodically check all my playlists, compare with what exists locally, and download any missing video. Maybe even with a nice web UI so it's easier to visually configure and use.

Does such a service already exist so I can self-host it?

8 comments

Nice web ui aside, if I'm not mistaken youtube-dl already supports this kind of usage. You can `youtube-dl --download-archive archive.txt https://youtu.be/your-playlist` and it'll keep track in the archive.txt of everything it's already downloaded. Supplement with authentication options as necessary, set up a cronjob, done.
It's even simpler than that, just give youtube-dl the channel name and it will download all videos skipping any that already exists in your current directory.
Yark will be able to do this in v1.3 releasing in ~1 month provided it has access to the playlists, I'm not sure how to do creds currently but I'll look into it.

Issue for downloading playlists: https://github.com/Owez/yark/issues/49

That's great to know!

For auth it seems the preferred way to login with Google is OAuth2, that's I believe what third-party apps use, e.g. Thunderbird uses it when setting up a new GMail account.

However, for apps that don't support OAuth2, there is also the possibility of using "App Passwords" [1], I've used one in the past and it worked well. (Update: I'm just reading it only works if 2FA is enabled, which I use)

[1]: https://support.google.com/accounts/answer/185833?hl=en

> I'm not sure how to do creds currently but I'll look into it

Welcome to the nightmarish world of authentication to Google products, which all have 4 different versions of documentation and not a single one up to date.

I haven't used it personally, but Tube Archivist might be what you're looking for.

https://www.tubearchivist.com/

Ignore youtube-dl, it has speed issues. Use the fork yt-dlp.

If you want gui, check out TubeSync. Web UI for yt-dlp , ffmpeg and nicely packaged in docker

I was doing this for awhile but it became expensive - tens of TBs on an expensive NAS just to hoard data.
You can probably set flags to download in lower bitrate formats. Some formats use a LOT less data than others, and usually the extra quality isn't really needed anyway if it's only being kept for reference. The difference between 1080p (or, say, 4K60) and 240p or 360p is massive.
Also the codec matters. AV1 is quite a bit smaller than VP9, which is in turn smaller than x264. Of course the downside is AV1 is harder to decode. For the purpose of well-encoded content, you can estimate that the bitrate doubles whenever you double both dimensions of the video, e.g. 720p would be twice the bitrate of 360p and half of 1440p.
FSM almighty, how much video are you watching to have that many favorite ones?
With the rise of cheap 4k cameras, it goes faster than you think. I download guitar training videos where a 25 minute tutorial can be 2-3gbs. I believe those are “only” 2k resolution. If you do not download them in a space conscious format or recompress (using mildly aggressive settings can drop them to 100mb), a handful of videos can quickly fill a hard drive.
Why wouldn't one download something like that in 720P video/196kbps audio?

I mean, there's a time and a place for 4K, but watching the zits on the face of a guy who tells you how to play C Am F G on a guitar isn't it.

Not to mention, most of those cheap 4K cameras won't have optics to utilize those pixels; no quality will be lost in 720p.

My downloader defaults to the highest quality, so unless I remember to specify a setting, I get gigabytes of video for something that could easily be 480 quality. In the event I forget, I reencode with ffmpeg.
It's a reasonable default, but if one has gone to the trouble of setting up a NAS and scripts, might as well tick that box.
That depends, if the source is bright enough, those little pixels will have enough signal to work effectively.
Why not archive seldom-accessed files onto BD-ROMs? They're cheap to store
I think youtube-dl as well as yt-dlp can both download playlists. You can create a script to download all your playlist and make it a cron job. Videos that do already exist in the target folder will be skipped automatically.
This is how I accomplish basically the same thing - https://gist.github.com/Gestas/30ac0c3a07404174d0d7b66068221....

It requires a local file with a list of channels/playlists. I use Jellyfin (https://jellyfin.org/) as the frontend/video player.

Look at tubearchivist. It can do what you want.

You can subscribe to playlists, as well as automatically update and download videos.