mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-27 13:43:21 +08:00
Regex + JSON get
Added back https variable and removed backslashes. Changed to .get() safe search function. Ran test regarding null values and returned successfully.
This commit is contained in:
parent
e23c8a0bb1
commit
adfce1f544
@ -6,7 +6,7 @@ from .common import InfoExtractor
|
|||||||
|
|
||||||
|
|
||||||
class CultureUnpluggedIE(InfoExtractor):
|
class CultureUnpluggedIE(InfoExtractor):
|
||||||
_VALID_URL = r'http?://(?:www\.)?cultureunplugged\.com/documentary\/watch-online\/play\/(?P<id>\d+)\/(?P<display_id>[^/]+)'
|
_VALID_URL = r'https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)/(?P<display_id>[^/]+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.cultureunplugged.com/documentary/watch-online/play/53662/The-Next--Best-West',
|
'url': 'http://www.cultureunplugged.com/documentary/watch-online/play/53662/The-Next--Best-West',
|
||||||
'md5': 'ac6c093b089f7d05e79934dcb3d228fc',
|
'md5': 'ac6c093b089f7d05e79934dcb3d228fc',
|
||||||
@ -27,10 +27,10 @@ class CultureUnpluggedIE(InfoExtractor):
|
|||||||
json_url = 'http://www.cultureunplugged.com/movie-data/cu-%s.json' % (video_id)
|
json_url = 'http://www.cultureunplugged.com/movie-data/cu-%s.json' % (video_id)
|
||||||
json_output = self._download_json(json_url, video_id)
|
json_output = self._download_json(json_url, video_id)
|
||||||
|
|
||||||
title = json_output['title']
|
title = json_output.get('title')
|
||||||
description = json_output['synopsis']
|
description = json_output.get('synopsis')
|
||||||
creator = json_output['producer']
|
creator = json_output.get('producer')
|
||||||
thumbnail = json_output['large_thumb']
|
thumbnail = json_output.get('large_thumb')
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': json_output['url'],
|
'url': json_output['url'],
|
||||||
|
Loading…
Reference in New Issue
Block a user