summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/khinsider.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2020-07-20 01:03:23 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2020-07-20 01:03:23 -0400
commitba039cfb2e1ba2522ee0a0fa2a84a1a6579e4877 (patch)
tree2e057b8e83968c7ab951b1b60aa16b71682f5414 /gallery_dl/extractor/khinsider.py
parent02dd2886783cd303cff6890a741152d013bb00ce (diff)
New upstream version 1.14.3.upstream/1.14.3
Diffstat (limited to 'gallery_dl/extractor/khinsider.py')
-rw-r--r--gallery_dl/extractor/khinsider.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/gallery_dl/extractor/khinsider.py b/gallery_dl/extractor/khinsider.py
index 822a743..2550af2 100644
--- a/gallery_dl/extractor/khinsider.py
+++ b/gallery_dl/extractor/khinsider.py
@@ -56,12 +56,27 @@ class KhinsiderSoundtrackExtractor(AsynchronousMixin, Extractor):
}}
def tracks(self, page):
- page = text.extract(page, '<table id="songlist">', '</table>')[0]
+ fmt = self.config("format", ("mp3",))
+ if fmt and isinstance(fmt, str):
+ if fmt == "all":
+ fmt = None
+ else:
+ fmt = fmt.lower().split(",")
+ page = text.extract(page, '<table id="songlist">', '</table>')[0]
for num, url in enumerate(text.extract_iter(
page, '<td class="clickable-row"><a href="', '"'), 1):
url = text.urljoin(self.root, url)
page = self.request(url, encoding="utf-8").text
+ track = first = None
- url = text.extract(page, 'style="color: #21363f;" href="', '"')[0]
- yield text.nameext_from_url(url, {"num": num, "url": url})
+ for url in text.extract_iter(
+ page, 'style="color: #21363f;" href="', '"'):
+ track = text.nameext_from_url(url, {"num": num, "url": url})
+ if first is None:
+ first = track
+ if not fmt or track["extension"] in fmt:
+ first = False
+ yield track
+ if first:
+ yield first