Skip to content

Commit f956e09

Browse files
author
AuroreM
committed
Recherche par popularité
1 parent 5fc4267 commit f956e09

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

basicSearch.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import tmdbsimple as tmdb
22
import sys
3+
import json
34

45
tmdb.API_KEY = '1a3f1b0a8620851f42d4b1a95494d44d'
56

@@ -16,6 +17,16 @@
1617
"""
1718

1819
discover = tmdb.Discover()
19-
response = discover.movie(year=2015, sort_by = "vote_average.asc")
20-
for r in discover.results:
21-
print(r['title'], r['vote_average'], r['release_date'], r['popularity'])
20+
responseByPop = discover.movie(sort_by = 'popularity.desc')
21+
responseByPop = json.dumps(responseByPop)
22+
print(responseByPop)
23+
#for r in discover.results:
24+
# print(r['title'], r['popularity'])
25+
26+
"""
27+
#La query est toujours obligatoire et se fait sur le titre
28+
search = tmdb.Search()
29+
response = search.movie(query = "action", year = 2015)
30+
for s in search.results:
31+
print(s['title'], s['id'], s['release_date'], s['popularity'])
32+
"""

0 commit comments

Comments
 (0)