Use provided util
This commit is contained in:
parent
f9e59b0c49
commit
8b1a7d9a7c
@ -72,7 +72,7 @@ class NPOIE(InfoExtractor):
|
|||||||
next_data = page.split('<script id="__NEXT_DATA__" type="application/json">')[1].split('</script>')[0]
|
next_data = page.split('<script id="__NEXT_DATA__" type="application/json">')[1].split('</script>')[0]
|
||||||
# TODO The data in this script tag feels like GraphQL, so there might be an easier way
|
# TODO The data in this script tag feels like GraphQL, so there might be an easier way
|
||||||
# to get the product id, maybe using a GraphQL endpoint
|
# to get the product id, maybe using a GraphQL endpoint
|
||||||
next_data = json.loads(next_data)
|
next_data = self._parse_json(next_data, slug)
|
||||||
product_id, title, description, thumbnail = None, None, None, None
|
product_id, title, description, thumbnail = None, None, None, None
|
||||||
for query in next_data['props']['pageProps']['dehydratedState']['queries']:
|
for query in next_data['props']['pageProps']['dehydratedState']['queries']:
|
||||||
if isinstance(query['state']['data'], list):
|
if isinstance(query['state']['data'], list):
|
||||||
|
Loading…
Reference in New Issue
Block a user