aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dlc/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2020-11-20 00:52:59 +0530
committerpukkandan <pukkandan@gmail.com>2020-11-20 13:03:32 +0530
commit8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b (patch)
treec5ba0d26e17bb3102c0b24886853d9a818e875c6 /youtube_dlc/utils.py
parent228385340e9a976f52735078218a9b8ecfe7ae7a (diff)
downloadhypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.tar.lz
hypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.tar.xz
hypervideo-pre-8bdd16b4993b8d546b4cbbdbe4710db0bc2f971b.zip
Merge 'ytdl-org/youtube-dl/master' release 2020.11.19
Old Extractors left behind: VLivePlaylistIE YoutubeSearchURLIE YoutubeShowIE YoutubeFavouritesIE If removing old extractors, make corresponding changes in docs/supportedsites.md youtube_dlc/extractor/extractors.py Not merged: .github/ISSUE_TEMPLATE/1_broken_site.md .github/ISSUE_TEMPLATE/2_site_support_request.md .github/ISSUE_TEMPLATE/3_site_feature_request.md .github/ISSUE_TEMPLATE/4_bug_report.md .github/ISSUE_TEMPLATE/5_feature_request.md test/test_all_urls.py youtube_dlc/version.py Changelog
Diffstat (limited to 'youtube_dlc/utils.py')
-rw-r--r--youtube_dlc/utils.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/youtube_dlc/utils.py b/youtube_dlc/utils.py
index f5dc1bdaf..975b741c5 100644
--- a/youtube_dlc/utils.py
+++ b/youtube_dlc/utils.py
@@ -4085,7 +4085,7 @@ def js_to_json(code):
v = m.group(0)
if v in ('true', 'false', 'null'):
return v
- elif v.startswith('/*') or v.startswith('//') or v == ',':
+ elif v.startswith('/*') or v.startswith('//') or v.startswith('!') or v == ',':
return ""
if v[0] in ("'", '"'):
@@ -4095,12 +4095,12 @@ def js_to_json(code):
'\\\n': '',
'\\x': '\\u00',
}.get(m.group(0), m.group(0)), v[1:-1])
-
- for regex, base in INTEGER_TABLE:
- im = re.match(regex, v)
- if im:
- i = int(im.group(1), base)
- return '"%d":' % i if v.endswith(':') else '%d' % i
+ else:
+ for regex, base in INTEGER_TABLE:
+ im = re.match(regex, v)
+ if im:
+ i = int(im.group(1), base)
+ return '"%d":' % i if v.endswith(':') else '%d' % i
return '"%s"' % v
@@ -4110,7 +4110,8 @@ def js_to_json(code):
{comment}|,(?={skip}[\]}}])|
(?:(?<![0-9])[eE]|[a-df-zA-DF-Z_])[.a-zA-Z_0-9]*|
\b(?:0[xX][0-9a-fA-F]+|0+[0-7]+)(?:{skip}:)?|
- [0-9]+(?={skip}:)
+ [0-9]+(?={skip}:)|
+ !+
'''.format(comment=COMMENT_RE, skip=SKIP_RE), fix_kv, code)