From c39bc4fd81b8932e9d4f90fd673a073c25ed6c4a Mon Sep 17 00:00:00 2001 From: ihmily <961532186@qq.com> Date: Thu, 19 Sep 2024 01:51:55 +0800 Subject: [PATCH] fix: update winktv live record --- main.py | 7 +++++-- spider.py | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index babb19e..224eaac 100644 --- a/main.py +++ b/main.py @@ -4,7 +4,7 @@ Author: Hmily GitHub: https://github.com/ihmily Date: 2023-07-17 23:52:05 -Update: 2024-09-18 12:30:12 +Update: 2024-09-19 01:50:12 Copyright (c) 2023-2024 by Hmily, All Rights Reserved. Function: Record live stream video. """ @@ -676,6 +676,7 @@ def start_record(url_data: tuple, count_variable: int = -1): proxy_address = proxy_addr_bak if proxy_addr_bak else None # print(f'\r代理地址:{proxy_address}') + # print(f'\r全局代理:{global_proxy}') print(f"\r运行新线程,传入地址 {record_url}") while True: try: @@ -1111,10 +1112,12 @@ def start_record(url_data: tuple, count_variable: int = -1): "-correct_ts_overflow", "1", ] - add_headers_list = ['PandaTV', '千度热播'] + add_headers_list = ['PandaTV', '千度热播', 'WinkTV'] if platform in add_headers_list: if platform == 'PandaTV': headers = 'origin:https://www.pandalive.co.kr' + elif platform == 'WinkTV': + headers = 'origin:https://www.winktv.co.kr' else: headers = 'referer:https://qiandurebo.com' ffmpeg_command.insert(11, "-headers") diff --git a/spider.py b/spider.py index 1e1fc31..e6be27c 100644 --- a/spider.py +++ b/spider.py @@ -4,7 +4,7 @@ Author: Hmily GitHub: https://github.com/ihmily Date: 2023-07-15 23:15:00 -Update: 2024-09-14 12:18:00 +Update: 2024-09-19 01:50:12 Copyright (c) 2023 by Hmily, All Rights Reserved. Function: Get live stream data. """ @@ -1180,7 +1180,8 @@ def get_winktv_stream_data(url: str, proxy_addr: Union[str, None] = None, cookie 'accept': 'application/json, text/plain, */*', 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'content-type': 'application/x-www-form-urlencoded', - 'referer': 'https://www.winktv.co.kr/', + 'referer': 'https://www.winktv.co.kr', + 'origin': 'https://www.winktv.co.kr', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0', } @@ -1209,8 +1210,9 @@ def get_winktv_stream_data(url: str, proxy_addr: Union[str, None] = None, cookie else: raise RuntimeError(json_data['errorData']['code'], json_data['message']) m3u8_url = json_data['PlayList']['hls'][0]['url'] + play_url_list = get_play_url_list(m3u8=m3u8_url, proxy=proxy_addr, header=headers, abroad=True) result['m3u8_url'] = m3u8_url - result['play_url_list'] = get_play_url_list(m3u8=m3u8_url, proxy=proxy_addr, header=headers, abroad=True) + result['play_url_list'] = play_url_list return result