Conversation
* Add ability to simply use plex token for authentication * Add plex_media_title attribute for optimized version titles * Add plex_stream_optimized attribute for indicating optimized version * Create an entry for all media versions (including original and optimized) * Fix extra '.' before file extension when using original_filename
flexget/plugins/input/plex.py
Outdated
| if config['username'] and config['password']: | ||
| if config['token']: | ||
| accesstoken = config['token'] | ||
| log.debug("Using accesstoken: %s" % accesstoken) |
There was a problem hiding this comment.
Pass it as argument instead of doing the string formatting explicitly. Code seems fine otherwise.
There was a problem hiding this comment.
I don't follow. Are you referring to the debug line? I literally just copied line 161, and I can't seem to find any other style for logging in the project.
There was a problem hiding this comment.
It should be log.debug("Using accesstoken: %s", accesstoken) instead of log.debug("Using accesstoken: %s" % accesstoken).
|
Are username and password never used if the token is specified? If so, you might as well change the schema to not accept username + password and token. |
|
Yes, the only use of the username + password is to get a token from the Plex.tv API. In my setup, I didn't want to depend on internet connectivity, just local network to my Plex server. I'm looking into how to prevent username + password and token in the schema. |
|
I think this is what you're looking for: https://github.com/Flexget/Flexget/blob/develop/flexget/plugins/notifiers/join.py#L56-L60 |
|
It's a bit different here. You actually don't have to supply a token or username/password if you're Plex server is set up to allow unauthenticated access from you (usually for localhost or local network). So we need something that is either username + password or token or neither. |
|
Maybe something like this then: https://github.com/Flexget/Flexget/blob/develop/flexget/plugins/notifiers/pushbullet.py#L50-L56 |
|
While you're improving the schema, you should add a bilateral dependency between username and password. |
|
Aha! I wanted to do that but couldn't figure out a clean way. It's been so long since I've messed with the JSON schema. |
|
Is it ready then? Seems fine to me |
|
Should be, everything works fine for me. |
|
Shall I merge than? I figure you shouldn't merge your own PRs. |
Motivation for changes:
Plex doesn't support sync between servers and I wanted the ability to use Flexget to download optimized videos from my Plex server to my WD My Wireless Passport Pro. I added in a bit of functionality to support my needs, but it could be useful to others.
Detailed changes:
.before file extensionplex_ep_name,plex_year,plex_added,plex_media_title, andplex_stream_optimizedentry fieldsAddressed issues:
None
Config usage if relevant (new plugin or updated schema):
Log and/or tests output (preferably both):
Full log isn't really necessary, you get the same basic output. Here's a resulting entry: