{"id":13585122,"url":"https://github.com/BenjaminOddou/alfred-plex","last_synced_at":"2025-04-07T06:32:39.581Z","repository":{"id":144112602,"uuid":"614350746","full_name":"BenjaminOddou/alfred-plex","owner":"BenjaminOddou","description":"📺 Browse and perform actions on your plex media servers","archived":false,"fork":false,"pushed_at":"2024-12-14T18:20:53.000Z","size":6891,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-14T19:20:31.656Z","etag":null,"topics":["alfred","alfred-workflow","api","plex","plex-api","plex-media-server","python","python-plexapi"],"latest_commit_sha":null,"homepage":"https://alfred.app/workflows/benjaminoddou/plex/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenjaminOddou.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":"2023-03-15T12:14:28.000Z","updated_at":"2024-12-14T18:11:39.000Z","dependencies_parsed_at":"2024-11-06T03:03:29.236Z","dependency_job_id":"954dc4f2-7e72-4a9e-91f9-c4014ca51835","html_url":"https://github.com/BenjaminOddou/alfred-plex","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminOddou%2Falfred-plex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminOddou%2Falfred-plex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminOddou%2Falfred-plex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminOddou%2Falfred-plex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenjaminOddou","download_url":"https://codeload.github.com/BenjaminOddou/alfred-plex/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247607500,"owners_count":20965942,"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":["alfred","alfred-workflow","api","plex","plex-api","plex-media-server","python","python-plexapi"],"created_at":"2024-08-01T15:04:45.169Z","updated_at":"2025-04-07T06:32:39.575Z","avatar_url":"https://github.com/BenjaminOddou.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cimg src=\"public/icon_dark_mode.webp#gh-dark-mode-only\" alt=\"logo-dark\" height=\"55\"/\u003e\n\u003cimg src=\"public/icon_light_mode.webp#gh-light-mode-only\" alt=\"logo-light\" height=\"55\"/\u003e\n\n[![made with heart by Benjamin Oddou](https://img.shields.io/badge/made%20with%20%E2%99%A5%20by-benjamin%20oddou-DBA33A.svg?style=flat)](https://github.com/BenjaminOddou)\n[![saythanks](https://img.shields.io/badge/say-thanks-000000.svg?style=flat)](https://saythanks.io/to/BenjaminOddou)\n[![Python 3.9+](https://img.shields.io/badge/python-3.9+-986821.svg)](https://www.python.org/downloads/macos/)\n\n✨ Welcome to the Alfred Plex repository: **An Alfred Workflow** ✨\n\n![vlc](public/vlc.gif)\n\n## ✅ Prerequisites\n\n- MacOS.\n- Alfred 5. Note that the [Alfred Powerpack](https://www.alfredapp.com/powerpack/) is required to use workflows.\n- An access to a plex media server.\n- Requires **python 3.9** or above.\n\n## ⬇️ Installation\n\n1. [Download the workflow](https://github.com/BenjaminOddou/alfred-plex/releases/latest).\n2. Double click the `.alfredworkflow` file to install.\n\n## 🏎️ Plex API\n\nThis workflow uses the [Python-PlexAPI](https://github.com/pkkid/python-plexapi) but doesn't cover all capabilities of this tool. If you see a good feature from the Python-PlexAPI that can be incorporated in this workflow, please let me know by opening an issue or sending a pull request.\n\n## 🧰 Setup the workflow\n\nInstall Python. Check your version with:\n\n```shell\npython --version\n```\n\n## 🧙‍♂️ Invoke the workflow\n\nLaunch the menu with `plex`. You can edit this trigger in the [Workflow Configuration](https://www.alfredapp.com/help/workflows/user-configuration/) panel.\n\nThe workflow is divided in 6 parts :\n\n1. Search medias throughout your servers.\n2. Search medias using discover.\n3. Manage your plex accounts.\n4. Manage servers and perform actions.\n5. Manage presets to rapidly search medias.\n6. Workflow configuration + filter \u0026 sort options.\n\n![menu](public/menu.webp)\n\nTo use this workflow, you need to add server(s).In order to do so, you must connect to an account that have access to a plex media server with your credentials. **If you're not the owner of the server, you won't have access to the server settings**.\n\nGo to the `Plex Account` section to know more on how to manage your accounts.\n\n## 🤖 Usage of the workflow\n\n### Plex Search : Search medias throughout your servers\n\n#### 1. Simple search\n\nIn this mode, you search medias on your servers directly by typing your request. You can optionally add a `/` followed by one of the following media types: _track, album, artist, collection, actor, director, genre, movie, photo, photoalbum, playlist, show, episode, clip_.\n\nLink to the [Python-PlexAPI documentation](https://python-plexapi.readthedocs.io/en/latest/modules/server.html#plexapi.server.PlexServer.search).\n\n![simple_search](public/simple_search.webp)\n\n#### 2. Advance search\n\nIn this mode, you search medias on your library sections. To enter this mode, you can use `filters` and/or `advanced filters`.\n\nTo know how to use them, go to the section : `Plex Help`.\n\nLink to the [Python-PlexAPI documentation](https://python-plexapi.readthedocs.io/en/latest/modules/library.html#plexapi.library.LibrarySection.search).\n\nThe following example `libtype=movie/decade=1980/country=france` returns `movies` released between `1980` and `1990` in the country `France`.\n\n![filters_full_1](public/filters_full_1.webp)\n\n#### 3. Actions on medias\n\n\u003e The following actions can be configured in the user configuration panel\n\n1. Nested search. Press \u003ckbd\u003e⏎\u003c/kbd\u003e on one of the following media types: _actor, director, collection, artist, album, genre, show, season_, to trigger a nested search.\n2. Open the media on the web. Simply press \u003ckbd\u003e⌘\u003c/kbd\u003e\u003ckbd\u003e⏎\u003c/kbd\u003e to open the media on plex. Not available for _genre_ media type.\n3. Stream the media with VLC / IINA. This is only available for the following media types: _movie, episode, clip, track*, album*_. Press \u003ckbd\u003e⌥\u003c/kbd\u003e\u003ckbd\u003e⏎\u003c/kbd\u003e to open the media in VLC / IINA / INFUSE. _It requires VLC 3.0+ or IINA 1.0.0+ and the corresponding cli. See below to know how to install the cli_. If you have multiple versions of the same _movie, episode, clip_, you'll be asked to choose the file you want to play. \\*INFUSE doesn’t accept standalone audio streams\n4. Get infos of movies and tv shows using the [Movie and TV Show Search](https://github.com/tmcknight/Movie-and-TV-Show-Search-Alfred-Workflow) Alfred workflow by [Tom McKnight](https://github.com/tmcknight). Press \u003ckbd\u003e⌃\u003c/kbd\u003e\u003ckbd\u003e⏎\u003c/kbd\u003e to trigger the workflow. _It requires [Movie and TV Show Search](https://github.com/tmcknight/Movie-and-TV-Show-Search-Alfred-Workflow) Alfred workflow 2.16.0 or above_. Only available for _movie, show_ media types.\n5. Add or remove the media from your plex watchlist. This is only available for the following media types: _movie, show_. Press \u003ckbd\u003e⇧\u003c/kbd\u003e\u003ckbd\u003e⏎\u003c/kbd\u003e to add or remove the media.\n\n#### 4. VLC, IINA and INFUSE integration\n\nIf you don't have VLC / IINA on your mac, run the following command to install it via homebrew:\n\n```shell\nbrew install --cask vlc\nbrew install --cask iina\n```\n\nIf you already have VLC / IINA installed check the presence of the cli with:\n\n```shell\nwhich vlc\nwhich iina\n```\n\nIf it is not found, uninstall VLC / IINA and reinstall it using homebrew. INFUSE doesn't require cli so you can just install the application from the app store.\n\nLink to the VLC [homebrew formulae](https://formulae.brew.sh/cask/vlc).\nLink to the IINA [homebrew formulae](https://formulae.brew.sh/cask/iina).\nLink to the INFUSE [website](https://firecore.com/infuse).\n\n### Plex Discover : Search medias using discover\n\nSearch medias and people on [Plex Discover](https://support.plex.tv/articles/discover/). You can perform the same actions \\*\\* listed [above](#3-actions-on-medias).\n\n\\*\\* Except streaming with VLC / IINA / INFUSE. Note that nested search allows you to search media title within your servers.\n\n![discover](public/discover.webp)\n\n### Plex Accounts : Manage your plex accounts\n\nConnect one or more accounts to add plex media servers. Use one of the following methods to connect to your plex account :\n\n- Use your plex credentials (username + password + OTP if you enabled [2FA](https://support.plex.tv/articles/two-factor-authentication/)).\n- Use a plex account token. This can be useful if you use a [third party application](https://support.plex.tv/articles/use-federated-authentication-to-sign-in/) to sign in to plex. In order to get your account auth token, you'll need to :\n  - Go to https://app.plex.tv/desktop/#!/settings/account.\n  - Open the browser developper tool with \u003ckbd\u003e⌘\u003c/kbd\u003e\u003ckbd\u003e⌥\u003c/kbd\u003e\u003ckbd\u003eI\u003c/kbd\u003e.\n  - Inspect a request with https://clients.plex.tv/ as base url.\n  - Copy the `X-Plex-Token` and insert in the workflow.\n\n![auth](public/auth.webp)\n\nIn this section you can :\n\n- See the list of your servers. Servers that aren't added to the workflow are greyed out.\n- Manage connected users.\n- Manage connected devices.\n- Manage your watchlist.\n\n![plex_account](public/plex_account.webp)\n\n\u003e Removing a plex account will remove all the servers connected. You can also remove a server directly in the Plex Media Servers section.\n\nWhen connected to the workflow, you'll be able to see the device under the `Authorized Devices` section. Follow this [documentation](https://support.plex.tv/articles/115007577087-devices/) to know more. _Note that when using an authentication token, you'll use the web session from which you obtained the token_.\n\n![device](public/device.webp)\n\n### Plex Media Servers : Manage servers and perform actions\n\nSelect the server to view its informations and perform actions.\n\n- Download last version of plex media server from the web.\n- Backup logs and databases.\n- Display connected account.\n- Manage running sessions.\n- Perform actions on library sections:\n  - Scan library sections (search for new medias).\n  - Refresh library sections (download fresh media info from the internet).\n  - Display history.\n  - Display library sections sizes.\n- Display and modify settings of the server.\n- Display real time server statistics.\n\n\u003e New values for settings must match the setting type and must be valid python. For example, boolean must be True or False with capital letter and string must be quoted.\n\n![server_actions](public/server_actions.webp)\n\n### Plex Presets : Manage presets to rapidly search medias\n\n#### 1. Create a preset\n\nCreate easily preset by pressing \u003ckbd\u003e⏎\u003c/kbd\u003e on `Add a new Preset`. Input a `value` for the preset **WITH FULL FILTERS NAMES**. Then input a `title` and a `subtitle` separated by a `/`.\n\n#### 2. Modify a preset\n\nSimply press \u003ckbd\u003e⌘\u003c/kbd\u003e\u003ckbd\u003e⏎\u003c/kbd\u003e to enter in the modified mode. Press \u003ckbd\u003e⏎\u003c/kbd\u003e to edit the `title/subtitle` or the `value`.\n\n![preset_modify](public/preset_modify.webp)\n\n#### 3. Apply a preset\n\nSimply press \u003ckbd\u003e⏎\u003c/kbd\u003e on a preset to apply its value to the search workflow.\n\n![preset_entry](public/preset_entry.webp)\n\n### Plex Help : Workflow configuration + filter \u0026 sort options\n\nYou can manage workflow cache, data and edit filter alias.\n\n![plex_help](public/plex_help.webp)\n\nFilters, fields and sorts options are generated based on your libraries metadata. This will vary regarding your medias and agents used to gather information.\n\n#### 1. Filters\n\n\u003e Filters can be aliased, see section `4. Alias` below\n\nPlex filters can be applied by typing `filterName=value`. Use `/` to separate them. Find the list of filters under each library sections of your servers.\n\nExample: `libtype=movie/actor=adam driver`. It returns `movies` with `Adam Driver`.\n\n![filters_full_2](public/filters_full_2.webp)\n\n#### 2. Fields (advanced filters)\n\nPlex fields (or advanced filters) can be applied by typing `advancedFilters={\u003cFILTER\u003e}` (or `af={\u003cFILTER\u003e}` in `alias mode`). There is certain conditions you have to respect to make advance filters working:\n\n- Use `/` to separate advanced filter from other filters.\n- You must use them along with a `libtype`.\n- You must provide a valid Python _dict_ or valid _JSON_ syntax. Double quotes `\"` and single quotes `'` are valid.\n\nTo know more on how to use these filters, check the [Python-PlexAPI documentation](https://python-plexapi.readthedocs.io/en/latest/modules/library.html#plexapi.library.LibrarySection.search).\n\nFind the list of fields under each library sections of your servers.\n\nExample: `libtype=episode/advancedFilters={'show.title': 'one piece', 'episode.index': '1074'}`. It returns `episodes` where `episode number` is `1074` and the title of the show contains `one piece`.\n\n![advanced_filters](public/advanced_filters.webp)\n\n#### 3. Sorts\n\nYou can sort results by typing `sort=sortName:dir` (or `so=sortName:dir` in `alias mode`). Direction can be `:asc` for ascending or `:desc` for descending.\n\nExample: `libtype=movie/sort=originallyAvailableAt:desc`. This will display `movies` from the `most recent` to the `older` one.\n\n![sorts](public/sorts.webp)\n\n#### 4. Alias\n\nAlias are enabled by default, and allows you, when activated, to write filters more easily. `libtype` becomes `lt`, `studio` becomes `st`...\n\nYou can disable this behavior in the user control panel by unticking the `📜 Use alias` parameter.\n\nAlias file can be edited, but be careful about double values. It is the `alias.json` file located under the `📁 Data folder` (`~/Library/Application Support/Alfred/Workflow Data/com.benjamino.plex` by default).\n\nExample: `af={'addedAt\u003e\u003e': '30d'}/lt=show`. It returns `shows` added or `shows` containing new elements (seasons, epidodes) in plex during the last `30 days`.\n\n![alias](public/alias.webp)\n\n## ⚖️ License\n\n[MIT License](LICENSE) © Benjamin Oddou\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBenjaminOddou%2Falfred-plex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBenjaminOddou%2Falfred-plex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBenjaminOddou%2Falfred-plex/lists"}