1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-01-24 06:15:39 +08:00

Improve code convention

This commit is contained in:
Urgau 2018-06-03 11:24:41 +02:00 committed by GitHub
parent f051742c3b
commit 5f2aac8642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,8 +456,7 @@ class PBSIE(InfoExtractor):
if not url: if not url:
url = self._og_search_url(webpage) url = self._og_search_url(webpage)
if url.strip().startswith("//"): url = self._proto_relative_url(url.strip())
url = "https:" + url.strip()
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
player_id = mobj.group('player_id') player_id = mobj.group('player_id')
@ -467,13 +466,8 @@ class PBSIE(InfoExtractor):
player_page = self._download_webpage( player_page = self._download_webpage(
url, display_id, note='Downloading player page', url, display_id, note='Downloading player page',
errnote='Could not download player page') errnote='Could not download player page')
try:
video_id = self._search_regex( video_id = self._search_regex(
r'<div\s+id="video_([0-9]+)"', player_page, 'video ID') [r'<div\s+id="video_([0-9]+)"', r'"id":[\s]*"([0-9]+)"'], player_page, 'video ID')
except:
video_id = self._search_regex(
r'"id":[\s]*"([0-9]+)"', player_page, 'video ID')
else: else:
video_id = mobj.group('id') video_id = mobj.group('id')
display_id = video_id display_id = video_id