Package: plexy
PlexyYour Plex, your wayProject pagehttps://github.com/ratoaq2/plexyInfoPlexyis a command line tool to save your watching preferences in Plex.DubbedorOriginal audio, it's up to you.ForDubbedpreference, 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.ForOriginalpreference, 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 tracksClosed caption and SDH subtitle tracks also have lower priority when selecting subtitlesTo select Brazilian Portuguese language with original audio>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagept-BRoriginalTo select English language with dubbed audio>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languageendubbedTo select French language with original audio only for Game of Thrones>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagefr--title"Game of Thrones"originalTo select German language with dubbed audio only for Mandalorian Season 2>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagefr--title"Mandalorian s02"dubbedTo select German language with dubbed audio only for Game of Thrones, season 3 and episode 9>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagefr--title"Game of Thrones s03e09"dubbedTo select Spanish language with dubbed audio only for all Matrix movies and the first Avatar movie>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagees--title"Matrix"--title"Avatar (2009)"dubbedTo select Portuguese language with original audio for everything added to your libraries in the last week>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagept--newer1woriginalTo select Brazilian Portuguese language with original audio for everything added to your "Movie" library before the last week>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--libraryMovie--languagept-BR--older1woriginalYou 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:>>plexy--urlhttp://mylocalplex:32400--tokenABCDEF1234567890preferences--languagept-BR-AtruehdoriginalAnd print the full summary of changes:>>plexy--urlhttp://mylocalplex:32400--tokenABCDEFGHIJ1234567890preferences-f-len--title"The Matrix (1999)"original
Configuringwatchingpreferences[####################################]  100%1moviechangedoutof1selectedmovie
TheMatrix(1999)changedfrompt-BR:Português(SRTExternal)tonosubtitlesYou can also define your configuration options in ajsonoryamlfile:url:http://myplexserver:32400token:ABCDEFGHIJ1234567890preferences:library:-Movies-TV Showsexcluded_subtitle_codec:-eia_608full_summary:Truelanguage:pt-BRwatching_preference:originalBy default, plexy will loadconfig.json,config.yamlorconfig.ymlfile from the folders:Mac OS:~/Library/Preferences/plexyLinux:~/.config/plexy/Windows:C:\Users\<USER>\AppData\Local\plexy\plexyAnd then update the configuration with data fromplexy.json,plexy.yamlorplexy.ymlin the current working directory.You can pass the configuration to use with the--configparameter:>>plexy--configmyconfig.ymlpreferences
Configuringwatchingpreferences[####################################]  100%1moviechangedoutof1selectedmovie
TheMatrix(1999)changedfrompt-BR:Português(SRTExternal)tonosubtitlesAll available CLI options:>>plexy--url<PLEX_URL>--token<USER_TOKEN>preferences--help
Usage:plexypreferences[OPTIONS]{original|dubbed}YourwatchingpreferencesDubbedprefersanaudiotrackwiththedesiredlanguage.Originalpreferstheoriginalaudioandanadditionalsubtitletrackiftheaudioisnotinthedesiredlanguage.

Options:-L,--libraryTEXTLibrarytobeused.e.g:Movies,Shows.-t,--titleTITLEFilterfortitlesinyourlibrary.Itcouldrefertoamovie,ashow,aseasonoranepisode.e.g:Avatar,TheMatrix(1999),TheBoyss2,Chernobyls01e03,GameofThrones(2011)s03e09-l,--languageLANGUAGEDesiredwatchinglanguageasIETFcode,e.g.:en,pt-BR.-a,--audio-codec[dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]Acceptedaudiocodec.-A,--excluded-audio-codec[dca|aac|ac3|eac3|truehd|flac|mp2|mp3|vorbis|pcm]Excludedaudiocodec.-s,--subtitle-codec[srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]Acceptedsubtitlecodec.-S,--excluded-subtitle-codec[srt|pgs|vobsub|ass|mov_text|eia_608|dvb_subtitle]Excludedsubtitlecodec.-n,--newer-thanAGEFiltermovies/episodesnewerthanAGE,e.g.12h,1w2d-o,--older-thanAGEFiltermovies/episodesolderthanAGE,e.g.12h,1w2d-f,--full-summaryPrintthefullsummaryofchangedpreferences.--skip-watchingSkipmovies/episodesthatwatchisinprogress.--keep-selected-audioDonotchangetheselectedaudio.Usefulwhenusingoriginalwatchingpreference.--keep-selected-subtitleDonotchangetheselectedsubtitle.--force-subtitlesSelectsubtitles,evenwhentheaudioalreadymatchesthedesiredlanguage.--debugPrintusefulinformationfordebuggingandforreportingbugs.--helpShowthismessageandexit.Using Dockerdocker run -it --rm plexy --url http://mylocalplex:32400 --token ABCDEF1234567890 preferences --language pt-BR -A truehd originalInstallationPlexycan be installed as a regular python module by running:$ [sudo] pip install plexyFor a better isolation with your system you should use a dedicated
virtualenv or install for your user only using the--userflag.DependenciesDiaoul/babelfishpkkid/python-plexapiratoaq2/trakit