{"id":13835418,"url":"https://github.com/Samillion/mpv-ytdlautoformat","last_synced_at":"2025-07-10T07:32:03.253Z","repository":{"id":39715214,"uuid":"216254397","full_name":"Samillion/mpv-ytdlautoformat","owner":"Samillion","description":"A simple mpv script that automatically adjusts ytdl-format (yt-dlp) for specified domains.","archived":false,"fork":false,"pushed_at":"2024-11-03T06:25:44.000Z","size":148,"stargazers_count":43,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T12:50:19.478Z","etag":null,"topics":["mpv","mpv-player","mpv-script"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samillion.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":"2019-10-19T18:44:42.000Z","updated_at":"2025-01-24T23:40:26.000Z","dependencies_parsed_at":"2024-01-15T19:44:04.151Z","dependency_job_id":"35438a3f-4d59-4ccf-ac47-f5236a16da1d","html_url":"https://github.com/Samillion/mpv-ytdlautoformat","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Samillion/mpv-ytdlautoformat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samillion%2Fmpv-ytdlautoformat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samillion%2Fmpv-ytdlautoformat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samillion%2Fmpv-ytdlautoformat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samillion%2Fmpv-ytdlautoformat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samillion","download_url":"https://codeload.github.com/Samillion/mpv-ytdlautoformat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samillion%2Fmpv-ytdlautoformat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545167,"owners_count":23625404,"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":["mpv","mpv-player","mpv-script"],"created_at":"2024-08-04T14:01:01.534Z","updated_at":"2025-07-10T07:32:02.943Z","avatar_url":"https://github.com/Samillion.png","language":"Lua","funding_links":[],"categories":["Streaming"],"sub_categories":[],"readme":"## mpv-ytdlAutoFormat\n![Terminal](https://github.com/user-attachments/assets/ee71a77a-3c0b-43f4-a16d-0de8909669d4)\n\nA simple mpv script that automatically adjusts `ytdl-format` (yt-dlp) for specified domains.\n\nIf a domain match is found, the script sets `ytdl-format` based on predefined options. It also has a fallback mode, in case the custom `ytdl-format` was not found.\n\n## How is this script useful?\nSome streaming websites lack multi-format options, meaning if `ytdl-format` in `mpv.conf` is set to 480p or 720p only, mpv/yt-dlp may fail to play videos without matching formats.\n\nThis script allows you to set video quality and codec for specific websites while keeping the default setting for others, ensuring smooth playback without constantly editing `mpv.conf`.\n\n## Options\nTo adjust options, simply change the values inside `local options` within the script.\n\n```lua\nlocal options = {\n    -- Which domains should ytdl-format change on?\n    domains = {\n        \"youtu.be\", \"youtube.com\", \"www.youtube.com\",\n        \"twitch.tv\", \"www.twitch.tv\",\n    },\n\n    -- Set maximum video quality (on load/start)\n    -- 240, 360, 480, 720, 1080, 1440, 2160, 4320\n    -- use 0 to ignore quality\n    quality = 720,\n\n    -- Prefered codec. avc, hevc, vp9, av1 or novp9\n    -- novp9: accept any codec except vp9\n    codec = \"avc\",\n\n    -- rare: to avoid mpv shutting down if nothing is found with the specified format\n    -- if true, and format not found, it'll use fallback_format\n    fallback = true,\n    fallback_format = \"bv+ba/b\",\n}\n```\n\n\u003e [!NOTE]\n\u003e The options only affect matched URLs from the `domains` list.\n\n\u003e [!TIP]\n\u003e You can set a default value in `mpv.conf` for non-matched domains. You don't have to, but this gives you more control on all streams you play.\n\u003e\n\u003e Examples for `mpv.conf`:\n\u003e\n\u003e - `ytdl-format=bv[vcodec!~='^(vp0?9)']+ba/b`\n\u003e\n\u003e - `ytdl-format=bv[height\u003c=1080][vcodec!~='^(vp0?9)']+ba/b[height\u003c=1080]`\n\n## How to install\nSimply place `ytdlautoformat.lua` in the corresponding mpv scripts folder of your operating system:\n\n- Windows: `%APPDATA%\\mpv\\scripts\\` or `C:\\users\\USERNAME\\AppData\\Roaming\\mpv\\scripts\\`\n- Linux: `~/.config/mpv/scripts/` or `/home/USERNAME/.config/mpv/scripts/`\n- Mac: `~/.config/mpv/scripts/` or `/Users/USERNAME/.config/mpv/scripts/`\n\n\u003e [!NOTE]\n\u003e More information about files locations can be found  [here](https://mpv.io/manual/master/#files)\n\n```\nconfig/mpv\n│   input.conf\n│   mpv.conf\n│\n└───scripts\n        ytdlautoformat.lua\n```\n\n## Alternatives\nI prefer a simple [mpv configuration](https://github.com/Samillion/mpv-conf), so I created this script to fit my basic use case.\n\nHowever, there are excellent alternatives offering more dynamic options, such as:\n- [mpv-quality-menu](https://github.com/christoph-heinrich/mpv-quality-menu): Lets you change streamed video and audio quality (ytdl-format) on the fly.\n- [mpv-selectformat](https://github.com/koonix/mpv-selectformat): Plugin for selecting the format of internet videos.\n\nThese can be used alongside `ytdlautoformat.lua` without conflicts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamillion%2Fmpv-ytdlautoformat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamillion%2Fmpv-ytdlautoformat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamillion%2Fmpv-ytdlautoformat/lists"}