diff options
author | Lesmiscore <nao20010128@gmail.com> | 2022-06-05 14:37:05 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 14:37:05 +0900 |
commit | 0bea4fd8072c1421ab3a94f0601ddef9df14f133 (patch) | |
tree | ad2ea86e7ef7804a5bba20352318416aee87ecd3 /yt_dlp/extractor/common.py | |
parent | b5770743fe9700ed5c00864a6abd98ea3e4c73ab (diff) | |
download | hypervideo-pre-0bea4fd8072c1421ab3a94f0601ddef9df14f133.tar.lz hypervideo-pre-0bea4fd8072c1421ab3a94f0601ddef9df14f133.tar.xz hypervideo-pre-0bea4fd8072c1421ab3a94f0601ddef9df14f133.zip |
[extractor/0000studio] Add extractors (#3959)
Authored by: Lesmiscore
Diffstat (limited to 'yt_dlp/extractor/common.py')
-rw-r--r-- | yt_dlp/extractor/common.py | 7 |
1 files changed, 5 insertions, 2 deletions
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): |