A web version of youtube-dl
This is a project that builds on youtube-dl to provide a simple web-interface for downloading audio from Youtube. It’s primary purpose is to provide a LAN HTTP accessible method of saving audio to a local device.
This project is built using python’s asyncio libraries and packages include FastAPI, janus, and uvicorn. It’s also an example of how to work with youtube-dl’s python sdk and enable asynchronous downloads in the context of a web-app.
pip install web-youtube-dl
Installing this project will give you access to two CLI tools, each with a separate purpose:
- web-youtube-dl-cliUseful for simply downloading the highest possible qualityaudio of a song. Simply provide the URL and an .mp3 will be downloaded to thatsame directory
- web-youtube-dlUseful for running the web service on the local machine. It willlisten to all local network connections on port 5000 (or whatever port is definedin the environment variable YT_DOWNLOAD_PORT).
This project can optionally be run and managed as a Docker container.
Build the Docker image
docker build . -t web-youtube-dl:latest --force-rm
Run the service
When running the service via Docker, you can configure where it stores downloaded songs by default and the port the service listens on by setting the appropriate environment variables.
To configure the port, set the environment variable YT_DOWNLOAD_PORT to some other numerical value.
To configure the download path, set the environment variable YT_DOWNLOAD_PATH to some other filesystem path. Note that an unprivileged user must have access to writing to this location. By default, this is set to tmp and does not really need to be changed.
docker-compose up -d
- Backend issues if a single user hits submit multiple times
“raise RuntimeError(“Response content longer than Content-Length”)”
track this down
Should probably build in some websocket Acking during broadcast
Hashes for web_youtube_dl-0.1.3-py3-none-any.whl