mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-11 20:50:10 +00:00
[BrainPOP] Clean up code and account for non-mandatory fields
This commit is contained in:
parent
45abe2051d
commit
f56a9dbdbc
@ -24,19 +24,19 @@ class BrainPOPIE(InfoExtractor):
|
||||
|
||||
self.report_extraction(video_id)
|
||||
|
||||
ec_token = self._html_search_regex(r'ec_token : \'(.+)\'', webpage, "token")
|
||||
movie_cdn_path = self._html_search_regex(r'movie_cdn_path : \'(.+)\'', webpage, "cdn path")
|
||||
mp4 = self._html_search_regex(r'mp4":"([^"]*)', webpage, "mp4")
|
||||
ec_token = self._html_search_regex(r'ec_token : \'(.+)\'', webpage, 'token')
|
||||
movie_cdn_path = self._html_search_regex(r'movie_cdn_path : \'(.+)\'', webpage, 'cdn path')
|
||||
mp4 = self._html_search_regex(r'mp4":"([^"]*)', webpage, 'mp4')
|
||||
|
||||
url = movie_cdn_path + mp4.replace("\\", "") + "?" + ec_token
|
||||
url = movie_cdn_path + mp4.replace('\\', '') + '?' + ec_token
|
||||
|
||||
title = self._html_search_regex(r'type":"Movie","name":"([^"]*)"', webpage, "title")
|
||||
title = self._html_search_regex(r'type":"Movie","name":"([^"]*)"', webpage, 'title') or self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
||||
|
||||
thumbnail_cdn = self._html_search_regex(r"'cdn_path' : '([^']*)'", webpage, "thumbnail cdn")
|
||||
thumbnail_image = self._html_search_regex(r'type":"Movie","name":"[^"]*","image":"([^"]*)"', webpage, "thumbnail")
|
||||
thumbnail = thumbnail_cdn + thumbnail_image.replace("\\", "")
|
||||
thumbnail_cdn = self._html_search_regex(r"'cdn_path' : '([^']*)'", webpage, 'thumbnail cdn', fatal=False)
|
||||
thumbnail_image = self._html_search_regex(r'type":"Movie","name":"[^"]*","image":"([^"]*)"', webpage, 'thumbnail', fatal=False)
|
||||
thumbnail = thumbnail_cdn + thumbnail_image.replace('\\', '')
|
||||
|
||||
description = self._html_search_regex(r'type":"Movie","name":"[^"]*","image":"[^"]*","description":"([^"]*)"', webpage, "description")
|
||||
description = self._html_search_regex(r'type":"Movie","name":"[^"]*","image":"[^"]*","description":"([^"]*)"', webpage, 'description', fatal=False)
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
|
Loading…
Reference in New Issue
Block a user