Closed rajil closed 4 years ago
tl;dr: line 3 of your example code should be: result = server.movies_sync
I wanted to use this api in a project that was already using asyncio, so by default most calls use async.
The docs aren't the best, but: https://embypy.readthedocs.io/en/latest/embypy.html#embypy.Emby.movies
This function is a coroutine. append `_sync` to run outside of an event loop
I am considering making the async/sync stuff a constructor parameter, but I haven't really been working on this project recently.
Thanks with server.movies_sync, I get the following error,
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('http://myemby:8096/Users/me/Items?format=json&Recursive=true&IncludeItemTypes=Movie&Fields=Path,ParentId,Overview,Genres,Tags&SortBy=SortName&SortOrder=Ascending&api_key=000&deviceId=script')
So, this library is a really basic wrapper around emby/jellyfin's API. There is quite a bit missing (like error reporting/passing). To debug this, try just putting that URL into a browser and see what it returns (http://myemby:8096/Users/me/Items?format=json&Recursive=true&IncludeItemTypes=Movie&Fields=Path,ParentId,Overview,Genres,Tags&SortBy=SortName&SortOrder=Ascending&api_key=000&deviceId=script
)
Can you post a basic example how to fetch a movie list?
I tried the following but it gave an error:
My intention is to modify Tags of the movies.