Deal with incorrect username.
Showing with 4 additions and 0 deletions
We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.
|...||...||@@ -38,6 +38,10 @@ def parse_track(row):|
|def fetch_tracks(user, request_delay=0.5):|
|"""Fetch all tracks from a profile page and return a list."""|
|url = 'http://last.fm/user/%s/tracks' % user|
|f = urllib2.urlopen(url)|
|raise Exception("Username probably does not exist.")|
|soup = BeautifulSoup(urllib2.urlopen(url),|
git.gnu.io is graciously hosted by the Free Software Foundation. https://donate.fsf.org