Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyitunes.ServiceException: Error: #28

Open
Priyansh2 opened this issue Dec 8, 2018 · 2 comments
Open

pyitunes.ServiceException: Error: #28

Priyansh2 opened this issue Dec 8, 2018 · 2 comments

Comments

@Priyansh2
Copy link

Is there any limit to number of search queries (items = itunes.search(query=song_name)) made with itunes api as i am getting this error after processing for songs greater than 47 in a row.
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "itunes/__init__.py", line 677, in search offset=offset, order=order, country=store).get() File "itunes/__init__.py", line 149, in get self._json_results = self._request(cacheable=is_caching_enabled()) File "itunes/__init__.py", line 140, in _request return _Request(method_name, params).execute(cacheable) File "itunes/__init__.py", line 96, in execute raise self._get_error(e.fp.read()) pyitunes.ServiceException: Error:
Once i get this error, it throws back same unexpectedly on any other further made query.
What is the real issue behind this and how to avoid this (if possible) ?

@ocelma
Copy link
Owner

ocelma commented Dec 11, 2018

Hi

can you provide a more complete example?
It's difficult to reproduce it with just your example above.
Thanks

@Priyansh2
Copy link
Author

@ocelma Sure. First of all I changed the ISO code according to my country (India) which is "IN" and then install the api as given in the instructions. The reason for doing this is , may be it would give better results if i set the store to "IN" rather than default i,e. "US" as i want only Indian songs to be retrieved but not any foreign song.

I have a file in which i have information regarding a 'name of song' and its 'movie name' in which occurs and the 'year' of the movie. I took only song_name as query for each song and then search it using itune.search method.

The objective is to retrieve genre_information using get_genre() method of api.
If i search for only query it gives me the answer but if i do for 45 (randomly chosen batch number) such queries in a row (under a for loop of length 45) it gave me above error. Now if I again process it with lets say 40 queries it works without giving the error but many songs haven't received their genre but if i search for one song at a time it gave me the genre for some songs and not for others (may be due to absence of song information in the database).

For example, consider the file retrieve from here. According to this website all the songs were of "indian rock music" genre.

This file contains 2 columns :- song_info (left side) and genre (right side). These genres were retrieved from itunes_api in a batch of 40 files at time. "no_genre" is given by me for those who didn't get searched by itunes.search method. Evert left hand side entry is of format :- 'year_movie_song.txt' , where year :- movie year , movie :- movie name , song :- song name .

Problem :- When i process them all in a row then error occurs.
When i process them in a batch of 40 then no error occurs but many songs didn't got their genre which i verify by running itune.search() at a time for some songs like say song number 2 (1989_Guru_I Am A Bad Girl.txt ). This song has genre "Bollywood" when search alone but when in batch of 40 it don't receive any genre and hence "no_genre". There can be many such songs.

Hope this helps. If u need any more information please ask me as your response to this issue is much valuable to me. I choose this api as i found no other which provide me the genre_info of Indian songs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants