feat: use device to get m3u8

This commit is contained in:
WorldObservationLog
2024-05-28 15:54:37 +08:00
parent b79686f90e
commit 0d01836d1e
4 changed files with 52 additions and 1 deletions

View File

@@ -69,6 +69,11 @@ async def rip_song(song: Song, auth_params: GlobalAuthParams, codec: str, config
if not specified_m3u8 and not song_data.attributes.extendedAssetUrls.enhancedHls:
logger.error(f"Failed to download song: {song_metadata.artist} - {song_metadata.title}. Lossless audio does not exist")
return
if not specified_m3u8:
device_m3u8 = await device.get_m3u8(song.id)
if device_m3u8:
specified_m3u8 = device_m3u8
logger.info(f"Use m3u8 from device for song: {song_metadata.artist} - {song_metadata.title}")
if specified_m3u8:
song_uri, keys, codec_id = await extract_media(specified_m3u8, codec, song_metadata,
config.download.codecPriority,