tvdb_api icon indicating copy to clipboard operation
tvdb_api copied to clipboard

Episode ID search

Open Nasjoe opened this issue 11 years ago • 4 comments

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.

Nasjoe avatar Apr 07 '14 16:04 Nasjoe

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 avatar Apr 09 '14 10:04 dbr

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 !

Nasjoe avatar Apr 09 '14 10:04 Nasjoe

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 avatar Apr 13 '14 10:04 dbr

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

dbr avatar May 10 '20 10:05 dbr