sleepyfran / itunespy

:snake: A simple library to fetch data from the iTunes Store API made for Python >= 3.5
MIT License
64 stars 6 forks source link

taking song that not matches the given id #13

Closed JensDeLeersnyderPXL closed 2 years ago

JensDeLeersnyderPXL commented 2 years ago

This is the code I used to search the specific song. I couldn't figure out where the error would be in the itunespy code .

import itunespy

def main():
    #working song
    #broken arrows avici https://music.apple.com/us/album/stories/1440834059
    #id_number = '1440834528'

    #tragic the kid laroy https://music.apple.com/gb/album/tragic-feat-youngboy-never-broke-again-internet-money/1538646756?i=1538647031
    id_number = '1538647031'
    #actiall id itunespy looks up 341728831

    track_info = itunespy.lookup(id=id_number)
    album_info = itunespy.lookup(id=track_info[0].collectionId)

    track = itunespy.search_track('arrows')
    print(track[0].artist_name + ': ' + track[0].track_name + ' | Length: ' + str(
        track[0].get_track_time_minutes()))  # Get info from the first result

if __name__ == '__main__':
    main()
sleepyfran commented 2 years ago

Hey @JensDeLeersnyderPXL, sorry for taking so long to answer, completely missed this. Could you please tell us what the error was and how did you mitigate it?

Thanks for taking the time to report and close it!