diff --git a/docs/configuration.rst b/docs/configuration.rst index e456c5c0..ce9e0747 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -879,6 +879,21 @@ Description Download video files. =========== ===== +extractor.khinsider.format +-------------------------- +=========== ===== +Type ``string`` +Default ``"mp3"`` +Description The name of the preferred file format to download. + + Use ``"all"`` to download all available formats, + or a (comma-separated) list to select multiple formats. + + If the selected format is not available, + the first in the list gets chosen (usually `mp3`). +=========== ===== + + extractor.kissmanga.captcha --------------------------- =========== ===== diff --git a/gallery_dl/extractor/khinsider.py b/gallery_dl/extractor/khinsider.py index 822a7431..2550af24 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, '', '
')[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, '', '
')[0] for num, url in enumerate(text.extract_iter( page, '