From 90ea90cf37d29fe4d9128dc3e1bd08e66610e590 Mon Sep 17 00:00:00 2001 From: boyska Date: Sun, 7 Aug 2016 15:20:03 +0200 Subject: [PATCH] artist mode functional (?) --- bandcavall/main.py | 2 ++ bandcavall/visit.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bandcavall/main.py b/bandcavall/main.py index 46da311..c149008 100644 --- a/bandcavall/main.py +++ b/bandcavall/main.py @@ -45,6 +45,8 @@ def get_mode(url): return 'track' if path.startswith('/album/'): return 'album' + if path == '/': + return 'artist' raise ValueError('unsupported url: "{}"'.format(path)) diff --git a/bandcavall/visit.py b/bandcavall/visit.py index d62d242..990ac88 100644 --- a/bandcavall/visit.py +++ b/bandcavall/visit.py @@ -42,7 +42,7 @@ def visit_artist(b, url): b.find_by_css('.square a') if link['href'] and '/album/' in link['href']] nonalbumtrack_urls = [link['href'] for link in - b.find_by_css('.square a') + b.find_by_css('.track_row_view a') if link['href'] and '/track/' in link['href']] log.debug('Found %d album + %d non-album tracks' % (len(album_urls), len(nonalbumtrack_urls)