mirror of
https://github.com/vinefeeder/TwinVine.git
synced 2026-07-15 18:10:04 +02:00
TPTV fix
This commit is contained in:
@@ -314,8 +314,8 @@ class TPTV(Service):
|
|||||||
|
|
||||||
def get_data(self, url: str) -> dict:
|
def get_data(self, url: str) -> dict:
|
||||||
self.session.headers.update({'tenant': 'encore'})
|
self.session.headers.update({'tenant': 'encore'})
|
||||||
if 'collection' in url:
|
if 'details' in url:
|
||||||
prod_id = url.split('/')[-1]
|
prod_id = url.split('item/')[-2]
|
||||||
url = f"https://prod.suggestedtv.com/api/client/v1/collection/by-reference/{prod_id}?extend=label"
|
url = f"https://prod.suggestedtv.com/api/client/v1/collection/by-reference/{prod_id}?extend=label"
|
||||||
r = self.session.get(url)
|
r = self.session.get(url)
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
@@ -327,8 +327,8 @@ class TPTV(Service):
|
|||||||
for child in children:
|
for child in children:
|
||||||
product_links.append(child['id']) if 'product' in child.get('classification') else None
|
product_links.append(child['id']) if 'product' in child.get('classification') else None
|
||||||
return product_links
|
return product_links
|
||||||
elif 'product' in url: # single item
|
elif 'playback' in url: # single item
|
||||||
prod_id = url.split('-')[-1]
|
prod_id = url.split('/')[-1]
|
||||||
return [prod_id]
|
return [prod_id]
|
||||||
elif 'VIDEO' in url:
|
elif 'VIDEO' in url:
|
||||||
prod_id = url.split('/')[-2]
|
prod_id = url.split('/')[-2]
|
||||||
|
|||||||
Reference in New Issue
Block a user