Guest User

Untitled

a guest
Feb 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. def get_id(year):
  2. search_query = "{0} {1}".format(random.choice(
  3. 'abcdefghijklmnopqrstuvwxyz'),
  4. year
  5. )
  6. results = sp.search(search_query, type='track', limit=1, offset=random.randint(1, 100)
  7. )
  8. ids = [i['id'] for i in results['tracks']['items']]
  9. return ids
Add Comment
Please, Sign In to add comment