Fixed tracks to download appletv seasons

This commit is contained in:
TR-TDN 2025-05-13 12:08:01 +02:00
parent 6f35e17fdd
commit 4f439f5ada

View File

@ -150,7 +150,7 @@ class AppleTVPlus(BaseService):
'utsk': '6e3013c6d6fae3c2::::::9318c17fb39d6b9c', 'utsk': '6e3013c6d6fae3c2::::::9318c17fb39d6b9c',
'caller': 'web', 'caller': 'web',
'sf': self.storefront, 'sf': self.storefront,
'v': '82', 'v': '46',
'pfm': 'appletv', 'pfm': 'appletv',
'mfr': 'Apple', 'mfr': 'Apple',
'locale': 'en-US', 'locale': 'en-US',
@ -159,7 +159,7 @@ class AppleTVPlus(BaseService):
'count': '100', 'count': '100',
'skip': '0', 'skip': '0',
} }
r = self.session.get(url=self.config["endpoints"]["title"].format(type={0: "shows", 1: "movies", 2: "sporting-events"}[self.type], id=self.title), r = self.session.get(url=self.config["endpoints"]["manifest"].format(id=title.service_data["id"]),
params=self.params params=self.params
) )
try: try:
@ -167,12 +167,14 @@ class AppleTVPlus(BaseService):
#print(stream_data) #print(stream_data)
except json.JSONDecodeError: except json.JSONDecodeError:
raise ValueError(f"Failed to load stream data: {r.text}") raise ValueError(f"Failed to load stream data: {r.text}")
stream_data = stream_data["data"]["playables"] stream_data = stream_data["data"]["content"]["playables"][0]
"""
if self.condensed == True: if self.condensed == True:
tvs_sbd = list(stream_data.keys())[1] tvs_sbd = list(stream_data.keys())[1]
else: else:
tvs_sbd = list(stream_data.keys())[0] tvs_sbd = list(stream_data.keys())[0]
stream_data = stream_data[tvs_sbd] stream_data = stream_data[tvs_sbd]
"""
if not stream_data["isEntitledToPlay"]: if not stream_data["isEntitledToPlay"]:
raise self.log.exit(" - User is not entitled to play this title") raise self.log.exit(" - User is not entitled to play this title")