From a204bf860fb09c773d6e43e16eb52bf559a559c4 Mon Sep 17 00:00:00 2001 From: obskyr Date: Tue, 12 Apr 2022 23:06:17 +0200 Subject: [PATCH] Adapted to new HTML for album images. --- khinsider.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/khinsider.py b/khinsider.py index 6442619..4090170 100644 --- a/khinsider.py +++ b/khinsider.py @@ -319,9 +319,15 @@ class Soundtrack(object): @lazyProperty def images(self): - anchors = [a for a in self._contentSoup('p')[1]('a') if a.find('img')] + table = self._contentSoup.find('table') + if not table: + # Currently, the table is always present, but if it's ever removed + # for imageless albums, it should be handled gracefully. + return [] + anchors = [a for a in table('a') if a.find('img')] urls = [a['href'] for a in anchors] images = [File(urljoin(self.url, url)) for url in urls] + print(images) return images def download(self, path='', makeDirs=True, formatOrder=None, verbose=False):