mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 04:30:10 +09:00
Speculate about other ways of getting productId
This commit is contained in:
parent
0dc7d954cb
commit
fb7b7179ff
@ -70,6 +70,8 @@ class NPOIE(InfoExtractor):
|
|||||||
page = self._download_webpage(url, slug, 'Finding productId using slug: %s' % slug)
|
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
|
# 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]
|
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)
|
next_data = json.loads(next_data)
|
||||||
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']:
|
||||||
|
Loading…
Reference in New Issue
Block a user