About
This is a project that builds on pytube 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 pytube’s python sdk and enable asynchronous downloads in the context of a web-app.
Files are downloaded using an API endpoint and then retrived from the application’s static files directory using Javascript’s fetch API. Download progress is presented via a websocket connection.
Installation
pip install web-youtube-dl
Running
CLI
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 quality audio of a song.Simply provide the URL and an .mp3 will be downloaded to current workingdirectory or to the value of the YT_DOWNLOAD_PATH environment variable
- web-youtube-dl-webUseful for running the web service on the local machine. It willlisten to all local network connections on port 5000 (or whatever port isdefined in the environment variable YT_DOWNLOAD_PORT).
Docker
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
Or, using the project’s Makefile
make image
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
Or, using the project’s Makefile
make compose
Enhancements
Track progress beyond YT download - tie into ffmpeg - tie into metadata extraction
Metadata
Release files for web-youtube-dl 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| web-youtube-dl-0.3.0.tar.gz | 29.7 kB | Without provenance | Details for web-youtube-dl-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| web_youtube_dl-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for web_youtube_dl-0.3.0-py3-none-any.whl |
Total release size: 60.0 kB
Release files / web-youtube-dl-0.3.0.tar.gz
| Download URL | web-youtube-dl-0.3.0.tar.gz |
|---|---|
| Size | 29.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e56f474473a274e10c4f05d6663f1258fcfb97f82582cb6947641055b4702ac
|
|
BLAKE2b-256 checksum How to use checksums |
fe8703b41ccd35f5ba75afe7b9907569368f336ed757f9bf730c71ac598b439b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.7.13 Linux/5.13.0-1025-azure
|
Release files / web_youtube_dl-0.3.0-py3-none-any.whl
| Download URL | web_youtube_dl-0.3.0-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89f26bafe0dbb97c9ccdf472c90aff6396b3052c150f7e893078b6c19362617c
|
|
BLAKE2b-256 checksum How to use checksums |
4999a08ad144e9b8af7fa1f442e49b3bae136caba755cffe9e0a7f74967b7a57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.7.13 Linux/5.13.0-1025-azure
|
Security for web-youtube-dl 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.