{"id":13552913,"url":"https://github.com/nbr23/youtube-dl-server","last_synced_at":"2025-04-03T04:31:08.282Z","repository":{"id":43883579,"uuid":"247875459","full_name":"nbr23/youtube-dl-server","owner":"nbr23","description":"Web / REST interface for downloading youtube videos onto a server.","archived":false,"fork":true,"pushed_at":"2024-04-13T03:06:03.000Z","size":1033,"stargazers_count":196,"open_issues_count":7,"forks_count":31,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T00:55:30.888Z","etag":null,"topics":["docker","self-hosted","youtube-dl"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"manbearwiz/youtube-dl-server","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nbr23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-03-17T04:00:32.000Z","updated_at":"2024-04-13T20:26:04.000Z","dependencies_parsed_at":"2023-01-31T05:46:27.111Z","dependency_job_id":null,"html_url":"https://github.com/nbr23/youtube-dl-server","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbr23%2Fyoutube-dl-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbr23%2Fyoutube-dl-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbr23%2Fyoutube-dl-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbr23%2Fyoutube-dl-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbr23","download_url":"https://codeload.github.com/nbr23/youtube-dl-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939190,"owners_count":20857916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","self-hosted","youtube-dl"],"created_at":"2024-08-01T12:02:13.226Z","updated_at":"2025-04-03T04:31:08.276Z","avatar_url":"https://github.com/nbr23.png","language":"Vue","funding_links":[],"categories":["Python","Vue","Software"],"sub_categories":["Media Management","Automation"],"readme":"![Docker Stars Shield](https://img.shields.io/docker/stars/nbr23/youtube-dl-server.svg?style=flat-square)\n![Docker Pulls Shield](https://img.shields.io/docker/pulls/nbr23/youtube-dl-server.svg?style=flat-square)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/nbr23/youtube-dl-server/master/LICENSE)\n\n# youtube-dl-server\n\nSimple Web and REST interface for downloading youtube videos onto a server.\n[`starlette`](https://www.starlette.io/) +\n[yt-dlp](https://github.com/yt-dlp/yt-dlp) / [`youtube-dl`](https://github.com/rg3/youtube-dl)\n\nForked from [manbearwiz/youtube-dl-server](https://github.com/manbearwiz/youtube-dl-server).\n\n![screenshot][1]\n\n\n![screenshot][2]\n\n## Running\n\nFor easier deployment, a docker image is available on\n[dockerhub](https://hub.docker.com/r/nbr23/youtube-dl-server):\n\n- `nbr23/youtube-dl-server:yt-dlp` or simply `nbr23/youtube-dl-server` to use `yt-dlp`\n- `nbr23/youtube-dl-server:youtube-dl` to use `youtube-dl`. Note that the latest release of `youtube-dl` is pretty [outdated](https://github.com/ytdl-org/youtube-dl/releases/tag/2021.12.17).\n\n### Docker CLI\n\nThis example uses the docker run command to create the container to run the\napp. Note the `-v` argument to specify the volume and its binding on the host.\nThis directory will be used to output the resulting videos.\n\n```shell\ndocker run -d --name youtube-dl -p 8080:8080 -v $HOME/youtube-dl:/youtube-dl nbr23/youtube-dl-server:latest\n```\n\nOR for yt-dlp:\n\n```shell\ndocker run -d --name youtube-dl -p 8080:8080 -v $HOME/youtube-dl:/youtube-dl nbr23/youtube-dl-server:yt-dlp\n```\n\n### Docker Compose\n\nThis is an example service definition that could be put in `docker-compose.yml`.\n\n```yml\n  youtube-dl:\n    image: \"nbr23/youtube-dl-server:latest\"\n    volumes:\n      - $HOME/youtube-dl:/youtube-dl\n      - ./config.yml:/app_config/config.yml:ro # Overwrite the container's config file with your own configuration\n    restart: always\n```\n\n## Configuration\n\nConfiguration is done through the config.yml file at the root of the project.\n\nAn alternate configuration path or file path can be forced by setting the environment\nvariable `YDL_CONFIG_PATH`:\n\n```shell\nexport YDL_CONFIG_PATH=/var/local/youtube-dl-server/config.yml\n```\n\nIn the above case, if `/var/local/youtube-dl-server/config.yml` does not exist, it will be created with the default options.\n\n```shell\nexport YDL_CONFIG_PATH=/var/local/youtube-dl-server/\n```\n\nIn the above case, if `/var/local/youtube-dl-server/config.yml` does not exist, it will be created with the default options as well.\n\nThe configuration file must contain at least the following variables:\n\n```yaml\nydl_server:\n  port: 8080\n  host: 0.0.0.0\n  metadata_db_path: '/youtube-dl/.ydl-metadata.db'\n\nydl_options:\n  output: '/youtube-dl/%(title)s [%(id)s].%(ext)s'\n  cache-dir: '/youtube-dl/.cache'\n```\n\n### Extra options\n\nAdditional youtube-dl parameters can be set in the `ydl_options` sections. To\ndo this, simply add regular youtube-dl parameters, removing the leading `--`.\n\nFor example, to write subtitles in spanish, the youtube-dl command would be:\n\n`youtube-dl --write-sub --sub-lang es URL`\n\nWhich would translate to the following `ydl_options` in `config.yml`:\n\n```yaml\nydl_options:\n  output: '/tmp/youtube-dl/%(title)s [%(id)s].%(ext)s'\n  cache-dir: '/tmp/youtube-dl/.cache'\n  write-sub: True\n  sub-lang: es\n```\n\n### Profiles\n\nYou can also define profiles. They allow you to define configuration sets that can be selected in the UI.\n\nSample:\n\n```yaml\nprofiles:\n  podcast:\n      name: 'Audio Podcasts'\n      ydl_options:\n        output: '/youtube-dl/Podcast/%(title)s [%(id)s].%(ext)s'\n        format: bestaudio/best\n        write-thumbnail: True\n        embed-thumbnail: True\n        add-metadata: True\n        audio-quality: 0\n        extract-audio: True\n        audio-format: mp3\n  philosophy_lectures:\n      name: 'Philosophy Lectures'\n      ydl_options:\n        output: '/youtube-dl/Lectures/Philosophy/%(title)s [%(id)s].%(ext)s'\n        write-thumbnail: True\n        embed-thumbnail: True\n        add-metadata: True\n        verbose: True\n```\n\n![screenshot][3]\n\n## Python\n\nIf you have python ^3.3.0 installed in your PATH you can simply run like this,\nproviding optional environment variable overrides inline.\n\nInstall the python dependencies from `requirements.txt`:\n\n```shell\npip install -r requirements.txt\n```\n\nYou can run\n[bootstrap.sh](https://github.com/nbr23/youtube-dl-server/blob/master/bootstrap.sh)\nto download the required front-end libraries (jquery, bootstrap).\n\n```shell\npython3 -u ./youtube-dl-server.py\n```\n\nTo force a specific `youtube-dl` version/fork  (eg `yt-dlp`), use the\nvariable `YOUTUBE_DL`:\n\n```shell\nYOUTUBE_DL=yt-dlp python3 -u ./youtube-dl-server.py\n```\n\n## Usage\n\n### Start a download remotely\n\nDownloads can be triggered by supplying the `{{url}}` of the requested video\nthrough the Web UI or through the REST interface via curl, etc.\n\n### HTML\n\nJust navigate to `http://{{host}}:8080/` and enter the requested `{{url}}`.\n\n### Curl\n\n```shell\ncurl -X POST  -H 'Content-Type: application/json' --data-raw '{\"url\":\"{{ URL }}\",\"format\":\"video/best\"}' http://{{host}}:8080/api/downloads\n```\n\n### Fetch\n\n```javascript\nfetch(`http://${host}:8080/api/downloads`, {\n  method: \"POST\",\n  body: new URLSearchParams({\n    url: url,\n    format: \"bestvideo\"\n  }),\n});\n```\n\n### Bookmarklet\n\nAdd the following bookmarklet to your bookmark bar so you can conviently send\nthe current page url to your youtube-dl-server instance.\n\n#### HTTPS\n\nIf your youtube-dl-server is served through https (behind a reverse proxy\nhandling https for example), you can use the following bookmarklet:\n\n```javascript\njavascript:fetch(\"https://${host}/api/downloads\",{body:JSON.stringify({url:window.location.href,format:\"bestvideo\"}),method:\"POST\",headers:{'Content-Type':'application/json'}});\n```\n\n#### Plain text\n\nIf you are hosting it without HTTPS, the previous bookmarklet will likely be\nblocked by your browser (as it will generate mixed content when used on HTTPS\nsites).\n\nInstead, you can use the following bookmarklet:\n\n```javascript\njavascript:(function(){document.body.innerHTML += '\u003cform name=\"ydl_form\" method=\"POST\" action=\"http://${host}/api/downloads\"\u003e\u003cinput name=\"url\" type=\"url\" value=\"'+window.location.href+'\"/\u003e\u003c/form\u003e';document.ydl_form.submit()})();\n```\n\n## Notes\n\n### Support extra formats\n\n`ffmpeg` is required for format conversion and audio extraction in some\nscenarios.\n## Additional references\n\n* [ansible-role-youtubedl-server](https://github.com/nbr23/ansible-role-youtubedl-server)\n* [ytdl-k8s](https://github.com/droopy4096/ytdl-k8s) - `youtube-dl-server` Helm chart (uses `youtube-dl-server` image for kubernetes deployment)\n* [starlette](https://www.starlette.io/)\n* [youtube-dl](https://github.com/rg3/youtube-dl)\n* [yt-dlp](https://github.com/yt-dlp/yt-dlp)\n\n[1]:youtube-dl-server.png\n[2]:youtube-dl-server-logs.png\n[3]:youtube-dl-server-profiles.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbr23%2Fyoutube-dl-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbr23%2Fyoutube-dl-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbr23%2Fyoutube-dl-server/lists"}