API V2 episode page 404

A place for developers to advertise their TheTVDB.com enabled app and get help from other developers with the API.
tripmckay
Posts: 30
Joined: Sat Jan 07, 2012 11:40 am

API V2 episode page 404

Postby tripmckay » Wed Jun 14, 2017 3:59 am

Hi,

using the API V2 to get episodes for MasterChef Australia.

The page 1 through 6 links object indicates there are 7 pages total, for example for page 6:

Code: Select all

  "links": {
    "first": 1,
    "last": 7,
    "next": 7,
    "prev": 5
  }


But when trying to get page 7 the API returns HTTP 404:

Code: Select all

--> GET https://api.thetvdb.com/series/92091/episodes?page=7 http/1.1
Accept-Language: en
--> END GET
<-- 404 Not Found https://api.thetvdb.com/series/92091/episodes?page=7 (334ms)
Date: Wed, 14 Jun 2017 08:44:54 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dae439f4aeca3ee06940756065fa19ee11497429894; expires=Thu, 14-Jun-18 08:44:54 GMT; path=/; domain=.thetvdb.com; HttpOnly
Cache-Control: private, max-age=600
Vary: Accept-Language
X-Powered-By: Thundar!
X-Thetvdb-Api-Version: 2.1.2
Server: cloudflare-nginx
CF-RAY: 36ec02a9ab3163d3-FRA

{
  "Error": "No results for your query: map[tve.seriesId:92091]"
}


A related issue: if the show has no episodes (like Star Trek: Discovery), the API also returns HTTP 404:

Code: Select all

<-- 404 Not Found https://api.thetvdb.com/series/328711/episodes?page=0 (2452ms)
Date: Wed, 14 Jun 2017 08:52:44 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d48ddf6d9976014e5d1bc1a31d5052c211497430363; expires=Thu, 14-Jun-18 08:52:43 GMT; path=/; domain=.thetvdb.com; HttpOnly
Cache-Control: private, max-age=600
Vary: Accept-Language
X-Powered-By: Thundar!
X-Thetvdb-Api-Version: 2.1.2
Server: cloudflare-nginx
CF-RAY: 36ec0e1dad062384-FRA

{
  "Error": "No results for your query: map[tve.seriesId:328711]"
}


In both cases I would expect a HTTP 2xx response that contains an empty list. Otherwise it is hard to differentiate to actually 404 not found (the show does not exist).

Uwe

tripmckay
Posts: 30
Joined: Sat Jan 07, 2012 11:40 am

Re: API V2 episode page 404

Postby tripmckay » Wed Jun 21, 2017 8:39 am

According to user feedback and repeating above tests it looks like the issue has been resolved, great!

Uwe

tripmckay
Posts: 30
Joined: Sat Jan 07, 2012 11:40 am

Re: API V2 episode page 404

Postby tripmckay » Thu Oct 26, 2017 7:53 am

This issue where the last page returns an error and HTTP 404 is currently happening again (since 2017-10-22). Here page 30 for 70366 is missing, despite the API saying it is the last one:

Code: Select all

--> GET https://api.thetvdb.com/series/70366/episodes?page=30 http/1.1
Accept-Language: en
--> END GET
<-- 404 Not Found https://api.thetvdb.com/series/70366/episodes?page=30 (804ms)
Date: Thu, 26 Oct 2017 12:45:51 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d2c844be79fd1a650362b990f2532435d1509021950; expires=Fri, 26-Oct-18 12:45:50 GMT; path=/; domain=.thetvdb.com; HttpOnly
Cache-Control: private, max-age=600
Vary: Accept-Language
X-Powered-By: Thundar!
X-Thetvdb-Api-Version: 2.1.2
Server: cloudflare-nginx
CF-RAY: 3b3d83d6de326361-FRA

{
  "Error": "No results for your query: map[tve.seriesId:70366]"
}
<-- END HTTP (67-byte body)


Uwe