Skip to content

freywald/undownloader

Repository files navigation

undownloader

A frontend for yt-dlp – for you and me.


Exemplary, a typical – non-atypical – use case:

I had no clue I have a playlist on YouTube.

the unknown one

How do I make a living off rapping when no one knows me? I got kind of discouraged so I had created a playlist of pop songs.

the other one

Add links to a specific processing queue via console aliases/shortcuts

  • da <link>: adds link to the audio processing queue.
  • dv <link>: adds link to the video processing queue.
  • dav <link>: adds link to the audio+video processing queue.
  • dap <link>: adds link to the audio_playlist processing queue.
  • das <link>: adds link to the audio_simple processing queue.

Example #1: using default queues

1. Add multiple links.

$ da https://www.youtube.com/watch?v=Ou8c2Mf7nU0
The data 'https://www.youtube.com/watch?v=Ou8c2Mf7nU0' was appended to the processing queue 'audio'.

2. Start download.

When done with collecting links, run undownloader to start processing of the default queues [audio, video, audio+video, audio_playlist]

undownloader

3. Done.



Example #2: archive and watch content changes

You need a wrapper script that calls undownloader and a link list.

1. Use a custom wrapper script with your configuration.

update-archive.sh

#!/bin/bash
clear

link_list_locator="audio:link-list.txt"
target_directory="Music"

if (( ${#@} == 0 )); then
	echo "HELP"
	echo
	echo
	echo "To download the content from the link list and create a download queue, execute the following command."
	echo "$ $0 --run"
	echo
	echo "If new links were added to the link list, execute the following command, in order to also update the download queue."
	echo "$ $0 --update"
	echo
	echo "To forget which links have been downloaded already and overwrite all existing files with a fresh online copy, execute the following command."
	echo "The download queue is not updated."
	echo "$ $0 --force-download --force-overwrites"
	echo
	echo "To completely rebuild the archive, execute the following command."
	echo "The download queue is regenerated and reflects the current state of the link list, in other words: new links are recognized."
	echo "$ $0 --update --force-download --force-overwrites"
	exit 1
fi

undownloader --from-file="$link_list_locator" --target-directory="$target_directory" "$@"

Also provide a link list which contains links to be downloaded and can be updated regularly.

link-list.txt

https://www.youtube.com/watch?v=jNQXAC9IVRw
https://www.youtube.com/watch?v=Ou8c2Mf7nU0

2. Call the script any time you want.

./update-archive.sh

3. Done.



Example #3: Configuration templates

Each queue references a template file which defines the queue instance.

extract of 'audio.template'

__download_with_configuration 
# run the program yt-dlp with these options:…
yt-dlp
`# quality and file format` \
--extract-audio \
--remux mka \
`# thumbnails` \
--write-thumbnail \
--convert-thumbnails png \
--embed-thumbnail \
`# subtitles` \
--sub-lang en \
--write-auto-subs \
--write-sub \
--convert-subs srt \
--embed-subs \
`# embed files` \
--embed-metadata \
--embed-info-json \
--embed-chapters \


Installation

  1. Please execute the following shell command in your shell.
path="$HOME/applications/undownloader" && \
mkdir --parents -- "$path" && \
git clone -- git@github.com:freywald/undownloader.git "$path" && \
cd -- "$path" && \
git remote set-url --push origin push_disabled && \
./install && \
echo "Installation successful."
  1. Installation successful.
  2. Done.
  3. You're done.
  4. And you're done.

About

A frontend for yt-dlp – for you and me.

Resources

License

Stars

Watchers

Forks

Contributors

Languages