Possible Noob question RE Tokens etc.



I've read alot (of what little is available) on the plexapi, plugin dev, etc, token thread in this forum, etc.

So i'm making a plugin/channel that will use MakeMKV to rip movies to specified media repositories. I really only need the API to get the repositories, as ripping will always be to the local server. With the addition of tokens, I've gotten confused. So each user for each device will need a token to use my plugin? If my plugin is already running on the local server, why wouldn't it already have access to the information?

If I need to make my user login, or give me login info at least once if not more to at least get the token they need, how do we go about that in a best practice manner? Do we really expect all users to browse the filesystem and edit a JSON preferences file, etc? I'd like to make this pretty stupid proof so non techie people can easily rip their blu rays and DVD's into plex.

Please help me understand!



The way I'm doing it is the first time my script is ran, I provide username and password for plex. Form that it generates a plex token and from then on, it uses that token. If that token ever invalidates, then it will automatically generate a new token. You can get an idea of how I'm doing it here: https://github.com/calebcall/plex_scripts/blob/master/plex_token.py