mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-27 08:58:30 +00:00
Apply suggestions from code review
This commit is contained in:
parent
4c84e32fd3
commit
022d5ffff6
@ -23,6 +23,7 @@ def real_download(self, filename, info_dict):
|
|||||||
new_info_dict['protocol'] = 'm3u8'
|
new_info_dict['protocol'] = 'm3u8'
|
||||||
|
|
||||||
def communicate_ws(reconnect):
|
def communicate_ws(reconnect):
|
||||||
|
# Support --load-info-json as if it is a reconnect attempt
|
||||||
if reconnect or not isinstance(ws_extractor, WebSocketResponse):
|
if reconnect or not isinstance(ws_extractor, WebSocketResponse):
|
||||||
ws = self.ydl.urlopen(Request(
|
ws = self.ydl.urlopen(Request(
|
||||||
ws_url, headers={'Origin': 'https://live.nicovideo.jp'}))
|
ws_url, headers={'Origin': 'https://live.nicovideo.jp'}))
|
||||||
|
@ -817,7 +817,8 @@ def _real_extract(self, url):
|
|||||||
{extract_attributes}, 'data-props', {json.loads}))
|
{extract_attributes}, 'data-props', {json.loads}))
|
||||||
frontend_id = traverse_obj(embedded_data, ('site', 'frontendId', {str_or_none}), default='9')
|
frontend_id = traverse_obj(embedded_data, ('site', 'frontendId', {str_or_none}), default='9')
|
||||||
|
|
||||||
ws_url = traverse_obj(embedded_data, ('site', 'relive', 'webSocketUrl', {url_or_none}, {require('websocket URL')}))
|
ws_url = traverse_obj(embedded_data, (
|
||||||
|
'site', 'relive', 'webSocketUrl', {url_or_none}, {require('websocket URL')}))
|
||||||
ws_url = update_url_query(ws_url, {'frontend_id': frontend_id})
|
ws_url = update_url_query(ws_url, {'frontend_id': frontend_id})
|
||||||
ws = self._request_webpage(
|
ws = self._request_webpage(
|
||||||
ws_url, video_id, 'Connecting to WebSocket server',
|
ws_url, video_id, 'Connecting to WebSocket server',
|
||||||
|
Loading…
Reference in New Issue
Block a user