1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-11-01 15:15:15 +00:00

[docs] Misc improvements

Closes #4987, Closes #4906, Closes #4919, Closes #4977, Closes #4979
This commit is contained in:
pukkandan
2022-09-22 01:37:44 +05:30
parent 8ca48a1a54
commit 2fa669f759
11 changed files with 44 additions and 34 deletions

View File

@@ -1236,7 +1236,7 @@ class InfoExtractor:
fatal, has_default = False, True
json_string = self._search_regex(
rf'{start_pattern}\s*(?P<json>{{\s*{contains_pattern}\s*}})\s*{end_pattern}',
rf'(?:{start_pattern})\s*(?P<json>{{\s*(?:{contains_pattern})\s*}})\s*(?:{end_pattern})',
string, name, group='json', fatal=fatal, default=None if has_default else NO_DEFAULT)
if not json_string:
return default

View File

@@ -1,11 +1,10 @@
from .common import InfoExtractor
from .common import InfoExtractor
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
urlencode_postdata
urlencode_postdata,
)

View File

@@ -2623,8 +2623,8 @@ class GenericIE(InfoExtractor):
url, smuggled_data = unsmuggle_url(url, {})
force_videoid = None
is_intentional = smuggled_data and smuggled_data.get('to_generic')
if smuggled_data and 'force_videoid' in smuggled_data:
is_intentional = smuggled_data.get('to_generic')
if 'force_videoid' in smuggled_data:
force_videoid = smuggled_data['force_videoid']
video_id = force_videoid
else:

View File

@@ -557,8 +557,7 @@ class NiconicoPlaylistBaseIE(InfoExtractor):
}
def _call_api(self, list_id, resource, query):
"Implement this in child class"
pass
raise NotImplementedError('Must be implemented in subclasses')
@staticmethod
def _parse_owner(item):