feat: m3u8 download

This commit is contained in:
WorldObservationLog
2024-05-05 05:02:17 +08:00
parent 2d0ea60556
commit 62702df164
5 changed files with 28 additions and 9 deletions

View File

@@ -124,3 +124,8 @@ def get_codec_from_codec_id(codec_id: str) -> str:
if regex.match(CodecRegex.get_pattern_by_codec(codec), codec_id):
return codec
return ""
def get_song_id_from_m3u8(m3u8_url: str) -> str:
parsed_m3u8 = m3u8.load(m3u8_url)
return regex.search(r"_A(\d*)_", parsed_m3u8.playlists[0].uri)[1]