mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-07 09:23:38 +00:00
fix: remove unnecessary code
This commit is contained in:
parent
27b31cc3df
commit
1ff33d1333
@ -1,6 +1,5 @@
|
||||
from .common import InfoExtractor
|
||||
from .piaulizaportal import PIAULIZAPortalAPIIE
|
||||
from ..utils import ExtractorError, extract_attributes, multipart_encode, traverse_obj
|
||||
from ..utils import extract_attributes, multipart_encode, traverse_obj
|
||||
|
||||
|
||||
class PiaLiveIE(InfoExtractor):
|
||||
@ -39,19 +38,6 @@ class PiaLiveIE(InfoExtractor):
|
||||
},
|
||||
]
|
||||
|
||||
def handle_embed_player(self, player_tag, info_dict={}):
|
||||
player_data_url = extract_attributes(player_tag)['src']
|
||||
|
||||
if player_data_url.startswith(PIAULIZAPortalAPIIE.BASE_URL):
|
||||
return self.url_result(
|
||||
player_data_url,
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
**info_dict,
|
||||
)
|
||||
|
||||
raise ExtractorError('Unsupported streaming platform', expected=True)
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_key = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_key)
|
||||
@ -92,12 +78,15 @@ class PiaLiveIE(InfoExtractor):
|
||||
'id': (4),
|
||||
}))
|
||||
|
||||
return self.handle_embed_player(
|
||||
player_tag_list['data']['movie_one_tag'],
|
||||
info_dict={
|
||||
'display_id': program_code,
|
||||
'title': self._html_extract_title(webpage),
|
||||
'comments': comments,
|
||||
'comment_count': len(comments),
|
||||
},
|
||||
player_data_url = extract_attributes(player_tag_list['data']['movie_one_tag'])['src']
|
||||
info_dict = {
|
||||
'display_id': program_code,
|
||||
'title': self._html_extract_title(webpage),
|
||||
'comments': comments,
|
||||
'comment_count': len(comments),
|
||||
}
|
||||
return self.url_result(
|
||||
player_data_url,
|
||||
url_transparent=True,
|
||||
**info_dict,
|
||||
)
|
||||
|
||||
@ -4,8 +4,6 @@ from ..utils import ExtractorError, int_or_none, parse_qs, time_seconds, travers
|
||||
|
||||
class PIAULIZAPortalAPIIE(InfoExtractor):
|
||||
IE_DESC = 'https://player-api.p.uliza.jp - PIA ULIZA m3u8'
|
||||
BASE_URL = 'https://player-api.p.uliza.jp'
|
||||
TAG_REGEX = r'<script [^>]*\bsrc="(https://player-api\.p\.uliza\.jp/v1/players/[^"]+)"'
|
||||
|
||||
_VALID_URL = r'https://player-api\.p\.uliza\.jp/v1/players/(?P<id>.*)'
|
||||
_TESTS = [
|
||||
@ -115,11 +113,10 @@ class PIAULIZAPortalIE(InfoExtractor):
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
player_data_url = self._search_regex(
|
||||
PIAULIZAPortalAPIIE.TAG_REGEX,
|
||||
r'<script [^>]*\bsrc="(https://player-api\.p\.uliza\.jp/v1/players/[^"]+)"',
|
||||
webpage, 'player data url')
|
||||
return self.url_result(
|
||||
player_data_url,
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
display_id=video_id,
|
||||
video_title=self._html_extract_title(webpage),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user