From 3f07e1ab7dcebf043a91adc88c628f29bb29533a Mon Sep 17 00:00:00 2001 From: zhaarey <157944548+zhaarey@users.noreply.github.com> Date: Sun, 5 May 2024 19:20:11 +0800 Subject: [PATCH] Update rip.py --- src/rip.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rip.py b/src/rip.py index 297c37a..0894f15 100644 --- a/src/rip.py +++ b/src/rip.py @@ -35,8 +35,10 @@ async def rip_song(song: Song, auth_params: GlobalAuthParams, codec: str, config params = ( ('songid', song.id), ) - song_data.attributes.extendedAssetUrls.enhancedHls = httpx.get(config.download.check, params=params).text - logger.info("Find m3u8 from API") + m3u8_url = httpx.get(config.download.check, params=params).text + if "m3u8" in m3u8_url: + song_data.attributes.extendedAssetUrls.enhancedHls = m3u8_url + logger.info("Find m3u8 from API") if specified_m3u8: song_uri, keys = await extract_media(specified_m3u8, codec, song_metadata, config.download.codecPriority, config.download.codecAlternative)