Comments (6)
Ah, thanks for catching this bug! I think the fix is as changing self.artist
to self.name
. I'll try to make the fix and update the code tonight.
from lyricsgenius.
Hi, something appears being off still. Minimal script is failing:
import lyricsgenius as genius
access_token = 'XXXX'
api = genius.Genius(access_token)
artist = api.search_artist("The Beatles", max_songs=3)
artist.save_lyrics(format_='json', filename='out.json')
.\python\lyrics>py -3 ./genius.py
Searching for songs by The Beatles...
Song 1: "12-Bar Original"
Song 2: "1822!"
"1 [Booklet]" is not valid. Skipping.
"20 Greatest Hits - Art and Tracklist" is not valid. Skipping.
Song 3: ""Abbey Road" side two"
Reached user-specified song limit (3).
Done. Found 3 songs.
Traceback (most recent call last):
File "./genius.py", line 19, in
artist.save_lyrics(format_='json', filename='out.json')
File "C:\Python3\lib\site-packages\lyricsgenius\artist.py", line 129, in save_lyrics
lyrics_to_write['songs'][-1]['album'] = song.album
File "C:\Python3\lib\site-packages\lyricsgenius\song.py", line 45, in album
if 'album' in self._body and 'name' in self._body['album']:
TypeError: argument of type 'NoneType' is not iterable
.\python\lyrics>py -3 --version
Python 3.6.2
from lyricsgenius.
Shoot, okay. I'll try to take another look in the next couple of days. Thanks for following up.
from lyricsgenius.
@robot3498712 hopefully #75 fixes this bug for you. I was using a sloppy method of accessing elements within the Song object's self._body dictionary, causing an error when the requested field wasn't present in the dict. Let me know if you do run into any more bugs!
from lyricsgenius.
@johnwmillr Thank you, I can confirm issue is fixed. Cheers!
from lyricsgenius.
Hopefully that small change fixes the bug! I had written a test for Artist.save_lyrics
, but the test supplies a filename to the function; this bug only shows up when the user doesn't pass a filename in.
from lyricsgenius.
Related Issues (20)
- All download/progress lost, when crashing while running the genius.search_artist()-Function. HOT 1
- Feature request: add a path option to the genius.save_lyrics()-function HOT 2
- Request timed out during API call for songs of an artist
- Doc clarification search_artist vs artist_songs HOT 1
- Lyrics returned is buggy and includes ads? HOT 4
- how to get the genre of a song? HOT 2
- Reduce Verbosity HOT 1
- Add option to get metadata of desired track HOT 9
- Doesn't return any matching songs HOT 2
- Regex for excluded_terms HOT 1
- Enforce rate limiting HOT 1
- R.E.M. returns Changing artist name to 'Don Toliver' HOT 2
- Lyrics have unwanted data returned with them HOT 1
- genius.lyrics is returning unwanted data in requests
- Lyrics search returns random page
- Total error [Errno 403] 403 Client Error: Forbidden for url HOT 3
- Tests failing HOT 3
- Step by step setup with "403 Client Error" HOT 3
- Genre query early stopping
- Is there a way to fetch the translations of a song ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lyricsgenius.