We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit fe83fa43 authored by clint's avatar clint

fix bug #26342: & instead of & when importing from last.fm

parent a106d846
......@@ -11,7 +11,7 @@ sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout)
def parse_page(page):
"""Parse a page of recently listened tracks and return a list."""
soup = BeautifulSoup(urllib2.urlopen(page))
soup = BeautifulSoup(urllib2.urlopen(page), convertEntities=BeautifulSoup.HTML_ENTITIES)
for row in soup.find('table', 'candyStriped tracklist').findAll('tr'):
artist, track, timestamp = parse_track(row)
# Tracks submitted before 2005 have no timestamp
......@@ -37,7 +37,7 @@ 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
soup = BeautifulSoup(urllib2.urlopen(url))
soup = BeautifulSoup(urllib2.urlopen(url), convertEntities=BeautifulSoup.HTML_ENTITIES)
num_pages = int(soup.find('a', 'lastpage').contents[0])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment