search,
)
+YT_DOMAIN = "https://www.youtube.com"
YTM_DOMAIN = "https://music.youtube.com"
YTM_BASE_URL = f"{YTM_DOMAIN}/youtubei/v1/"
"""Get a signature timestamp required to generate valid stream URLs."""
response = await self._get_data(url=YTM_DOMAIN)
match = re.search(r'jsUrl"\s*:\s*"([^"]+)"', response)
+ if match is None:
+ # retry with youtube domain
+ response = await self._get_data(url=YT_DOMAIN)
+ match = re.search(r'jsUrl"\s*:\s*"([^"]+)"', response)
if match is None:
raise Exception("Could not identify the URL for base.js player.")
url = YTM_DOMAIN + match.group(1)