1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 05:22:51 +08:00

checked code with flake8 + added fatal=False to extractor fields

This commit is contained in:
troywith77 2017-05-09 16:24:39 +08:00
parent 51a02f2530
commit 985417a8b3

View File

@ -3,6 +3,7 @@ from __future__ import unicode_literals
from .common import InfoExtractor
class PearIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?pearvideo\.com/video_(?P<id>[0-9]+)'
_TEST = {
@ -20,14 +21,14 @@ class PearIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<h1[^>]+class="video-tt">(.+)</h1>', webpage, 'title')
title = self._html_search_regex(r'<h1[^>]+class="video-tt">(.+)</h1>', webpage, 'title', fatal=False)
description = self._html_search_regex(r'<div[^>]+class="summary"[^>]*>([^<]+)<', webpage, 'description', fatal=False)
hdUrl = self._html_search_regex(r'hdUrl="(.*?)"', webpage, 'url')
url = self._html_search_regex(r'hdUrl="(.*?)"', webpage, 'url', fatal=False)
return {
'id': video_id,
'ext': 'mp4',
'title': title,
'description': description,
'url': hdUrl
}
'url': url
}