From c7ff83cfa714d049dc5f9b946e605e0628bc3cc0 Mon Sep 17 00:00:00 2001 From: wbt5 Date: Sat, 26 Sep 2020 18:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0bd=E3=80=81migu-bd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huya.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/huya.py b/huya.py index d337c75..07f89ef 100644 --- a/huya.py +++ b/huya.py @@ -1,5 +1,5 @@ # 获取虎牙直播的真实流媒体地址。 -# 虎牙"一起看"频道的直播间可能会卡顿 +# 虎牙"一起看"频道的直播间可能会卡顿,尝试将返回地址 tx.hls.huya.com 中的 tx 改为 bd、migu-bd。 import requests import re @@ -34,7 +34,9 @@ class HuYa: b_url = self.live(livelineurl.replace('_2000', '')) real_url = { '2000p': "https:" + s_url, - 'BD': "https:" + b_url + 'tx': "https:" + b_url, + 'bd': "https:" + b_url.replace('tx.hls.huya.com', 'bd.hls.huya.com'), + 'migu-bd': "https:" + b_url.replace('tx.hls.huya.com', 'migu-bd.hls.huya.com'), } else: raise Exception('未开播或直播间不存在')