mirror of
https://github.com/fergalmoran/meeseeks.git
synced 2025-12-22 09:18:34 +00:00
22 lines
588 B
Python
22 lines
588 B
Python
from plexapi.server import PlexServer
|
|
|
|
from servers.base import _ServerHook
|
|
|
|
# Todo: remove these to settings
|
|
|
|
|
|
class PlexHook(_ServerHook):
|
|
def __init__(self, plex_host, plex_token):
|
|
self._plex = PlexServer(plex_host, plex_token)
|
|
|
|
def find_movie(self, criteria, mediatype='movie'):
|
|
ret = []
|
|
for video in self._plex.search(criteria, mediatype=mediatype):
|
|
print(video)
|
|
ret.append(video)
|
|
return ret
|
|
|
|
def update_library(self, name='Recommended'):
|
|
library = self._plex.library.section(name)
|
|
library.update()
|