youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 0b26ba3fc8eee0bb047c5e78e6f1a8ba59fa9457
parent 6be16ed24bba86c0bb22a3eca6640e727153f1fd
Author: Yen Chi Hsuan <yan12125@gmail.com>
Date:   Sat, 16 Jan 2016 20:45:36 +0800

[extractor/common] Allow passing more parameters to _search_json_ld

Diffstat:
Myoutube_dl/extractor/common.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py @@ -763,13 +763,13 @@ class InfoExtractor(object): return self._html_search_meta('twitter:player', html, 'twitter card player') - def _search_json_ld(self, html, video_id, fatal=True): + def _search_json_ld(self, html, video_id, **kwargs): json_ld = self._search_regex( r'(?s)<script[^>]+type=(["\'])application/ld\+json\1[^>]*>(?P<json_ld>.+?)</script>', - html, 'JSON-LD', fatal=fatal, group='json_ld') + html, 'JSON-LD', group='json_ld', **kwargs) if not json_ld: return {} - return self._json_ld(json_ld, video_id, fatal=fatal) + return self._json_ld(json_ld, video_id, fatal=kwargs.get('fatal', True)) def _json_ld(self, json_ld, video_id, fatal=True): if isinstance(json_ld, compat_str):