Comments (14)
I copied the wrong api code, it all works fine!
from lyricsgenius.
What happens when you try this?
import lyricsgenius genius = lyricsgenius.Genius("--mykey--") genius.get_artist(29472)Do you get any data in response?
No data but also no TypeError. It just says None.
import lyricsgenius genius = lyricsgenius.Genius("--mykey--") artist = genius.get_artist(29472) print(artist)
Oh it works now. Looks like I'm an idiot who mixed up the client secret and client access token. omg
Anyway, sorry for bothering you with my questions and thank you so much for your help. Really appreciate it!
from lyricsgenius.
Great! Let me know if you run into any other issues.
from lyricsgenius.
from lyricsgenius.
Hi Chris,
If I understand you correctly, something like this might work for you:
# songPairs is a list of song title and artist name pairs
# (e.g. [["I Will", "The Beatles"], ["Begin Again", "Andy Shauf"]])
for pair in songPairs:
song = api.search_song(pair[0], pair[1])
if song:
savename = "Lyrics_{A}_{T}".format(song.title, song.artist)
song.save_lyrics(savename, forma_="txt")
Does that seem like what you want? Let me know if it works for you.
John
from lyricsgenius.
Many thanks Jonn, let me check this out! So far I used the standard 10 hits result and took the first URL.
from lyricsgenius.
Hi Jonn,
I'm quite new to Python and trying to retrieve lyrics from genius.com with your package. Unfortunately, I still keep on receiving the error:
TypeError: 'NoneType' object is not subscriptable
I used the same code as Chris31070 previously posted but it's not working. Can you help me out? Thanks a lot!
from lyricsgenius.
Hi @mrpandastic, what version of the package are you using? If it's not the latest version (1.6.0), try updating with pip
:
pip install -U lyricsgenius
from lyricsgenius.
Hi @mrpandastic, what version of the package are you using? If it's not the latest version (1.6.0), try updating with
pip
:pip install -U lyricsgenius
yes, 1.6.0 is installed
from lyricsgenius.
I don't get the same error when executing the code. What happens if you try in Python:
genius.get_artist(29472)
Do you get a lot of data back? Did you properly set up your API key?
from lyricsgenius.
This is what's in my Jupyter Notebook:
import lyricsgenius
genius = lyricsgenius.Genius("--mykey--")
artist = genius.search_artist("Eminem", max_songs=3, sort="title")`
and this is the error I get:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-47-08dc5616b4a3> in <module>
2
3 genius = lyricsgenius.Genius("--mykey--")
----> 4 artist = genius.search_artist("Eminem", max_songs=3, sort="title")
~\AppData\Roaming\Python\Python37\site-packages\lyricsgenius\api.py in search_artist(self, artist_name, max_songs, sort, per_page, get_full_info, allow_name_change, artist_id)
294
295 artist_info = self.get_artist(artist_id)
--> 296 found_name = artist_info['artist']['name']
297 if found_name != artist_name and allow_name_change:
298 if self.verbose:
TypeError: 'NoneType' object is not subscriptable
from lyricsgenius.
What happens when you try this?
import lyricsgenius
genius = lyricsgenius.Genius("--mykey--")
genius.get_artist(29472)
Do you get any data in response?
from lyricsgenius.
What happens when you try this?
import lyricsgenius genius = lyricsgenius.Genius("--mykey--") genius.get_artist(29472)Do you get any data in response?
No data but also no TypeError. It just says None.
import lyricsgenius genius = lyricsgenius.Genius("--mykey--") artist = genius.get_artist(29472) print(artist)
from lyricsgenius.
from lyricsgenius.
Related Issues (20)
- add per_page parameter to song_annotations
- Get random songs from artist
- Is this library abandoned completely? HOT 5
- 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
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.