aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/common.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-09 23:43:05 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-09 23:43:05 +0700
commit0685d9727b9657fc8a31c96cb52c4155de29fcfc (patch)
tree8c6ee19df1b272ac6cb156919a5c4a17422f8391 /youtube_dl/extractor/common.py
parente06632e3fe25036b804a62469bb18fa4c37e3368 (diff)
downloadyoutube-dl-0685d9727b9657fc8a31c96cb52c4155de29fcfc.tar.xz
[utils] Share JSON-LD regex
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r--youtube_dl/extractor/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 78f053f18..5d4db54d5 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -52,6 +52,7 @@ from ..utils import (
GeoUtils,
int_or_none,
js_to_json,
+ JSON_LD_RE,
mimetype2ext,
orderedSet,
parse_codecs,
@@ -1149,8 +1150,7 @@ class InfoExtractor(object):
def _search_json_ld(self, html, video_id, expected_type=None, **kwargs):
json_ld = self._search_regex(
- r'(?s)<script[^>]+type=(["\'])application/ld\+json\1[^>]*>(?P<json_ld>.+?)</script>',
- html, 'JSON-LD', group='json_ld', **kwargs)
+ JSON_LD_RE, html, 'JSON-LD', group='json_ld', **kwargs)
default = kwargs.get('default', NO_DEFAULT)
if not json_ld:
return default if default is not NO_DEFAULT else {}