diff --git a/docs/configuration.rst b/docs/configuration.rst index d720f014..2bea9101 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -6833,13 +6833,20 @@ Note extractor.webtoons.bgm ---------------------- Type - ``bool`` + * ``bool`` + * ``string`` Default ``true`` +Example + ``"aac"`` Description Download an episode's `background music` if available. + + If this is a ``string``, remux the downloaded `background music` file + into the given format. Note - Requires |ytdl| + Requires |ytdl| for downloads + and |ffmpeg| for remuxing extractor.webtoons.quality diff --git a/gallery_dl/extractor/webtoons.py b/gallery_dl/extractor/webtoons.py index 92cf6b15..b8fff9b3 100644 --- a/gallery_dl/extractor/webtoons.py +++ b/gallery_dl/extractor/webtoons.py @@ -172,6 +172,12 @@ class WebtoonsEpisodeExtractor(WebtoonsBase, GalleryExtractor): } paths = self.paths + if isinstance(self.bgm, str): + remux = ext = self.bgm.lower() + else: + ext = "mp4" + remux = False + for bgm in bgm_list: url = (f"https://apis.naver.com/audiocweb/audiocplayogwweb/play" f"/audio/{bgm['audioId']}/hls/token") @@ -190,10 +196,11 @@ class WebtoonsEpisodeExtractor(WebtoonsBase, GalleryExtractor): "num_stop": paths.get(stop) or 0, "filename_play": play[play.rfind("/")+1:play.rfind(".")], "filename_stop": stop[stop.rfind("/")+1:stop.rfind(".")], + "extension": ext, "type": "bgm", "url" : "ytdl:" + audio["url"], "_ytdl_manifest": audio["type"].lower(), - "extension": "mp3", + "_ytdl_manifest_remux": remux, })