netr0m / youtag-dl

A downloader for music with a built-in tagger, based on youtube-dl-server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub license

youtag-dl

Yet another fork of manbearwiz/youtube-dl-server, with tagging functionality

Created to make your YouTube music-downloading tasks chiller. Specify (sub)directory, filename and tags (artist/title/album) per download.

screenshot

Running

Docker CLI

This example uses the docker run command to create the container to run the app. Here we also use host networking for simplicity. Also note the -v argument. This directory will be used to output the resulting videos

$ docker run -d --net="host" --name ytdl -v <music_directory>:/music ghcr.io/netr0m/youtag-dl

Docker Compose

This is an example service definition that could be put in docker-compose.yml.

version: 3
services:
  ytdl:
    image: "netr0m/youtag-dl"
    container_name: ytdl
    restart: always
    ports:
      - 8080:8080
    volumes:
      - /media/music:/music

Python

If you have python ^3.6.0 installed in your PATH you can simply run like this, providing optional environment variable overrides inline.

YDL_UPDATE_TIME=False python3 -m uvicorn youtag-dl:app --port 8123

In this example, YDL_UPDATE_TIME=False is the same as the command line option --no-mtime.

Usage

Start a download remotely

Downloads can be triggered by supplying the {{url}} of the requested video through the Web UI or through the REST interface via curl, etc.

HTML

Just navigate to http://{{host}}:8080 and enter the requested {{url}}.

Additionally, you can specify:

  • Output directory
  • Filename (without .ext)
  • Artist, title and album tags

Curl

$ curl -X POST --data-urlencode "url={{url}}" http://{{host}}:8080/q

Fetch

fetch(`http://${host}:8080/q`, {
  method: "POST",
  body: new URLSearchParams({
    url: url,
    format: "bestaudio",
    artist: artist,
    title: title,
    album: album
  }),
});

Bookmarklet

Add the following bookmarklet to your bookmark bar so you can conviently send the current page url to your youtag-dl instance.

javascript:!function(){fetch("http://${host}:8080/q",{body:new URLSearchParams({url:window.location.href,format:"bestaudio"}),method:"POST"})}();

Implementation

This is a fork of youtube-dl-server by manbearwiz.

The server uses starlette for the web framework and youtube-dl to handle the downloading. The integration with youtube-dl makes use of their python api.

This docker image is based on python:alpine and consequently alpine:3.18.

About

A downloader for music with a built-in tagger, based on youtube-dl-server.

License:MIT License


Languages

Language:Python 52.4%Language:HTML 41.2%Language:Dockerfile 6.4%