Working
This commit is contained in:
parent
460cb51d86
commit
2ff78cfd4a
13
aiphttp_tester.py
Normal file
13
aiphttp_tester.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
from tmdb.tmdb_api import Movie
|
||||||
|
import asyncio
|
||||||
|
import time
|
||||||
|
|
||||||
|
async def test():
|
||||||
|
start = time.time()
|
||||||
|
movie = Movie()
|
||||||
|
await movie.load_parameters()
|
||||||
|
id = await movie.search_title('Breakfast Club')
|
||||||
|
print(time.time() - start)
|
||||||
|
await movie.close_session()
|
||||||
|
|
||||||
|
asyncio.run(test())
|
|
@ -124,10 +124,10 @@ class Movie(TmdbApiSingle):
|
||||||
json = await self.request('search/movie', params=payload)
|
json = await self.request('search/movie', params=payload)
|
||||||
if json['total_results'] > 0:
|
if json['total_results'] > 0:
|
||||||
movie_id = json['results'][0]['id']
|
movie_id = json['results'][0]['id']
|
||||||
#await asyncio.gather(
|
await asyncio.gather(
|
||||||
await self.query_details(movie_id)
|
self.query_details(movie_id),
|
||||||
await self.query_cast(movie_id)
|
self.query_cast(movie_id)
|
||||||
#)
|
)
|
||||||
return movie_id
|
return movie_id
|
||||||
|
|
||||||
async def query_details(self, id):
|
async def query_details(self, id):
|
||||||
|
|
Loading…
Reference in a new issue