From 0bea4fd8072c1421ab3a94f0601ddef9df14f133 Mon Sep 17 00:00:00 2001 From: Lesmiscore Date: Sun, 5 Jun 2022 14:37:05 +0900 Subject: [extractor/0000studio] Add extractors (#3959) Authored by: Lesmiscore --- yt_dlp/extractor/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'yt_dlp/extractor/common.py') diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 2e62660c7..c0b1fa9e0 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -1568,7 +1568,7 @@ class InfoExtractor: webpage, 'next.js data', fatal=fatal, **kw), video_id, transform_source=transform_source, fatal=fatal) - def _search_nuxt_data(self, webpage, video_id, context_name='__NUXT__'): + def _search_nuxt_data(self, webpage, video_id, context_name='__NUXT__', return_full_data=False): ''' Parses Nuxt.js metadata. This works as long as the function __NUXT__ invokes is a pure function. ''' # not all website do this, but it can be changed # https://stackoverflow.com/questions/67463109/how-to-change-or-hide-nuxt-and-nuxt-keyword-in-page-source @@ -1584,7 +1584,10 @@ class InfoExtractor: if val in ('undefined', 'void 0'): args[key] = 'null' - return self._parse_json(js_to_json(js, args), video_id)['data'][0] + ret = self._parse_json(js_to_json(js, args), video_id) + if return_full_data: + return ret + return ret['data'][0] @staticmethod def _hidden_inputs(html): -- cgit v1.2.3