3 ms·
I do exactly this (with emby instead of jellyfin though), with a cron job that runs this: #!/bin/bash -x export IFS="\n" find . -type f -name youtube-
by philsnow 4y ago
I do exactly this (with emby instead of jellyfin though), with a cron job that runs this:
#!/bin/bash -x
export IFS="\n"
find . -type f -name youtube-dl.batchfile | \
xargs -I {} -n 1 bash -x -c \
'cd "$(dirname "{}")" && pwd && yt-dlp --config-location youtube-dl.config'
each youtube-dl.batchfile is in a directory that corresponds to an emby library, and is a plain text file where each line is a link to something that yt-dlp understands (usually a youtube channel or playlist). The youtube-dl.config contains (among other things)
--batch-file youtube-dl.batchfile
to point to the batchfile, and
--download-archive youtube-dl-archive.txt
so that I don't re-download videos I've already retrieved, and also because it gives me a super quick way to exclude certain videos: either I can just go in and delete the file for a video I don't like (and instead of downloading it again, yt-dlp sees the ID in the archive and doesn't even bother trying to download it), or if I know of some I don't want it ever to download I can just pre-emptively put their IDs in the dl-archive file.
So now when I find a channel I want to download for the kids, I just drop a line in a batchfile and either kick off the cron job by hand or wait.
- philsnow 4y agoAnother thing I do, on the topic of vetting content for the kids to watch on jellyfin/emby: tl;dr: ios shortcut -> flask app -> yt-dlp. I wrote a tiny flask app that runs somewhere on my network, which takes POSTs with two parameters, a link and a name. It passes the link to yt-dlp and then renames the resulting file to "{name}.mp4". (It then also POSTs to emby's endpoint telling it to rescan the library.) I made a janky ios shortcut does "receive any input from share sheet" -> "get urls from {shortcut input}" -> "ask for {text} with {file name}" -> "get contents of {my flask app's URL}" the last step takes the URL from step 2 and the file name from step 3 and uses those as the POST body. I named this shortcut 'ytdlp'. So now I'm looking at nearly anything on my phone (youtube, twitter, it even works with tiktok/imgur links from a browser because I only view those from a browser, not their app), hit 'share', choose 'ytdlp' and give it a name, and a couple seconds later that video is ready to watch in emby. I've archived hundreds of videos this way for the kids over the last couple years.
- drexlspivey 4y agoI’ve done basically the same thing but instead of a custom flask app I have an instance of n8n.io running on a raspberry pi. You just set up an automation to receive a webhook and run a shell command with input from the payload. Another cool little automation is a webhook from Plex when playback starts turns on the hue lights behind the TV