Assistance de TMDB

Hi,

I can't seem to find how to get the next episode for the show. For example Arrow (ID: 1412),

How do I get this data via API: Next Episode: The Secret Origin of Felicity Smoak (season 3, episode 5) airs tomorrow!

Thanks.

3 réponses (sur la page 1 sur 1)

Jump to last post

Hi Rejanu,

While it's true we don't provide a specific field for this, getting this info from API should be pretty easy.

Similar to what we're doing on the website, you could first check the status of a TV show, and if it's not "Canceled" or "Ended", check the last season and calculate the next episode to air based on the current time and date. Right now, you could get this with 2 requests:

https://api.themoviedb.org/3/tv/57243?api_key=###
https://api.themoviedb.org/3/tv/57243/season/8?api_key=###

With the season details pulled down, you can calculate the offset and figure out that episode 12 is next.

What if a season is over? it would take more than a week to the next episode, there we cannot calculate the next episode date, or is there something i'm missing? sorry if i'm asking some nonsense.

Hi.

I am newcomer here and also not sure if this is what you are asking, but if you know the season and the episode that are currently out, then

1) Call the https://api.themoviedb.org/3/tv/57243?api_key=### . 2) Take the required (i.e. the one that has a relevant season number) season json from the responseJson['seasons'] 3) Compare the requiredSeasonJson['episode_count'] with the episode that is currently out. If they match, then the season has finished.

Hopefully that helps :)

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion