{"id":23816748,"url":"https://github.com/0xpr03/yayd","last_synced_at":"2025-08-12T13:50:51.878Z","repository":{"id":84936378,"uuid":"49349320","full_name":"0xpr03/yayd","owner":"0xpr03","description":"youtube-dl backend in Rust, aka youtube \u0026 co downloader","archived":false,"fork":false,"pushed_at":"2023-04-19T19:59:40.000Z","size":545,"stargazers_count":41,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T13:05:47.221Z","etag":null,"topics":["backend","ffmpeg","rust","youtube-dl","yt-dlp"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xpr03.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-10T01:50:14.000Z","updated_at":"2024-11-04T17:08:24.000Z","dependencies_parsed_at":"2023-07-21T09:55:21.445Z","dependency_job_id":null,"html_url":"https://github.com/0xpr03/yayd","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/0xpr03/yayd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xpr03%2Fyayd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xpr03%2Fyayd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xpr03%2Fyayd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xpr03%2Fyayd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xpr03","download_url":"https://codeload.github.com/0xpr03/yayd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xpr03%2Fyayd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265899937,"owners_count":23845879,"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":["backend","ffmpeg","rust","youtube-dl","yt-dlp"],"created_at":"2025-01-02T04:32:07.259Z","updated_at":"2025-07-19T07:09:28.744Z","avatar_url":"https://github.com/0xpr03.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yayd [![Build](https://github.com/0xpr03/yayd/actions/workflows/build.yml/badge.svg)](https://github.com/0xpr03/yayd/actions/workflows/build.yml)\n\n## About:  \nYAYD is intended as backend for [yt-dlp]. It's purpose is processing download jobs which are fetched from a Database. You probably want to\nlet it run over a webserver, using it as online service.\nIt was born out of ISP related problems and has multi-user support, can delete stored files from jobs after a time and supports proxies.\nCurrently there are only modules for youtube, twitch and soundcloud, feel free to extend them. (See [Hacking Yayd](#hacking-yayd))\n\n## Installation\n\nRequired:  \n* [FFMPEG] for conversions ([linux static builds](https://www.johnvansickle.com/ffmpeg/))\n* [python] 2.6, 2.7, or 3.2+ for [yt-dlp], which is called \u0026 kept up to date by yayd\n* [mariaDB]/MySQL\n\n1. Use a [release] build or build yayd from source with [rust]: `cargo build --release`\n2. Use and run [setup.sql] to create the tables according to your requirements.\n3. Run yayd for a first time, edit the config file, see [Config](config.md)\n4. Create your own logging configuration  \n**yayd doesn't provide any sort of UI**, being a backend, see down below for an example.\n\n## GUI / Frontend for yayd\n\nA frontend example is vailable under [yayd-frontend] and [looks like this](docs/yayd_gui.png)\n\n## Hacking Yayd\n\nEvery supported site has it's own handler module inside [src/handler](src/handler/)  \nAll library stuff, including [yt-dlp] and [ffmpeg] bindings are inside [src/lib](src/lib/)  \nThe Request struct used by every handler is inside [lib/mod.rs](src/lib/mod.rs#L36).\nIn general every request has an URL, quality code and information about whether it's an playlist request or not.\n(A youtube URL for a single video can include a playlist tag.)\n\nHandlers are consisting of a function called at program startup to register which URLs it's capable of handling\nand a function that does the actual work. Handlers can register multiple modules, for example for split up playlist and file handling.\n\nFor an example see [youtube.rs](src/handler/youtube.rs)\n\n### Testing\n\nAs yayd heavily relies on it's db connection, nearly all tests require an empty test DB to which yayd can connect. (Using temporary tables)\nYou can specify the connection parameters adapting the following command during tests:\n```\ndb_test=true ip=\"127.0.0.1\" port=\"3306\" user=root pass=\"\" db=ytdownl download_dir=\"/tmp\" temp_dir=\"/tmp\" RUST_BACKTRACE=1 mbps=100 ffmpeg_dir=\"/tmp/ffmpeg-3.0.2-64bit-static/\" cargo test\n```\n\n## DB System and quality codes\n\nThe DB scheme can be seen in [this picture.](docs/rdm.svg)\n\n## Status codes from yayd\n`code` in `querydetails`, `status` although misleading is for step updates (\"2|3\")\n\n| Code | Meaning |\n|---|---|\n| -1 | waiting |\n| 0 | started |\n| 1 | running |\n| 2 | finished |\n| 3 | finished, warnings |\n| 10 | internal error |\n| 11 | wrong quality |\n| 12 | source unavailable |\n\n## Quality Codes\n\nThese are the current quality codes per module:\ncolumn `quality` in `queries`\n\n### Youtube Module\n\nCode explanation see [itag](https://en.wikipedia.org/wiki/YouTube#Quality_and_formats).  \nAudio and video files have to be cut together, thus [FFMPEG] is required.\n\n| Code/iTag | Description |\n| --- | --- |\n| -1 | mp3 converted from source |\n| -2 | AAC MQ general |\n| -3 | AAC HQ general |\n| 133 | 240p |\n| 134 | 360p |\n| 135 | 480p |\n| 136 | 720p |\n| 137 | 1080p |\n| 298 | 720p, 60 fps |\n| 303 | 1080p, 60 fps |\n\niTag explanation (code \u003e 0):  \nYoutube-Videos are consisting of two DASH-Files. One is only Video, (in the quality you want).\nThe other one is a bad resolution video, but audio containing DASH-File.  \nThese two are merged by yayd and thus if you specify the wanted quality [itag] in you query (queries.quality) \nyayd will merge this with an audio file as specified in the config.  \nFor a personal list of recommended quality itags to be used for the quality column see down below.\nAs youtube changes the available codecs it is recommended to verify your setup from time to time.\nFor example the current 1080p@60fps, mp4 (itag 299) is pixelated in certain circumstances, while the recently added\nWebM (303) doesn't have this problem.  \n  \n(WebM is using VP9 as codec, MP4 h264)\n\n### Twitch\n\n| Code | Desciption |\n| --- | --- |\n| -10 | Mobile |\n| -11 | Low |\n| -12 | Medium |\n| -13 | High |\n| -14 | Source |\n\n# Notes\n\nThere is currently no multithreading support, meaning one job at a time. This is intentional and prevents DOS-Blocks (captcha requests) by some sites.\n\n   [yt-dlp]: \u003chttps://github.com/yt-dlp/yt-dlp\u003e\n   [FFMPEG]: \u003chttp://ffmpeg.org/\u003e\n   [mariadb]: \u003chttps://mariadb.org/\u003e\n   [rust]: \u003chttp://rust-lang.org/\u003e\n   [yayd-frontend]: \u003chttps://github.com/0xpr03/yayd-frontend\u003e\n   [release]: \u003chttps://github.com/0xpr03/yayd/releases\u003e\n   [setup.sql]: \u003csetup.sql\u003e\n   [itag]: \u003chttps://en.wikipedia.org/wiki/YouTube#Quality_and_formats\u003e\n   [python]: \u003chttps://www.python.org/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xpr03%2Fyayd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xpr03%2Fyayd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xpr03%2Fyayd/lists"}