The Movie Database Support

I found this entry:

{'adult': False,
 'backdrop_path': None,
 'genre_ids': ['Drama'],
 'id': 830366,
 'original_language': 'ru',
 'original_title': 'Thoughts in the forest',
 'overview': 'A man comes to an isolated forest to confront his troubled relationship with his girlfriend and brother.',
 'popularity': 0.6,
 'poster_path': '/nM7Gajs2mQxykQdFIE8sj4Md5Vn.jpg',
 'release_date': '2021-05-04',
 'title': 'Thoughts in the forest',
 'video': False,
 'vote_average': 10,
 'vote_count': 1}

where the genre_ids is not an integer. This messes up my code, as I have to keep adding exceptions and checking that the fields are what they are expected to be. Is there a regular maintenance of the MTDB database to guarantee that the fields contain the correct type of data? Thanks

2 svar (på sida 1 av 1)

Jump to last post

That looks like something client side as a number of the values you have in your response are not values that we return on the API. For example:

'adult': False,
'backdrop_path': None,
'genre_ids': ['Drama'],
'video': False,
'vote_average': 10,

We don't return False, None integers for vote_average, or an array of string genres.

Request

curl -v "https://api.themoviedb.org/3/movie/830366?api_key=###"

*   Trying 2600:9000:2044:9e00:c:174a:c400:93a1:443...
* Connected to api.themoviedb.org (2600:9000:2044:9e00:c:174a:c400:93a1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.themoviedb.org
*  start date: Nov 20 00:00:00 2020 GMT
*  expire date: Dec 19 23:59:59 2021 GMT
*  subjectAltName: host "api.themoviedb.org" matched cert's "*.themoviedb.org"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f9691008200)
> GET /3/movie/830366?api_key=### HTTP/2
> Host: api.themoviedb.org
> user-agent: curl/7.76.1
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: application/json;charset=utf-8
< content-length: 758
< date: Thu, 22 Jul 2021 16:23:00 GMT
< server: openresty
< access-control-allow-origin: *
< access-control-allow-methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
< access-control-expose-headers: ETag, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After, Content-Length, Content-Range
< cache-control: public, max-age=28800
< x-memc: HIT
< x-memc-key: 2d3c43ea970f1b3b667efa36f3555e9e9a043fb5
< x-memc-age: 609
< x-memc-expires: 15530
< etag: W/"8f87d3487df903250fcfa1d944cfeafd"
< vary: Accept-Encoding,Accept-Encoding
< x-cache: Miss from cloudfront
< via: 1.1 b90bbd3e21074296bb0c0cac8328de63.cloudfront.net (CloudFront)
< x-amz-cf-pop: YTO50-C2
< x-amz-cf-id: qEJBXVLzNoBUF4NqHAw74lmjKT8Ti_3mdCYqkwhsgISvSLBn6d2ILA==
<
* Connection #0 to host api.themoviedb.org left intact

Response

{
  "adult": false,
  "backdrop_path": null,
  "belongs_to_collection": null,
  "budget": 100,
  "genres": [
    {
      "id": 18,
      "name": "Drama"
    }
  ],
  "homepage": "",
  "id": 830366,
  "imdb_id": "tt14590592",
  "original_language": "ru",
  "original_title": "Thoughts in the forest",
  "overview": "A man comes to an isolated forest to confront his troubled relationship with his girlfriend and brother.",
  "popularity": 0.6,
  "poster_path": "/nM7Gajs2mQxykQdFIE8sj4Md5Vn.jpg",
  "production_companies": [],
  "production_countries": [
    {
      "iso_3166_1": "UA",
      "name": "Ukraine"
    }
  ],
  "release_date": "2021-05-04",
  "revenue": 0,
  "runtime": 11,
  "spoken_languages": [
    {
      "english_name": "Russian",
      "iso_639_1": "ru",
      "name": "Pусский"
    }
  ],
  "status": "Released",
  "tagline": "",
  "title": "Thoughts in the forest",
  "video": false,
  "vote_average": 10.0,
  "vote_count": 1
}

I used the discover movie end:

https://api.themoviedb.org/4/discover/movie?api_key=MYAPIKEY&language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=<ALLPAGES>&with_original_language=ru&with_watch_monetization_types=flatrate

I don't remember the page number, though.

Kan du inte hitta en film eller tv-serie? Logga in för att skapa den.

Globala

s fokus på sökrutan
p öppna profilmenyn
esc stäng ett öppet fönster
? öppna tangentbordsgenväg fönstret

På mediasidor

b gå tillbaka (eller till förälder när det är tillämpligt)
e gå till redigerings sidan

På tv-säsongssidor

(höger pil) gå till nästa säsong
(vänster pil) gå till den föregående säsongen

På tv-avsnittssidor

(höger pil) gå till nästa avsnitt
(vänster pil) gå till föregående avsnitt

På alla bildsidor

a öppna lägg till bild fönstret

På alla redigeringssidor

t öppna översättnings väljaren
ctrl+ s skicka förmulär

På diskussionssidor

n skapa ny diskussion
w växla sedd-status
p växla offentligt/privat
c växla stäng/öppna
a öppna aktivitet
r svara på diskussionen
l gå till det senaste svaret
ctrl+ enter skicka ditt meddelande
(höger pil) nästa sida
(vänster pil) föregående sida

Inställningar

Vill du betygsätta denna artikel eller lägga till den i en lista?

Logga in