I'm working on a small python script that scans through my discogs.com collection (database for vinyl records where one can track their collection) and creates a list of all the songs on each record and saves them in a list.Afterwards, I use the youtube data API to do a search for song title, artist and label to find the video for each song and save the video IDs. With that I can then create a youtube playlist of all the songs in my collection.
My problem is that I reach the quota after searching for around 100 songs. How can I optimize my search so my 10'000 quota is not reached that quickly?
Relevant code snippet:
query = ' - '.join([artist, title, catno])request = youtube.search().list(q=query, part='snippet', maxResults=1)res = request.execute()video_id = res['items'][0]['id']['videoId']