mirror of
https://github.com/WorldObservationLog/AppleMusicDecrypt.git
synced 2026-01-15 14:22:54 -03:00
fix: Update API endpoint and regex for token retrieval
Some checks failed
/ Build Windows Version (push) Has been cancelled
Some checks failed
/ Build Windows Version (push) Has been cancelled
This commit is contained in:
@@ -68,9 +68,9 @@ async def upload_m3u8_to_api(endpoint: str, m3u8_url: str, song_info: Datum):
|
||||
stop=stop_after_attempt(retry_times), before_sleep=before_sleep_log(logger, logging.WARN))
|
||||
async def get_token():
|
||||
async with request_lock:
|
||||
req = await client.get("https://beta.music.apple.com", follow_redirects=True)
|
||||
index_js_uri = regex.findall(r"/assets/index-legacy-[^/]+\.js", req.text)[0]
|
||||
js_req = await client.get("https://beta.music.apple.com" + index_js_uri)
|
||||
req = await client.get("https://music.apple.com", follow_redirects=True)
|
||||
index_js_uri = regex.findall(r"/assets/index-legacy~[^/]+\.js", req.text)[0]
|
||||
js_req = await client.get("https://music.apple.com" + index_js_uri)
|
||||
token = regex.search(r'eyJh([^"]*)', js_req.text)[0]
|
||||
return token
|
||||
|
||||
|
||||
Reference in New Issue
Block a user