From dc8207aad35e6b2223d940a3823948e650ca7fdd Mon Sep 17 00:00:00 2001 From: Wait66tinG <37771088+Wait66tinG@users.noreply.github.com> Date: Fri, 29 Jul 2022 09:06:41 +0800 Subject: [PATCH] Update afreecaTV.py (#182) --- biliup/plugins/afreecaTV.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/biliup/plugins/afreecaTV.py b/biliup/plugins/afreecaTV.py index c288b0a..524502c 100644 --- a/biliup/plugins/afreecaTV.py +++ b/biliup/plugins/afreecaTV.py @@ -4,10 +4,10 @@ from ..engine.decorators import Plugin from ..plugins import match1, logger from ..engine.download import DownloadBase -VALID_URL_BASE = r"https?://(.*?)\.afreecatv\.com/(?P\w+)(?:/\d+)?" - +# VALID_URL_BASE = r"https?://(.*?)\.afreecatv\.com/(?P\w+)(?:/\d+)?" +VALID_URL_BASE = r"https?://play\.afreecatv\.com/(?P\w+)(?:/\d+)?" STREAM_INFO_URLS = "{rmd}/broad_stream_assign.html" -CHANNEL_API_URL = "http://live.afreecatv.com:8057/afreeca/player_live_api.php" +CHANNEL_API_URL = "http://live.afreecatv.com/afreeca/player_live_api.php" QUALITIES = ["original", "hd", "sd"] @@ -20,10 +20,8 @@ class AfreecaTV(DownloadBase): def check_stream(self): logger.debug(self.fname) username = match1(self.url, VALID_URL_BASE) - res_bno = requests.post(CHANNEL_API_URL, data={"bid": username, "mode": "landing", "player_type": "html5"}, - timeout=5) + res_bno = requests.post(CHANNEL_API_URL + "?bjid=" + username,data={"bid": username, "mode": "landing", "player_type": "html5"},timeout=5) res_bno.close() - if res_bno.json()["CHANNEL"]["RESULT"] == 0: return bno = res_bno.json()["CHANNEL"]["BNO"]