{"id":44283653,"url":"https://github.com/nicklayb/plexm3u","last_synced_at":"2026-02-10T22:09:03.355Z","repository":{"id":319002664,"uuid":"1076487983","full_name":"nicklayb/plexm3u","owner":"nicklayb","description":"Plex playlist m3u generator","archived":false,"fork":false,"pushed_at":"2025-11-16T15:14:27.000Z","size":1732,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-16T16:18:58.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nicklayb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-14T23:55:01.000Z","updated_at":"2025-11-16T15:14:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"f35e9ba4-aecc-4a5c-97b6-77b6962e08d9","html_url":"https://github.com/nicklayb/plexm3u","commit_stats":null,"previous_names":["nicklayb/plexm3u"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nicklayb/plexm3u","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklayb%2Fplexm3u","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklayb%2Fplexm3u/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklayb%2Fplexm3u/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklayb%2Fplexm3u/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicklayb","download_url":"https://codeload.github.com/nicklayb/plexm3u/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicklayb%2Fplexm3u/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29319440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-02-10T22:09:02.685Z","updated_at":"2026-02-10T22:09:03.338Z","avatar_url":"https://github.com/nicklayb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plexm3u\n\nClient that generates M3U playlist from a Plex server. Keep one playlist source of truth and sync them everywhere.\n\nWorks for both video and audio!\n\n## Usage\n\n### Docker\n\nA docker image exist in the wild at `nboisvert/plexm3u`. \n\n```bash\ndocker run nboisvert/plexm3u --help\n```\n\n### Nix flake\n\nI'm exposing a Nix Flake (actually everything is built with Nix here), so you can do like me and include it in your NixOS's configuration to have it installed.\n\n\n### Build from source\n\nThe project is a Rust project so, assuming you have the right toolchain, you can pull the repo and run `cargo build` to build the project (or `cargo run` if you just want to run it as one off).\n\n#### OS support\n\nRight now, this project has only been tested using x86_64 linux host. I haven't tested macOS or aarch linuxes. While the flake is using a `eachDefaultSystem`, I'm expecting it would work as well on other platform but it has not been tested.\n\nAs for Windows, it's not tested either, won't be tested either and I'm not guaranteeing any support for it. Simply because I don't have (want) a Windows computer at home. If anyone wants to support it, you're welcome to contribute to the repo but it must not compromise other OS support.\n\n## Recommendation to properly sync\n\nWhat I recommend to do (if like me you wanna sync all your library), is the following:\n\n1. Create smart playlist on Plex containing all of your songs.\n2. List your playlists with `list-playlists` command to find the Rating Key of the playlist containing all songs.\n3. Dump the m3u of this playlist using the Rating Key found at step 2 with `dump-playlist`.\n4. Run the `verify-m3u` command for the dumped m3u file with the `--fix` argument. Now this will be quite long depending on how many songs you have.\n5. Now you can sync individual playlists. All files should be present locally so all playlists should be working.\n\n## Commands\n\nThe tool supports various command:\n\n- `sync`: Combines `dump-playlist` and `verify-m3u`. With the `--fix` option the client can download missing songs. (Shouldn't be necessary if you followed the recommended usage)\n- `list-playlists`: Lists the playlists on the server with their \"Rating Key\". This key will be necessary for any action on the playlist.\n- `get-playlist`: Shows the content of a playlist.\n- `dump-playlist`: Dumps an m3u file of the playlist.\n- `verify-m3u`: Verifies that the file listed in an m3u really exists. A `--fix` option allow to download the missing file from the server.\n\n### Sync\n\n```\nplexm3u sync --server $PLEX_SERVER --token $PLEX_TOKEN --rewrite-from /data/onmyserver --rewrite-to Music -p /media/usb [$PLAYLIST...] \n```\n\nThe sync command can sync multiple playlist at once. After dumping the playlist, a verification is done that the track do exists. In case of missing file, you can use `--fix` to download them.\n\n### List playlists\n\n```\nplexm3u list-playlists --server $PLEX_SERVER --token $PLEX_TOKEN\n```\n\nThe `--token` argument can be ommitted if you're pointing directly to your Plex server. You can also pass `--only audio` to list only audio playlists.\n\nThe list will look like:\n\n```\n120110: All Music [audio] [Smart] [15376 tracks]\n135542: Best Albums [audio] [Smart] [1589 tracks]\n135420: HipHop Rap [audio] [Smart] [2028 tracks]\n135422: Québec [audio] [Smart] [3403 tracks]\n120109: Recently Added [audio] [Smart] [84 tracks]\n120107: Recently Played [audio] [Smart] [452 tracks]\n130537: Adrien’s Early Days [audio] [851 tracks]\n...\n```\n\nThe number on the left is the \"Rating Key\", it'll be necessary to get or dump a playlist.\n\n### Dump a playlist\n\n```\nplexm3u dump-playlist --server $SERVER -f [Destination M3U file] [Rating key]\n```\n\nIf the destination path is a folder (ex. `./`), the generated m3u file will be the playlist's name with `m3u` extension. Providing a file will create the file as you named it.\n\n#### Rewriting path\n\nTwo other arguments you can find useful are `--rewrite-from` and `--rewrite-to`. These allow to rewrite the path to match you destination's directory structure.\n\nSuppose your server runs in a Docker container (like mine), your folder structure will likely need to be rewritten. Also given that M3U playlists have relative path to the playlist.\n\n##### Concrete example\n\nMy server has `/music/iTunes/Rush/Power Windows/03 Manhattan Project.m4a`. But on my thumb drive, all artists are in a Music folder, the same (wonderful) song would be in `Music/Rush/Power Windows/03 Manhattan Project.m4a`.\n\nIn order to dump a playlist, I need to do \n\n```\nplexm3u dump-playlist --server $SERVER -f /media/usb/playlist.m3u --rewrite-from \"/music/iTunes\" --rewrite-to \"Music` [Rating key]\n```\n\n### Verifying an M3u file\n\nOnce the playlist is dumped you can verify that your drive indeed has the files. This can help showing disparity between your drive and what's on your server.\n\nA concrete example here, when I ran the verifying for a playlist, I got the following\n\n```\nplexm3u verify-m3u -f /media/usb/patate.m3u\n\nThe following tracks (1 out of 70) could not be found at \"/media/usb\"\n\tMusic/Peter Henry Phillips/Peter Henry Phillips - EP/03 Secret.m4a\n```\n\nThis is because on my drive, the album is named \"Peter Henry Phillips\" (Missing the EP).\n\nBy default, the command searches in the m3u's folder. But if there's a case where the m3u is elsewhere, you can pass `-p [folder where tracks are located]`.\n\n#### Fixing a playlist\n\nIf the verification shows missing files, you can pass `--fix` and `--server $SERVER` in order for PlexM3U to download the missing file in the right location.\n\n**Note**: This is intended to work only on M3U generated by `plexm3u` because the tool adds some metadata tags in the file. Using another file will not work.\n\n### My (quite niche) use case for this\n\nI've always loved to have my music on an actual device that doesn't depend on the network for a lot of reasons. Yes, Plexamp is amazing, yes, I have CarPlay that allows me to listen to Plexamp. But the experience, is not comparable to how the native audio system integrates with the overall car. I hate touchscreens so if I can avoid using CarPlay to browse songs, the better.\n\nMy use case is that my car (a 2019 Audi e-tron) has an amazing audio system. The MMI is really nice to use, you can browse tracks with the steering wheel and even add shortcuts in the climate control to start playlists or artists (I obviously have a shortcut that starts Rush songs on shuffle).\n\nSo this tool allows me to easily sync my playlists from Plexamp straight to my USB drive that has all my music. Not only music! You can also sync video files. In my case, the radio can also play video, it just cut the video feed when driving so we can easily watch (listen) comedy specials.\n\n**Note**: This was only tested with my car's stereo. So maybe there can be issues with your particular use case\n\n## TODO\n\n- [x] Ability to copy (or sync) files.\n- [x] Improve ugly `get-playlist` output.\n- [ ] Improve concurrency of the downloads.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklayb%2Fplexm3u","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicklayb%2Fplexm3u","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicklayb%2Fplexm3u/lists"}