mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-07 09:23:38 +00:00
chore: remove smuggled_url
This commit is contained in:
parent
1a22cc3d3f
commit
fad7c2a75a
@ -1,10 +1,10 @@
|
||||
from .common import InfoExtractor
|
||||
from .piaulizaportal import PIAULIZAPortalAPIIE
|
||||
from ..utils import ExtractorError, extract_attributes, multipart_encode, smuggle_url, traverse_obj
|
||||
from ..utils import ExtractorError, extract_attributes, multipart_encode, traverse_obj
|
||||
|
||||
|
||||
class PiaLiveIE(InfoExtractor):
|
||||
PLAYER_ROOT_URL = 'https://player.pia-live.jp'
|
||||
PLAYER_ROOT_URL = 'https://player.pia-live.jp/'
|
||||
PIA_LIVE_API_URL = 'https://api.pia-live.jp'
|
||||
_VALID_URL = r'https?://player\.pia-live\.jp/stream/(?P<id>[\w-]+)'
|
||||
|
||||
@ -42,10 +42,7 @@ class PiaLiveIE(InfoExtractor):
|
||||
|
||||
if player_data_url.startswith(PIAULIZAPortalAPIIE.BASE_URL):
|
||||
return self.url_result(
|
||||
smuggle_url(
|
||||
player_data_url,
|
||||
{'referer': self.PLAYER_ROOT_URL},
|
||||
),
|
||||
player_data_url,
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
**info_dict,
|
||||
@ -81,7 +78,7 @@ class PiaLiveIE(InfoExtractor):
|
||||
)['data']['chat_one_tag']
|
||||
chat_room_url = extract_attributes(chat_info)['src']
|
||||
comment_page = self._download_webpage(
|
||||
chat_room_url, program_code, headers={'Referer': f'{self.PLAYER_ROOT_URL}/'}, note='Fetching comment page', errnote='Unable to fetch comment page')
|
||||
chat_room_url, program_code, headers={'Referer': f'{self.PLAYER_ROOT_URL}'}, note='Fetching comment page', errnote='Unable to fetch comment page')
|
||||
comment_list = self._search_json(
|
||||
r'var\s+_history\s*=', comment_page, 'comment list', program_code,
|
||||
contains_pattern=r'\[(?s:.+)\]') or []
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
from .common import InfoExtractor
|
||||
from ..utils import ExtractorError, int_or_none, parse_qs, smuggle_url, time_seconds, traverse_obj, unsmuggle_url
|
||||
from ..utils import ExtractorError, int_or_none, parse_qs, time_seconds, traverse_obj
|
||||
|
||||
|
||||
class PIAULIZAPortalAPIIE(InfoExtractor):
|
||||
@ -48,12 +48,9 @@ class PIAULIZAPortalAPIIE(InfoExtractor):
|
||||
]
|
||||
|
||||
def _real_extract(self, url):
|
||||
url, smuggled_data = unsmuggle_url(url, {})
|
||||
tmp_video_id = self._search_regex(r'&name=([^&]+)', self._match_id(url), 'video id', default='unknown')
|
||||
player_data = self._download_webpage(
|
||||
url,
|
||||
tmp_video_id,
|
||||
headers={'Referer': smuggled_data.get('referer') or f'{self.BASE_URL}/'},
|
||||
url, tmp_video_id, headers={'Referer': 'https://player-api.p.uliza.jp/'},
|
||||
note='Fetching player data', errnote='Unable to fetch player data',
|
||||
)
|
||||
|
||||
@ -119,10 +116,7 @@ class PIAULIZAPortalIE(InfoExtractor):
|
||||
PIAULIZAPortalAPIIE.TAG_REGEX,
|
||||
webpage, 'player data url')
|
||||
return self.url_result(
|
||||
smuggle_url(
|
||||
player_data_url,
|
||||
{'referer': 'https://ulizaportal.jp/'},
|
||||
),
|
||||
player_data_url,
|
||||
ie=PIAULIZAPortalAPIIE.ie_key(),
|
||||
url_transparent=True,
|
||||
video_id=video_id,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user