feat: config to disable get m3u8 from device

pull/13/head
WorldObservationLog 6 months ago
parent 33b2efd82e
commit b82817c20e
  1. 2
      config.example.toml
  2. 1
      src/config.py
  3. 2
      src/rip.py

@ -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

Loading…
Cancel
Save