plexy


Nameplexy JSON
Version 0.1.3 PyPI version JSON
download
home_pagehttps://github.com/ratoaq2/plexy
SummaryYour Plex, your way
upload_time2023-02-10 07:36:43
maintainer
docs_urlNone
authorRato
requires_python>=3.8.1,<4.0.0
licenseMIT
keywords video plex audio subtitles preferences dubbed subbed original language foreign movie episode tv track shows series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Plexy
Your Plex, your way

[![Latest
Version](https://img.shields.io/pypi/v/plexy.svg)](https://pypi.python.org/pypi/plexy)

[![tests](https://github.com/ratoaq2/plexy/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/plexy/actions/workflows/test.yml)

[![License](https://img.shields.io/github/license/ratoaq2/plexy.svg)](https://github.com/ratoaq2/plexy/blob/master/LICENSE)

  - Project page  
    <https://github.com/ratoaq2/plexy>

## Info

**Plexy** is a command line tool to save your watching preferences in Plex.

**Dubbed** or **Original audio**, it's up to you.

- For **Dubbed** preference, Plexy will auto-select the audio track with your desired language.
If no audio track is found, Plexy will auto-select the subtitle track with your desired language.
- For **Original** preference, Plexy will auto-select the default/original audio track 
and the subtitle track in your desired language.

Priorities:
- Commentary audio tracks have lower priority when selecting audio tracks
- Closed caption and SDH subtitle tracks also have lower priority when selecting subtitles


To select Brazilian Portuguese language with original audio
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR original
```

To select English language with dubbed audio
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language en dubbed
```

To select French language with original audio only for Game of Thrones
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title "Game of Thrones" original
```

To select German language with dubbed audio only for Mandalorian Season 2
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title "Mandalorian s02" dubbed
```

To select German language with dubbed audio only for Game of Thrones, season 3 and episode 9
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title "Game of Thrones s03e09" dubbed
```

To select Spanish language with dubbed audio only for all Matrix movies and the first Avatar movie
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language es --title "Matrix" --title "Avatar (2009)" dubbed
```

To select Portuguese language with original audio for everything added to your libraries in the last week
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt --newer 1w original
```

To select Brazilian Portuguese language with original audio for everything added to your "Movie" library before the last week
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --library Movie --language pt-BR --older 1w original
```

You can also select or exclude tracks based on their codec/format.
For instance, you have a Chromecast with Google TV which doesn't support Dolby TrueHD audio codec.
You can exclude this codec when saving your preferences: 
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR -A truehd original
```

And print the full summary of changes:
```bash
>> plexy --url http://mylocalplex:32400 --token ABCDEFGHIJ1234567890 preferences -f -l en --title "The Matrix (1999)" original
Configuring watching preferences  [####################################]  100%
1 movie changed out of 1 selected movie
The Matrix (1999) changed from pt-BR: Português (SRT External) to no subtitles
```


You can also define your configuration options in a `json` or `yaml` file:
```yaml
url: http://myplexserver:32400
token: ABCDEFGHIJ1234567890
preferences:
  library:
    - Movies
    - TV Shows
  excluded_subtitle_codec:
    - eia_608
  full_summary: True
  language: pt-BR
  watching_preference: original
```

By default, plexy will load `config.json`, `config.yaml` or `config.yml` file from the folders:
- Mac OS: `~/Library/Preferences/plexy`
- Linux: `~/.config/plexy/`
- Windows: `C:\Users\<USER>\AppData\Local\plexy\plexy`

And then update the configuration with data from `plexy.json`, `plexy.yaml` or `plexy.yml` in the current working directory.

You can pass the configuration to use with the `--config` parameter:
```bash
>> plexy --config myconfig.yml preferences
Configuring watching preferences  [####################################]  100%
1 movie changed out of 1 selected movie
The Matrix (1999) changed from pt-BR: Português (SRT External) to no subtitles
```


All available CLI options:
```bash
>> plexy --url <PLEX_URL> --token <USER_TOKEN> preferences --help
Usage: plexy preferences [OPTIONS] {original|dubbed}

  Your watching preferences

  Dubbed prefers an audio track with the desired language.
  Original prefers the original audio and an additional subtitle track if the audio is not in the desired language.

Options:
  -L, --library TEXT              Library to be used. e.g: Movies, Shows.
  -t, --title TITLE               Filter for titles in your library. It could refer to a movie, a
                                  show, a season or an episode. e.g: Avatar, The Matrix (1999),
                                  The Boys s2, Chernobyl s01e03, Game of Thrones (2011) s03e09
  -l, --language LANGUAGE         Desired watching language as IETF code, e.g.: en, pt-BR.
  -a, --audio-codec [dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]
                                  Accepted audio codec.
  -A, --excluded-audio-codec [dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]
                                  Excluded audio codec.
  -s, --subtitle-codec [srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]
                                  Accepted subtitle codec.
  -S, --excluded-subtitle-codec [srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]
                                  Excluded subtitle codec.
  -n, --newer-than AGE            Filter movies/episodes newer than AGE, e.g. 12h, 1w2d
  -o, --older-than AGE            Filter movies/episodes older than AGE, e.g. 12h, 1w2d
  -f, --full-summary              Print the full summary of changed preferences.
  --skip-watching                 Skip movies/episodes that watch is in progress.
  --keep-selected-audio           Do not change the selected audio. Useful when using original
                                  watching preference.
  --keep-selected-subtitle        Do not change the selected subtitle.
  --force-subtitles               Select subtitles, even when the audio already matches the
                                  desired language.
  --debug                         Print useful information for debugging and for reporting bugs.
  --help                          Show this message and exit.
```


## Using Docker


    docker run -it --rm plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR -A truehd original


## Installation

**Plexy** can be installed as a regular python module by running:

    $ [sudo] pip install plexy

For a better isolation with your system you should use a dedicated
virtualenv or install for your user only using the `--user` flag.

## Dependencies
* [Diaoul/babelfish](https://github.com/Diaoul/babelfish)
* [pkkid/python-plexapi](https://github.com/pkkid/python-plexapi)
* [ratoaq2/trakit](https://github.com/ratoaq2/trakit)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ratoaq2/plexy",
    "name": "plexy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0.0",
    "maintainer_email": "",
    "keywords": "video,plex,audio,subtitles,preferences,dubbed,subbed,original,language,foreign,movie,episode,tv,track,shows,series",
    "author": "Rato",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c8/70/d7bf5b42ced3a45bb9c10873ddab7904afe4eb0861bd836f3f995caf71a1/plexy-0.1.3.tar.gz",
    "platform": null,
    "description": "# Plexy\nYour Plex, your way\n\n[![Latest\nVersion](https://img.shields.io/pypi/v/plexy.svg)](https://pypi.python.org/pypi/plexy)\n\n[![tests](https://github.com/ratoaq2/plexy/actions/workflows/test.yml/badge.svg)](https://github.com/ratoaq2/plexy/actions/workflows/test.yml)\n\n[![License](https://img.shields.io/github/license/ratoaq2/plexy.svg)](https://github.com/ratoaq2/plexy/blob/master/LICENSE)\n\n  - Project page  \n    <https://github.com/ratoaq2/plexy>\n\n## Info\n\n**Plexy** is a command line tool to save your watching preferences in Plex.\n\n**Dubbed** or **Original audio**, it's up to you.\n\n- For **Dubbed** preference, Plexy will auto-select the audio track with your desired language.\nIf no audio track is found, Plexy will auto-select the subtitle track with your desired language.\n- For **Original** preference, Plexy will auto-select the default/original audio track \nand the subtitle track in your desired language.\n\nPriorities:\n- Commentary audio tracks have lower priority when selecting audio tracks\n- Closed caption and SDH subtitle tracks also have lower priority when selecting subtitles\n\n\nTo select Brazilian Portuguese language with original audio\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR original\n```\n\nTo select English language with dubbed audio\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language en dubbed\n```\n\nTo select French language with original audio only for Game of Thrones\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title \"Game of Thrones\" original\n```\n\nTo select German language with dubbed audio only for Mandalorian Season 2\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title \"Mandalorian s02\" dubbed\n```\n\nTo select German language with dubbed audio only for Game of Thrones, season 3 and episode 9\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language fr --title \"Game of Thrones s03e09\" dubbed\n```\n\nTo select Spanish language with dubbed audio only for all Matrix movies and the first Avatar movie\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language es --title \"Matrix\" --title \"Avatar (2009)\" dubbed\n```\n\nTo select Portuguese language with original audio for everything added to your libraries in the last week\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt --newer 1w original\n```\n\nTo select Brazilian Portuguese language with original audio for everything added to your \"Movie\" library before the last week\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --library Movie --language pt-BR --older 1w original\n```\n\nYou can also select or exclude tracks based on their codec/format.\nFor instance, you have a Chromecast with Google TV which doesn't support Dolby TrueHD audio codec.\nYou can exclude this codec when saving your preferences: \n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR -A truehd original\n```\n\nAnd print the full summary of changes:\n```bash\n>> plexy --url http://mylocalplex:32400 --token ABCDEFGHIJ1234567890 preferences -f -l en --title \"The Matrix (1999)\" original\nConfiguring watching preferences  [####################################]  100%\n1 movie changed out of 1 selected movie\nThe Matrix (1999) changed from pt-BR: Portugu\u00eas (SRT External) to no subtitles\n```\n\n\nYou can also define your configuration options in a `json` or `yaml` file:\n```yaml\nurl: http://myplexserver:32400\ntoken: ABCDEFGHIJ1234567890\npreferences:\n  library:\n    - Movies\n    - TV Shows\n  excluded_subtitle_codec:\n    - eia_608\n  full_summary: True\n  language: pt-BR\n  watching_preference: original\n```\n\nBy default, plexy will load `config.json`, `config.yaml` or `config.yml` file from the folders:\n- Mac OS: `~/Library/Preferences/plexy`\n- Linux: `~/.config/plexy/`\n- Windows: `C:\\Users\\<USER>\\AppData\\Local\\plexy\\plexy`\n\nAnd then update the configuration with data from `plexy.json`, `plexy.yaml` or `plexy.yml` in the current working directory.\n\nYou can pass the configuration to use with the `--config` parameter:\n```bash\n>> plexy --config myconfig.yml preferences\nConfiguring watching preferences  [####################################]  100%\n1 movie changed out of 1 selected movie\nThe Matrix (1999) changed from pt-BR: Portugu\u00eas (SRT External) to no subtitles\n```\n\n\nAll available CLI options:\n```bash\n>> plexy --url <PLEX_URL> --token <USER_TOKEN> preferences --help\nUsage: plexy preferences [OPTIONS] {original|dubbed}\n\n  Your watching preferences\n\n  Dubbed prefers an audio track with the desired language.\n  Original prefers the original audio and an additional subtitle track if the audio is not in the desired language.\n\nOptions:\n  -L, --library TEXT              Library to be used. e.g: Movies, Shows.\n  -t, --title TITLE               Filter for titles in your library. It could refer to a movie, a\n                                  show, a season or an episode. e.g: Avatar, The Matrix (1999),\n                                  The Boys s2, Chernobyl s01e03, Game of Thrones (2011) s03e09\n  -l, --language LANGUAGE         Desired watching language as IETF code, e.g.: en, pt-BR.\n  -a, --audio-codec [dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]\n                                  Accepted audio codec.\n  -A, --excluded-audio-codec [dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]\n                                  Excluded audio codec.\n  -s, --subtitle-codec [srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]\n                                  Accepted subtitle codec.\n  -S, --excluded-subtitle-codec [srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]\n                                  Excluded subtitle codec.\n  -n, --newer-than AGE            Filter movies/episodes newer than AGE, e.g. 12h, 1w2d\n  -o, --older-than AGE            Filter movies/episodes older than AGE, e.g. 12h, 1w2d\n  -f, --full-summary              Print the full summary of changed preferences.\n  --skip-watching                 Skip movies/episodes that watch is in progress.\n  --keep-selected-audio           Do not change the selected audio. Useful when using original\n                                  watching preference.\n  --keep-selected-subtitle        Do not change the selected subtitle.\n  --force-subtitles               Select subtitles, even when the audio already matches the\n                                  desired language.\n  --debug                         Print useful information for debugging and for reporting bugs.\n  --help                          Show this message and exit.\n```\n\n\n## Using Docker\n\n\n    docker run -it --rm plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR -A truehd original\n\n\n## Installation\n\n**Plexy** can be installed as a regular python module by running:\n\n    $ [sudo] pip install plexy\n\nFor a better isolation with your system you should use a dedicated\nvirtualenv or install for your user only using the `--user` flag.\n\n## Dependencies\n* [Diaoul/babelfish](https://github.com/Diaoul/babelfish)\n* [pkkid/python-plexapi](https://github.com/pkkid/python-plexapi)\n* [ratoaq2/trakit](https://github.com/ratoaq2/trakit)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Your Plex, your way",
    "version": "0.1.3",
    "split_keywords": [
        "video",
        "plex",
        "audio",
        "subtitles",
        "preferences",
        "dubbed",
        "subbed",
        "original",
        "language",
        "foreign",
        "movie",
        "episode",
        "tv",
        "track",
        "shows",
        "series"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04b7a10b835339b70815a3922f9bd606907849e5d4f2155ddddacd4e2c35b4c3",
                "md5": "d3b0778e069205f79c10c02c4f274bca",
                "sha256": "2921448a4de082caccf446b93b6fa1243af64966fa468101c453cc9fbd45da9f"
            },
            "downloads": -1,
            "filename": "plexy-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3b0778e069205f79c10c02c4f274bca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 13605,
            "upload_time": "2023-02-10T07:36:41",
            "upload_time_iso_8601": "2023-02-10T07:36:41.704151Z",
            "url": "https://files.pythonhosted.org/packages/04/b7/a10b835339b70815a3922f9bd606907849e5d4f2155ddddacd4e2c35b4c3/plexy-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c870d7bf5b42ced3a45bb9c10873ddab7904afe4eb0861bd836f3f995caf71a1",
                "md5": "518266bf8ab5d175aaba24c97d2d26c2",
                "sha256": "fe08f55508f6bbbfaead0e198a8b1d67c135dbe4711a92fde8652843c7e23fa1"
            },
            "downloads": -1,
            "filename": "plexy-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "518266bf8ab5d175aaba24c97d2d26c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 14698,
            "upload_time": "2023-02-10T07:36:43",
            "upload_time_iso_8601": "2023-02-10T07:36:43.297953Z",
            "url": "https://files.pythonhosted.org/packages/c8/70/d7bf5b42ced3a45bb9c10873ddab7904afe4eb0861bd836f3f995caf71a1/plexy-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-10 07:36:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ratoaq2",
    "github_project": "plexy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "plexy"
}
        
Elapsed time: 0.03999s