1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-25 10:17:41 +00:00

Speculate about other ways of getting productId

This commit is contained in:
Bart Broere 2024-03-01 15:08:10 +01:00
parent 0dc7d954cb
commit fb7b7179ff

View file

@ -70,6 +70,8 @@ class NPOIE(InfoExtractor):
page = self._download_webpage(url, slug, 'Finding productId using slug: %s' % slug)
# TODO find out what proper HTML parsing utilities are available in youtube-dl
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
# to get the product id, maybe using a GraphQL endpoint
next_data = json.loads(next_data)
product_id, title, description, thumbnail = None, None, None, None
for query in next_data['props']['pageProps']['dehydratedState']['queries']: