Fix index_js_uri

This commit is contained in:
R. M 2023-04-19 22:46:31 -03:00
parent 3a10069c76
commit 254147096a

View File

@ -56,8 +56,8 @@ class Gamdl:
'origin': 'https://beta.music.apple.com',
})
web_page = self.session.get('https://beta.music.apple.com').text
index_js_uri = re.search('(?<=index\.)(.*?)(?=\.js")', web_page).group(1)
index_js_page = self.session.get(f'https://beta.music.apple.com/assets/index.{index_js_uri}.js').text
index_js_uri = re.search(r"/assets/index-legacy-[^/]+\.js", web_page).group(0)
index_js_page = self.session.get(f'https://beta.music.apple.com{index_js_uri}').text
token = re.search('(?=eyJh)(.*?)(?=")', index_js_page).group(1)
self.session.headers.update({"authorization": f'Bearer {token}'})
self.country = self.session.cookies.get_dict()['itua']