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:
parent
f051742c3b
commit
5f2aac8642
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user