2023-08-11 08:03:18 +02:00
2023-08-10 12:53:33 +02:00
2023-07-29 10:19:00 +02:00
2023-08-10 12:53:33 +02:00
2023-08-10 12:53:33 +02:00
2023-08-05 19:01:25 +02:00

yt-mls

YouTube Media Library Server aims to make downloading and updating media libraries easy.

features

  • Download of channels, playlists and videos in mp3 or mp4
  • Download of processed files either individually or entire channels and playlists as a .zip
  • Update of channels and playlists from the library
  • Ingesting folders manually added to downloads folder
  • Watching videos via an embed
  • Listening to song via an embed

what could be added eventually

  • Search function in library

media sources

Currently supported is YouTube but its possible to expand since the download itself is handled by yt-dlp.

deployment

To deploy this app, you need a production-ready WSGI server like Waitress. Do not use the Flask built-in development server.

waitress in truenas jail

The following works in a 13.2 base jail:

$ git clone https://github.com/maxweigner/yt-mls.git
$ cd yt-mls
$ pkg install python39 py39-pip py39-sqlite3 ffmpeg
$ pip install -r requirements.txt
$ pip install supervisord
$ python -m venv venv
$ source venv/bin/activate.csh
$ pip install -r requirements.txt
$ touch supervisord.conf

Put the following into supervisord.conf

[supervisord]

[program:ytmls]
command=/usr/local/bin/python /root/yt-mls/server.py ;
directory=/root/yt-mls ;
autostart=true ;
autorestart=true ;

Run crontab -e and add the following line

@reboot /usr/local/bin/supervisord -c /root/yt-mls/supervisord.conf

Restart the jail and you're done.

configuration

In server.py you can change:

  • PORT
  • MAX_VIDEO_DOWNLOAD_LENGTH_MINUTES

With the default settings, the server will be up and running on port 5000 and will not download videos longer than 10 minutes.

currently not supported

Having the same video in mp3 and mp4 is not possible with how the download process and database work. This includes channels and playlists. The chosen type on initial download dictates what you have.

suboptimal

Downloading as well as updating large playlists or channels can take hours but does not take up a lot of bandwidth. Updating could be sped up but involves either making an own extractor / crawler or an elaborate construct around the existing one provided by yt-dlp. Currently every item gets crawled even if only a handful of new videos got added.

Description
YouTube Media Library Server aims to make downloading and updating big libraries easy.
Readme GPL-3.0 813 KiB
Languages
Python 71.3%
HTML 25.9%
TSQL 2.8%