Skip to main content

A web version of youtube-dl

Project description

PyPi Package Compatible Python Versions

About

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.

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-cli
    Useful for simply downloading the highest possible quality
    audio of a song. Simply provide the URL and an .mp3 will be downloaded to that
    same directory
  • web-youtube-dl
    Useful for running the web service on the local machine. It will
    listen to all local network connections on port 5000 (or whatever port is defined
    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

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

Known Issues

Backend issues if a single user hits submit multiple times
  • “raise RuntimeError(“Response content longer than Content-Length”)”

  • track this down

Add CI

Should probably build in some websocket Acking during broadcast

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web-youtube-dl-0.1.3.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

web_youtube_dl-0.1.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file web-youtube-dl-0.1.3.tar.gz.

File metadata

  • Download URL: web-youtube-dl-0.1.3.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.1 CPython/3.7.9 Linux/5.4.0-1025-azure

File hashes

Hashes for web-youtube-dl-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4273d253325f8a43eade9a7e3fe8178f3940279d00de60a5434cba08fa36ac75
MD5 229a45dfd97d8b257564a98002ac1a57
BLAKE2b-256 c1a086e7cbde3e38acf197ac3f6f1818bb21abddb61e5ba8e591ab8083df237e

See more details on using hashes here.

File details

Details for the file web_youtube_dl-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: web_youtube_dl-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.1 CPython/3.7.9 Linux/5.4.0-1025-azure

File hashes

Hashes for web_youtube_dl-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06ec46cfb298c2780e4bc2c35b796744ca24a41c0c9edf2a27a08640e1a96618
MD5 71ce78575c73fd0b849b360da9d8c0a2
BLAKE2b-256 52de55e1619f5ccfa2753efe9cfd4bd8d31ec075b7a55872880fa59cbae56b59

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page