Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

advanced API search #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

advanced API search #6

wants to merge 8 commits into from

Conversation

jones1008
Copy link

I had a look at the tracks that did not have the popularity stored and determined why they did not match.

Then I defined a query sequence which will be executed one by one and afterwards it checks if it already found the popularity on the deezer API.

defined query sequence:

  1. 'artist:"artist" album:"album" track:"track"'
  2. "artist - album - track"
  3. 'artist:"artist" track:"track"'
  4. "artist - track"

execution part:

  1. This sequence is first executed with the given strings stored in the item
  2. if popularity tag wasn't found with (1.) it searches without brackets in the title field
  3. if popularity tag wasn't found with (2.) it calls the query sequence foreach artist
  4. if popularity tag wasn't found with (3.) it calls the query sequence foreach artist and without brackets in the title field

Also I added a little pause after every 50th api request. More about that here

new ​API request strings (query):
'artist:"artist" album:"album" track:"track"'
"artist - album - track"
'artist:"artist" track:"track"'
"artist - track"
the Deezer API has a request limit (50 requests in 5 seconds).
This commit pauses the script for two seconds every 50th api request.
Makes the script little slower, but it won't run into an error, as described in abba23#5
@jones1008 jones1008 mentioned this pull request Mar 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant