{"id":24078500,"url":"https://github.com/nairyosangha/mpv-subversive","last_synced_at":"2025-07-26T13:09:46.689Z","repository":{"id":237531769,"uuid":"794472125","full_name":"nairyosangha/mpv-subversive","owner":"nairyosangha","description":"Automatically load (Japanese) subtitles in MPV","archived":false,"fork":false,"pushed_at":"2025-01-13T19:33:30.000Z","size":181,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T10:13:46.195Z","etag":null,"topics":["anilist","japanese","jimaku","lua","mpv","mpv-scripts","subtitles"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nairyosangha.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":"2024-05-01T08:46:59.000Z","updated_at":"2025-01-31T18:19:39.000Z","dependencies_parsed_at":"2024-05-09T21:30:14.892Z","dependency_job_id":"5116cec5-1989-4758-9afb-693055f3a3d5","html_url":"https://github.com/nairyosangha/mpv-subversive","commit_stats":null,"previous_names":["nairyosangha/mpv-subversive"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nairyosangha%2Fmpv-subversive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nairyosangha%2Fmpv-subversive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nairyosangha%2Fmpv-subversive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nairyosangha%2Fmpv-subversive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nairyosangha","download_url":"https://codeload.github.com/nairyosangha/mpv-subversive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251683356,"owners_count":21626953,"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":["anilist","japanese","jimaku","lua","mpv","mpv-scripts","subtitles"],"created_at":"2025-01-09T21:03:01.160Z","updated_at":"2025-04-30T10:13:51.543Z","avatar_url":"https://github.com/nairyosangha.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mpv-subversive\n\nMPV (v0.38.0+) plugin **for GNU/Linux** that makes it easy to find and load subtitles for the shows you're watching.\n\n[demo.webm](https://github.com/user-attachments/assets/00b0fa29-70e3-4cf9-8637-c21c13af37fb)\n\n\n\nThis plugin depends on functionality provided by the [AniList API](https://anilist.gitbook.io/anilist-apiv2-docs/overview/graphql) and [Jimaku](https://jimaku.cc/).\n\nThe code to display the GUI menu is largely borrowed from [autosubsync-mpv](https://github.com/joaquintorres/autosubsync-mpv)\n\n## Dependencies\n- unrar, unzip, 7zip (to extract archives)\n- luasocket, luasec (optional, script will fall back on CURL if this isn't present)\n- luarocks (optional, to install luasocket and luasec)\n\nUsing luasocket/luasec is a bit faster since we can reuse TCP sockets in that case, but CURL should be perfectly usable too.\n\n## Installation\n```sh\nsudo pacman -Syu unrar unzip p7zip lua51 luarocks\nsudo luarocks --lua-version 5.1 install luasocket\nsudo luarocks --lua-version 5.1 install luasec\ngit clone --recurse-submodules https://github.com/nairyosangha/mpv-subversive.git ~/.config/mpv/scripts/mpv-subversive\n```\n\n## Usage\n\n### Identifying media\n\nWhen pressing `b` (for browse!) the plugin will ask the user to identify the media they're currently watching.\n\nThis is done by trying to parse the media's filename and extracting the title and episode number from it.\n\nWhen we could not parse the filename succesfully there's a good chance no matches will be found, in this case the user is asked to provide the show name manually.\nThis uses the new `mp.input()` scripting functionality for which MPV version 0.38.0 is required.\n\n### Configuration\n\nConfiguration can be done by creating a `mpv-subversive.conf` file in MPV's `script-opts` folder (`$HOME/.config/mpv/script-opts/mpv-subversive.conf` by default)\n\nThe valid settings can be viewed in [main.lua](./main.lua)\n\nhttps://github.com/nairyosangha/mpv-subversive/blob/77b4a584e4c6530178879e5f2afe117a73487c8e/main.lua#L7-L25\n\n#### Caching lookups\n\nWhen looking up a new show the script will store the AniList media ID in a file called `.anilist.id` in the same directory as the file.\nThis file is then used for all consecutive lookups done in the same directory, so you don't have to look up each episode in a series.\n\nThis option can be disabled in the configuration, and certain directories can be excluded from being cached as well, see above.\n\n#### Subtitle backends\n\n##### jimaku\n\nThe script will query [jimaku.cc](https://jimaku.cc). To be able to do this, you need to [create an account](https://jimaku.cc/login) and [generate an API key](https://jimaku.cc/account).\n\nThis API key then needs to be added to the script's configuration, see above.\n\n##### offline (WIP)\n\nTo be able to use the plugin in offline mode, you need to have a locally stored archive of subtitles, and a mapping which links an AniList ID to a path to the directory (or zip/rar file) containing subtitles for the given ID.\nWe look for this mapping file (with name `mapping.csv`) in the script's directory itself. This can be overwritten in the configuration.\n\nThis file should look like this, 2 columns are expected, the anilist ID and a relative path to the local mapping directory.\n```\n3269,\"./mapping/.hack//G.U. Trilogy\"\n11755,\"./mapping/009 RE:CYBORG\"\n5525,\"./mapping/07-Ghost\"\n116242,\"./mapping/100-man no Inochi no Ue ni Ore wa Tatteiru\"\n127366,\"./mapping/100-man no Inochi no Ue ni Ore wa Tatteiru 2nd Season\"\n6682,\"./mapping/11eyes\"\n159559,\"./mapping/16bit Sensation: ANOTHER LAYER\"\n133411,\"./mapping/180-byou de Kimi no Mimi wo Shiawase ni Dekiru ka?\"\n161680,\"./mapping/1LDK+JK Ikinari Doukyo? Micchaku!? Hatsu Ecchi!!?\"\n113231,\"./mapping/2.43: Seiin Koukou Danshi Volley-bu\"\n```\n\nA script to create this mapping is provided: `build_offline_mapping.lua`. To run this script you'll need the following:\n\n- https://github.com/rxi/json.lua -\u003e download the json.lua file and save it in this directory\n\n- fill in your API key here: https://github.com/nairyosangha/mpv-subversive/blob/ad2fb7233ac3f6604b2c2b0214b7072de6cb1844/build_offline_archive.lua#L7\n- https://github.com/luaposix/luaposix (optional) -\u003e can also be installed with luarocks, see instructions above\n\nIf you don't want to install luaposix, you should uncomment the line that saves the mapping every so often. If you don't, it will only attempt to save the mapping at the very end, so if something goes wrong during the initial load you'll have to try all over again.\n\nhttps://github.com/nairyosangha/mpv-subversive/blob/ad2fb7233ac3f6604b2c2b0214b7072de6cb1844/build_offline_archive.lua#L75-L76\n\nTo run the script, you can simply do `luajit ./build_offline_mapping.lua`\n\nLuajit is a dependency of MPV so it should be preinstalled. It will probably work with Lua 5.1 as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnairyosangha%2Fmpv-subversive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnairyosangha%2Fmpv-subversive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnairyosangha%2Fmpv-subversive/lists"}