mirror of
https://github.com/zhaarey/AppleMusicDecrypt.git
synced 2025-10-23 15:11:06 +00:00
feat: config to disable get m3u8 from device
This commit is contained in:
@@ -35,6 +35,8 @@ endpoint = ""
|
|||||||
proxy = ""
|
proxy = ""
|
||||||
# Number of concurrent song downloads
|
# Number of concurrent song downloads
|
||||||
parallelNum = 1
|
parallelNum = 1
|
||||||
|
# Get m3u8 from device
|
||||||
|
getM3u8FromDevice = true
|
||||||
# After enabling this feature, if the specified codec does not exist, the script will look for other codec to download
|
# After enabling this feature, if the specified codec does not exist, the script will look for other codec to download
|
||||||
codecAlternative = true
|
codecAlternative = true
|
||||||
# Priority for script to look for alternative codec
|
# Priority for script to look for alternative codec
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class M3U8Api(BaseModel):
|
|||||||
class Download(BaseModel):
|
class Download(BaseModel):
|
||||||
proxy: str
|
proxy: str
|
||||||
parallelNum: int
|
parallelNum: int
|
||||||
|
getM3u8FromDevice: bool
|
||||||
codecAlternative: bool
|
codecAlternative: bool
|
||||||
codecPriority: list[str]
|
codecPriority: list[str]
|
||||||
atmosConventToM4a: bool
|
atmosConventToM4a: bool
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ async def rip_song(song: Song, auth_params: GlobalAuthParams, codec: str, config
|
|||||||
if not specified_m3u8 and not song_data.attributes.extendedAssetUrls.enhancedHls:
|
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")
|
logger.error(f"Failed to download song: {song_metadata.artist} - {song_metadata.title}. Lossless audio does not exist")
|
||||||
return
|
return
|
||||||
if not specified_m3u8:
|
if not specified_m3u8 and config.download.getM3u8FromDevice:
|
||||||
device_m3u8 = await device.get_m3u8(song.id)
|
device_m3u8 = await device.get_m3u8(song.id)
|
||||||
if device_m3u8:
|
if device_m3u8:
|
||||||
specified_m3u8 = device_m3u8
|
specified_m3u8 = device_m3u8
|
||||||
|
|||||||
Reference in New Issue
Block a user