celiao / tmdbsimple

A wrapper for The Movie Database API v3.
GNU General Public License v3.0
579 stars 122 forks source link

Get TV year and search by url #64

Closed ghost closed 4 years ago

ghost commented 4 years ago

I am trying to get the first_air_date but I have no luck. Furthermore, how can I search by url (not only the id)?

celiao commented 4 years ago

TV First Air Date Examples

By using tmdbsimple:

import tmdbsimple as tmdb
tmdb.API_KEY = '<your api key>'
BREAKING_BAD = 1396;
first_air_date = tmdb.TV(BREAKING_BAD).info()['first_air_date'];
print("First Air Date =", first_air_date)
First Air Date = 2008-01-20

By URL:

curl --silent "https://api.themoviedb.org/3/tv/1396?api_key=<your api key>" | jq -r '.first_air_date'
2008-01-20

You can install “jq” at https://stedolan.github.io/jq/download/.

Have fun!