From be2c3a393ffd15e7911b2761ed0dceb49db7bf98 Mon Sep 17 00:00:00 2001 From: Hmily <114978440+ihmily@users.noreply.github.com> Date: Fri, 22 Aug 2025 18:36:48 +0800 Subject: [PATCH] fix: update flextv endpoint address (#1185) --- demo.py | 2 +- main.py | 3 ++- src/spider.py | 14 +++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/demo.py b/demo.py index 9560db5..0c6bb4b 100644 --- a/demo.py +++ b/demo.py @@ -71,7 +71,7 @@ LIVE_STREAM_CONFIG = { "func": spider.get_winktv_stream_data, }, "flextv": { - "url": "https://www.flextv.co.kr/channels/593127/live", + "url": "https://www.ttinglive.com/channels/685479/live", "func": spider.get_flextv_stream_data, }, "looklive": { diff --git a/main.py b/main.py index b763160..e5afb6d 100644 --- a/main.py +++ b/main.py @@ -671,7 +671,7 @@ def start_record(url_data: tuple, count_variable: int = -1) -> None: else: logger.error("错误信息: 网络异常,请检查本网络是否能正常访问WinkTV直播平台") - elif record_url.find("www.flextv.co.kr/") > -1: + elif record_url.find("www.flextv.co.kr/") > -1 or record_url.find("www.ttinglive.com/") > -1: platform = 'FlexTV' with semaphore: if global_proxy or proxy_address: @@ -1930,6 +1930,7 @@ while True: 'www.pandalive.co.kr', 'www.winktv.co.kr', 'www.flextv.co.kr', + 'www.ttinglive.com', 'www.popkontv.com', 'www.twitch.tv', 'www.liveme.com', diff --git a/src/spider.py b/src/spider.py index 036682e..f198d3a 100644 --- a/src/spider.py +++ b/src/spider.py @@ -1256,7 +1256,7 @@ async def login_flextv(username: str, password: str, proxy_addr: OptionalStr = N '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/json;charset=UTF-8', - 'referer': 'https://www.flextv.co.kr/', + 'referer': 'https://www.ttinglive.com/', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0', } @@ -1268,7 +1268,7 @@ async def login_flextv(username: str, password: str, proxy_addr: OptionalStr = N 'device': 'PCWEB', } - url = 'https://api.flextv.co.kr/v2/api/auth/signin' + url = 'https://www.ttinglive.com/v2/api/auth/signin' try: print("Logging into FlexTV platform...") @@ -1296,13 +1296,13 @@ async def get_flextv_stream_url( headers = { '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', - 'referer': 'https://www.flextv.co.kr/', + 'referer': 'https://www.ttinglive.com/', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0', } user_id = url.split('/live')[0].rsplit('/', maxsplit=1)[-1] if cookie: headers['Cookie'] = cookie - play_api = f'https://api.flextv.co.kr/api/channels/{user_id}/stream?option=all' + play_api = f'https://www.ttinglive.com/api/channels/{user_id}/stream?option=all' json_str = await async_req(play_api, proxy_addr=proxy_addr, headers=headers, abroad=True) if 'HTTP Error 400: Bad Request' in json_str: raise ConnectionError( @@ -1324,7 +1324,7 @@ async def get_flextv_stream_data( headers = { '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', - 'referer': 'https://www.flextv.co.kr/', + 'referer': 'https://www.ttinglive.com/', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0', } if cookies: @@ -1333,7 +1333,7 @@ async def get_flextv_stream_data( result = {"anchor_name": '', "is_live": False} new_cookies = None try: - url2 = f'https://www.flextv.co.kr/channels/{user_id}/live' + url2 = f'https://www.ttinglive.com/channels/{user_id}/live' html_str = await async_req(url2, proxy_addr=proxy_addr, headers=headers, abroad=True) json_str = re.search('', html_str).group(1) json_data = json.loads(json_str) @@ -1371,7 +1371,7 @@ async def get_flextv_stream_data( result['play_url_list'] = play_url_list result['is_live'] = True else: - url2 = f'https://www.flextv.co.kr/channels/{user_id}' + url2 = f'https://www.ttinglive.com/channels/{user_id}' html_str = await async_req(url2, proxy_addr=proxy_addr, headers=headers, abroad=True) anchor_name = re.search('