mirror of
https://github.com/glomatico/gamdl.git
synced 2026-06-14 04:35:23 +03:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82e3cf20a0 | |||
| bc4cdd181c | |||
| dec4a22208 | |||
| b48dbeff8e | |||
| 34a397eb18 | |||
| 2c3abfd352 | |||
| 1fc708177c |
+1
-1
@@ -1 +1 @@
|
||||
__version__ = "3.5"
|
||||
__version__ = "3.5.2"
|
||||
|
||||
@@ -518,13 +518,11 @@ class AppleMusicApi:
|
||||
else:
|
||||
limit = None
|
||||
|
||||
offset = int(next_params["offset"][0])
|
||||
|
||||
extended_data = await self._amp_request(
|
||||
urlparse(next_uri).path,
|
||||
{
|
||||
"offset": offset,
|
||||
**({"limit": limit} if limit else {}),
|
||||
**{k: v for k, v in next_params.items() if k not in ["limit"]},
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class CustomOutputWriter:
|
||||
self.streams = streams
|
||||
|
||||
def add_file(self, path: str):
|
||||
file_stream = open(path, "a")
|
||||
file_stream = open(path, "a", encoding="utf-8")
|
||||
atexit.register(file_stream.close)
|
||||
self.streams.append(file_stream)
|
||||
|
||||
|
||||
@@ -64,6 +64,8 @@ class AppleMusicMusicVideoInterface:
|
||||
self,
|
||||
itunes_page_metadata: dict,
|
||||
) -> str | None:
|
||||
log = logger.bind(action="get_m3u8_master_url_from_itunes_page_metadata")
|
||||
|
||||
stream_url = itunes_page_metadata["offers"][0]["assets"][0].get("hlsUrl")
|
||||
if not stream_url:
|
||||
return None
|
||||
@@ -76,6 +78,16 @@ class AppleMusicMusicVideoInterface:
|
||||
query=urllib.parse.urlencode(query, doseq=True)
|
||||
).geturl()
|
||||
|
||||
m3u8_master_url = m3u8_master_url.replace(
|
||||
"play-edge.itunes.apple.com",
|
||||
"play.itunes.apple.com",
|
||||
).replace(
|
||||
"MZPlayLocal.woa",
|
||||
"MZPlay.woa",
|
||||
)
|
||||
|
||||
log.debug("success", m3u8_master_url=m3u8_master_url)
|
||||
|
||||
return m3u8_master_url
|
||||
|
||||
async def get_tags(
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "gamdl"
|
||||
version = "3.5"
|
||||
version = "3.5.2"
|
||||
description = "A command-line app for downloading Apple Music songs, music videos and post videos."
|
||||
readme = "README.md"
|
||||
license = "MIT"
|
||||
|
||||
Reference in New Issue
Block a user