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

python lastfm-artists_by_genre_pylast.py not recognising config.ini? #20

Open
mckenna654 opened this issue Dec 26, 2024 · 1 comment
Open

Comments

@mckenna654
Copy link

Hi,

I've downloaded the full directory from your github and configured the config.ini as per the sample file.

I receiving the below error when trying to run python lastfm-artists_by_genre_pylast.py. The config.ini file is in the same directory.

PS C:\Users\jake> python C:\Users\jake\Desktop\lastfm-scraper-master\lastfm-artists_by_genre_pylast.py -g "Hardcore Punk"
Traceback (most recent call last):
  File "C:\Users\jake\Desktop\lastfm-scraper-master\lastfm-artists_by_genre_pylast.py", line 80, in <module>
    main()
  File "C:\Users\jake\Desktop\lastfm-scraper-master\lastfm-artists_by_genre_pylast.py", line 38, in main
    network = lastfmconnect()
  File "C:\Users\jake\Desktop\lastfm-scraper-master\lastfm-artists_by_genre_pylast.py", line 16, in lastfmconnect
    api_key = config["lastfm"]["api_key"]
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\configparser.py", line 965, in __getitem__
    raise KeyError(key)
KeyError: 'lastfm'
PS C:\Users\jake>

Any assistance would be appreciated!

@mckenna654
Copy link
Author

mckenna654 commented Dec 26, 2024

resolved by setting the exact path for config.read, now getting

PS C:\Users\jake> python C:\Users\jake\Desktop\lastfm-scraper-master\lastfm-artists_by_genre_pylast.py -g "Hardcore Punk"
INFO:pylast:auth.getMobileSession
INFO:httpx:HTTP Request: POST https://ws.audioscrobbler.com/2.0/?username=xInhaleExhalex "HTTP/1.1 200 OK"
  0%|                                                                                            | 0/1 [00:00<?, ?it/s]INFO:pylast:tag.getTopArtists
INFO:httpx:HTTP Request: POST https://ws.audioscrobbler.com/2.0/ "HTTP/1.1 200 OK"
ERROR:root:'charmap' codec can't encode characters in position 0-3: character maps to <undefined>
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00,  1.81it/s]
INFO:root:Runtime : 0.90 seconds
PS C:\Users\jake>

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

1 participant