Skip to content

Commit

Permalink
Update movie_list.py
Browse files Browse the repository at this point in the history
Dealing with rate limiting
  • Loading branch information
johnjoo1 authored Dec 11, 2018
1 parent 82611c8 commit df24c4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data/movie_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
top1000_movies=[]
print('Pulling movie list, Please wait...')
for i in range(1,51):
if i%15==0:
if i%10==0:
time.sleep(7)
movies_on_this_page=all_movies.popular(page=i)['results']
top1000_movies.extend(movies_on_this_page)
Expand Down Expand Up @@ -38,7 +38,7 @@
print('Pulling movies for genre ID '+str(g_id))
baseyear -= 1
for page in range(1,6,1): # (1,6,1)
time.sleep(0.5)
time.sleep(1)

url = 'https://api.themoviedb.org/3/discover/movie?api_key=' + api_key
url += '&language=en-US&sort_by=popularity.desc&year=' + str(baseyear)
Expand Down

0 comments on commit df24c4f

Please sign in to comment.