Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: RE: Getting TypeError: list indices must be intege...

To solve the issue Im doing like below, verifying if the body is not empty, but its not working it appears the same issue. def song_lyric(song_name,artist_name): while True: querystring =...
ozzyk General Coding Help 10 44,996 Nov-29-2017, 11:34 PM
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: RE: Getting TypeError: list indices must be intege...

Thanks again. Do you know why this dont works "if(tracking_url!= "" or body != ""):"? It should not work because print(body) prints blank but I dont understand why.
ozzyk General Coding Help 10 44,996 Nov-29-2017, 11:10 PM
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: RE: Getting TypeError: list indices must be intege...

Thanks again. Maybe you dont get the error because of the "ID > 2: continue", without this condition, with more tracks there will be some track that will give the error. For example if you just ch...
ozzyk General Coding Help 10 44,996 Nov-29-2017, 09:15 PM
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: RE: Getting TypeError: list indices must be intege...

Thanks. I already had that lines commented, so should be other issue.
ozzyk General Coding Help 10 44,996 Nov-29-2017, 06:52 PM
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: RE: Getting TypeError: list indices must be intege...

Thanks for your answer. But that way it works also for firsts tracks but then it appears: ValueError: unknown url type: ''. It seems that it works with: if(tracking_url!= ""): print(tra...
ozzyk General Coding Help 10 44,996 Nov-29-2017, 06:40 PM
    Thread: Getting TypeError: list indices must be integers or slices not str
Post: Getting TypeError: list indices must be integers o...

I want to get the lyrics for each track returned from lastfm api. If i use the method song_lyric() below, that uses the musixmatch api, directy like: song_lyric("(Another Song) All Over Again", "Just...
ozzyk General Coding Help 10 44,996 Nov-29-2017, 01:33 PM
    Thread: ValueError: unknown url type: ' '
Post: RE: ValueError: unknown url type: ' '

Thanks. For a track that gives the error that print returns: {"message":{"header":{"status_code":200,"execute_time":0.0031189918518066}, "body":{"lyrics": {"lyrics_id":2897723, "can_edit":0, "locked...
ozzyk General Coding Help 3 18,283 Nov-26-2017, 04:57 PM
    Thread: ValueError: unknown url type: ' '
Post: ValueError: unknown url type: ' '

I have this code below that iterate through some tracks. And then for each track I want to use the musixmatch api to get and print the lyrics of the track based on the artist name and track name. c...
ozzyk General Coding Help 3 18,283 Nov-26-2017, 04:09 PM
    Thread: can´t store the mbid - `KeyError: 'mbid'`.
Post: RE: can´t store the mbid - `KeyError: 'mbid'`.

Thanks and sorry, I didnt notice that the cause for the error, although it appears the same error information, was the same.
ozzyk General Coding Help 7 4,207 Nov-26-2017, 01:59 AM
    Thread: can´t store the mbid - `KeyError: 'mbid'`.
Post: RE: can´t store the mbid - `KeyError: 'mbid'`.

Thanks, it appears: Traceback (most recent call last): File "C:/Users/Ozzy/PycharmProjects/getData/getData.py", line 110, in <module> mbid = track_data['mbid'] KeyError: 'mbid'
ozzyk General Coding Help 7 4,207 Nov-26-2017, 01:01 AM
    Thread: can´t store the mbid - `KeyError: 'mbid'`.
Post: RE: can´t store the mbid - `KeyError: 'mbid'`.

Sorry, but I didnt understand what is the fill traceback? But the error is here: mbid = track_data['mbid']
ozzyk General Coding Help 7 4,207 Nov-26-2017, 12:55 AM
    Thread: can´t store the mbid - `KeyError: 'mbid'`.
Post: can´t store the mbid - `KeyError: 'mbid'`.

I'm getting the tracks of some albums from lastfm. Then for each track I'm getting some information (title, number, artist, etc). Then, I want also to get the mbid of each track, but here I have an er...
ozzyk General Coding Help 7 4,207 Nov-25-2017, 09:52 PM
    Thread: error getting tracks from albums
Post: RE: error getting tracks from albums

Thanks for your answer. I delete some things that should not be important for the issue and add some comments. The code is basically divided in 3 parts: get information about artists from a specific c...
ozzyk General Coding Help 7 4,572 Nov-22-2017, 03:24 PM
    Thread: error getting tracks from albums
Post: RE: error getting tracks from albums

Thanks, but #chosen = artists[i]['name'].replace(" ", "+") already replace spaces for "+" no? With the code below as you said it is appearing the same error: for i, v in artists.items(): #ch...
ozzyk General Coding Help 7 4,572 Nov-22-2017, 01:44 PM
    Thread: error getting tracks from albums
Post: RE: error getting tracks from albums

The print(album_respose) have this format: {'album': {'name': 'Achtung Baby', 'artist': 'U2', 'mbid': 'a3cb23fc-acd3-4ce0-8f36-1e5aa6a18432', 'listeners': '3390992', 'playcount': '136035640', '...
ozzyk General Coding Help 7 4,572 Nov-22-2017, 12:07 AM
    Thread: error getting tracks from albums
Post: error getting tracks from albums

Im getting the top artists from a sepcific country, albums of that artists and tracks of that albums from lastfm. Im getting the artists and albums without errors but in the tracks it appears: Quote...
ozzyk General Coding Help 7 4,572 Nov-21-2017, 08:21 PM
    Thread: Getting top albums from last.fm
Post: Getting top albums from last.fm

Im getting the top artists from a specific country from lastfm api. Im getting the name of each artist and store in the artists{} with success with: import requests api_key = "0929f1144e...
ozzyk General Coding Help 1 3,015 Nov-19-2017, 06:23 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020