aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/canvas.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-20 02:39:20 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-20 02:39:20 +0700
commitfd62b36680ff7d7bea789ac0031a33fc2d9270ad (patch)
tree861a4d1377687d09572b90f925a6810cf8b588e8 /youtube_dl/extractor/canvas.py
parent25586c601c46768271070c61af76e7fa1d196890 (diff)
[vrtnu] Relax title extraction and extract JSON-LD (closes #17018)
Diffstat (limited to 'youtube_dl/extractor/canvas.py')
-rw-r--r--youtube_dl/extractor/canvas.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/extractor/canvas.py b/youtube_dl/extractor/canvas.py
index 8ac62c1a6..174fd9e2b 100644
--- a/youtube_dl/extractor/canvas.py
+++ b/youtube_dl/extractor/canvas.py
@@ -11,6 +11,7 @@ from ..utils import (
strip_or_none,
float_or_none,
int_or_none,
+ merge_dicts,
parse_iso8601,
)
@@ -248,9 +249,13 @@ class VrtNUIE(GigyaBaseIE):
webpage, urlh = self._download_webpage_handle(url, display_id)
- title = self._html_search_regex(
+ info = self._search_json_ld(webpage, display_id, default={})
+
+ # title is optional here since it may be extracted by extractor
+ # that is delegated from here
+ title = strip_or_none(self._html_search_regex(
r'(?ms)<h1 class="content__heading">(.+?)</h1>',
- webpage, 'title').strip()
+ webpage, 'title', default=None))
description = self._html_search_regex(
r'(?ms)<div class="content__description">(.+?)</div>',
@@ -295,7 +300,7 @@ class VrtNUIE(GigyaBaseIE):
# the first one
video_id = list(video.values())[0].get('videoid')
- return {
+ return merge_dicts(info, {
'_type': 'url_transparent',
'url': 'https://mediazone.vrt.be/api/v1/vrtvideo/assets/%s' % video_id,
'ie_key': CanvasIE.ie_key(),
@@ -307,4 +312,4 @@ class VrtNUIE(GigyaBaseIE):
'season_number': season_number,
'episode_number': episode_number,
'release_date': release_date,
- }
+ })