Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Episode ID search #44

Open
Nasjoe opened this issue Apr 7, 2014 · 4 comments
Open

Episode ID search #44

Nasjoe opened this issue Apr 7, 2014 · 4 comments

Comments

@Nasjoe
Copy link

Nasjoe commented Apr 7, 2014

Hi !
Thanks for you API, it fantastic :)
I would know if it's possible to search an episode with his own TV ID ?

Thks !
Slaan.

@dbr
Copy link
Owner

dbr commented Apr 9, 2014

Glad you find it useful!

Do you mean looking it up by the TVDB ID number? If so, you just pass it as an integer instead of the show name string:

>>> import tvdb_api
>>> t = tvdb_api.Tvdb()
>>> t[76156]
<Show Scrubs (containing 10 seasons)>

Bear in mind you typically get back a string from the API, so you might have to convert it like so:

>>> sid = t['scrubs']['id']
>>> sid
u'76156'
>>> t[int(sid)]
<Show Scrubs (containing 10 seasons)>

Closing - feel free to reopen if I misinterpreted!

@dbr dbr closed this as completed Apr 9, 2014
@Nasjoe
Copy link
Author

Nasjoe commented Apr 9, 2014

Hi !
No, i talk about the episode ID.
On the adress of TVDB, we have for exemple :
http://thetvdb.com/?tab=episode&seriesid=121361&seasonid=568657&id=4721938&lid=17

The 4721938 is the episode ID (GoT S04E01)

With your api, we can get it with :
t[121361][4][1]['id']

It is possible to search directly with this number ?
Many thanks !

@dbr
Copy link
Owner

dbr commented Apr 13, 2014

Ahh, I see what you mean.

Nope, this currently isn't exposed by tvdb_api - currently it only gets data via the /series/ thing, not /episode/, http://thetvdb.com/wiki/index.php/Programmers_API#File_Structure

@dbr dbr reopened this Apr 13, 2014
@dbr
Copy link
Owner

dbr commented May 10, 2020

This is still valid with the new API, there is a /episodes/{id} endpoint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants