11"""plexdl CLI."""
22
33import datetime
4- import logging
54import sys
65
76import humanize
1514
1615from plexdl .plexdl import Client
1716
18-
19- def get_logger (ctx , param , value ):
20- """Get logger and return verbosity value."""
21- logging .basicConfig (format = "%(message)s" )
22- log = logging .getLogger ("plexdl" )
23- if value > 0 :
24- log .setLevel ("DEBUG" ) # https://docs.python.org/3.9/library/logging.html#logging-levels
25- return value
26-
27-
28- app = typer .Typer (help = __doc__ , context_settings = {"max_content_width" : 9999 })
17+ app = typer .Typer (
18+ context_settings = {"max_content_width" : 9999 },
19+ help = __doc__ ,
20+ pretty_exceptions_enable = False ,
21+ )
2922
3023
3124@app .command ()
3225def get_server_info (
3326 username : str = typer .Argument (None , envvar = "PLEXDL_USERNAME" ),
3427 password : str = typer .Argument (None , envvar = "PLEXDL_PASSWORD" ),
35- debug : bool = typer .Argument (False , envvar = "PLEXDL_DEBUG" ),
3628):
3729 """Show info about servers available to your account."""
3830 p = MyPlexAccount (
@@ -63,7 +55,6 @@ def get_server_info(
6355 print (f" httpsRequired: { server .httpsRequired } " )
6456 print (f" name: { server .name } " )
6557 print (f" owned: { server .owned } " )
66- print (f" ownerid: { server .ownerid } " )
6758 print (f" platform: { server .platform } " )
6859 print (f" platformVersion: { server .platformVersion } " )
6960 print (f" presence: { server .presence } " )
@@ -73,7 +64,7 @@ def get_server_info(
7364 print (f" publicAddressMatches: { server .publicAddressMatches } " )
7465 print (f" sourceTitle: { server .sourceTitle } " )
7566 print (f" synced: { server .synced } " )
76- print ("" )
67+ print ()
7768
7869
7970@app .command ()
@@ -86,7 +77,6 @@ def search(
8677 show_ratings : bool = typer .Option (False , "--show-ratings" , help = "Show ratings for each result" ),
8778 show_metadata : bool = typer .Option (False , "--show-metadata" , help = "Show file and codec metadata for each file in each result" ),
8879 include_relays : bool = typer .Option (False , "--include-relays" , help = "Output relay servers along with direct servers" ),
89- verbose : bool = typer .Option (False , "--verbose" , "-v" ),
9080 debug : bool = typer .Option (False , "--debug" ),
9181):
9282 """Search for media in servers that are available to your account."""
0 commit comments