[Unity] Applied requested fixes for PR #14529
This commit is contained in:
parent
20d3514c53
commit
51c83012be
@ -2,9 +2,6 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from .youtube import YoutubeIE
|
from .youtube import YoutubeIE
|
||||||
from ..utils import (
|
|
||||||
ExtractorError
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class UnityIE(InfoExtractor):
|
class UnityIE(InfoExtractor):
|
||||||
@ -27,12 +24,9 @@ class UnityIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
vid = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, vid)
|
||||||
youtube_id = self._search_regex(
|
youtube_id = self._search_regex(
|
||||||
r'data-video-id="([_0-9a-zA-Z-]+)"',
|
r'data-video-id="([_0-9a-zA-Z-]+)"',
|
||||||
webpage, 'youtube ID', default=None)
|
webpage, 'youtube ID')
|
||||||
if not youtube_id:
|
return self.url_result(youtube_id, video_id=vid, ie=YoutubeIE.ie_key())
|
||||||
raise ExtractorError('Unable to extract youtube ID', expected=True)
|
|
||||||
youtube_url = 'https://youtu.be/%s' % youtube_id
|
|
||||||
return self.url_result(youtube_url, ie=YoutubeIE.ie_key())
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user