Try 30 days of free premium.

User-level API


david wrote 7 years ago: 1

gazza911 wrote:
It's still possible to crash the client if you have enough marked objects - have you considered putting it in paginated format (for example 5000 marked episodes - probably around 0.3MB - per page).

It's around 50 bytes per marked episode, so even if you've watched 10k episodes the response size should still be very manageable.

I think I'll keep designing the endpoints so that they can normally be used without pagination. When we're live and people still want the pagination, I'll add it but make it optional.

srob650 wrote 7 years ago: 1

Here's a little snippet that should scan your Plex library for all watched episodes and then mark them as watched here on TVMaze! It will also mark any unwatched episodes as "acquired" here. Obviously this won't work until the premium features go live, but please note that it is also contingent on pytvmaze being updated. Since the features aren't live yet I haven't actually tested the new code for pytvmaze, but you can see/install the new version here if you want to try. Inevitably it won't work right away and I'll have some bugs to fix :)


gazza911 wrote 7 years ago: 1

srob, I see you've got this line:

episode_id = s[int(season_num)][int(episode_num)].maze_id

I don't think that this will work if the episode is a special as the episode number would always be 0

srob650 wrote 7 years ago: 1

Good point, I hadn't considered specials at all :p

I'd probably just skip specials since they are annoying and handled differently EVERYWHERE. I'll add a couple lines for that for now, and consider putting something together later to actually account for them.


david wrote 7 years ago: 1

FYI, we're live!

srob650 wrote 7 years ago: 1

David,

Great work, thanks so much for making this site even better! All of the new features are now incorporated into pytvmaze :)


david wrote 7 years ago: 1

And thank you for your contributions to the community! :)

srob650 wrote 7 years ago: 1

FYI the current snippet does now work for setting shows from your Plex library as watched or acquired. I'm trying to figure out a way to have it automatically mark an episode when added and when watched in Plex, but it may take a while. Plex documentation is relatively scarce and it seems like the only way to do it might be scraping the Plex logs. Will update if I ever get it working :)


gazza911 wrote 7 years ago: 1

Have you thought about adding an endpoint that has either an empty response, or a true/false value?

It may sound pointless, but the idea would be to query it a single time to make sure that the user's token is correct and that their premium hasn't expired - not an issue now, but would be later on - (before making any further requests).

srob650 wrote 7 years ago: 1

gazza911 wrote:
Have you thought about adding an endpoint that has either an empty response, or a true/false value?
It may sound pointless, but the idea would be to query it a single time to make sure that the user's token is correct and that their premium hasn't expired - not an issue now, but would be later on - (before making any further requests).

I like that idea


gazza911 wrote 7 years ago: 1

And another concern:

If a user authorises a third-party site (by giving the key) to be able to perform actions and then later decides they don't want that site to be able to do that anymore, they have no way of restricting them.

To solve this, you should be able to renew the API key.


david wrote 7 years ago: 1

gazza911 wrote:
And another concern:
If a user authorises a third-party site (by giving the key) to be able to perform actions and then later decides they don't want that site to be able to do that anymore, they have no way of restricting them.
To solve this, you should be able to renew the API key.

That's planned indeed. In the future - if there's enough demand - we might even introduce multiple API keys, so you can give each app a (possibly read-only) key.


david wrote 7 years ago: 1

gazza911 wrote:
Have you thought about adding an endpoint that has either an empty response, or a true/false value?
It may sound pointless, but the idea would be to query it a single time to make sure that the user's token is correct and that their premium hasn't expired - not an issue now, but would be later on - (before making any further requests).

I'll think about it, though you could always just attempt a call to a lightweight endpoint like GET network follows. (If there isn't already another endpoint that you'll want to query at the start of your application anyways).

FYI, you can differentiate between incorrect token and premium expired/missing by a 401 vs 403.

liiight wrote 7 years ago: 1

This looks very nice indeed. Is there an option to get a dev key?


gazza911 wrote 7 years ago: 1

liiight wrote:
This looks very nice indeed. Is there an option to get a dev key?

Not sure what you mean by "dev key" - If you mean buying a subscription that allows you to use the API on any authenticated user, then read this post.


david wrote 7 years ago: 1

Votes (shows and episodes) are added now!


gazza911 wrote 7 years ago: 1

GET /user/votes/episodes

The model states that it returns voted_at, however it doesn't (it only returns it when querying a single episode)


david wrote 7 years ago: 1

gazza911 wrote:
GET /user/votes/episodes
The model states that it returns voted_at, however it doesn't (it only returns it when querying a single episode)

There was an error in the first deployment, but it was fixed almost immediately afterwards. Perhaps clear some caches and try again?

Try 30 days of free premium.