修复因西瓜直播搜索接口修改导致的无法获取直播用户的问题

This commit is contained in:
Jerry Yan 2019-05-12 19:31:43 +08:00 committed by JerryYan
parent f1615957bc
commit 22925398da
2 changed files with 13 additions and 7 deletions

View File

@ -185,10 +185,14 @@ if __name__ == "__main__":
else:
name = readInput("请输入主播用户名,默认为", name, 3)
api = WinMain(name)
print("进入", api.roomLiver, "的直播间")
if not api.isValidRoom:
input("房间不存在")
while not api.isValidRoom:
set_cmd_text_color(FOREGROUND_RED)
print("未找到对应房间或未开播等待1分钟后重试")
resetColor()
time.sleep(60)
api.updRoomInfo()
sys.exit()
print("进入", api.roomLiver, "的直播间")
os.system("title {}".format(api.getTitle()))
print("=" * 30)
while True:

View File

@ -107,14 +107,16 @@ def upload(date=datetime.strftime(datetime.now(), "%Y_%m_%d")):
b = Bilibili()
b.login(Common.config["b_u"], Common.config["b_p"])
et = threading.Thread(target=encode, args=())
et.setDaemon(True)
et.start()
def run():
global isEncode, isDownload
et = threading.Thread(target=encode, args=())
et.setDaemon(True)
et.start()
Common.refreshDownloader()
if not Common.api.isValidRoom:
Common.appendError("[{}]房间不存在".format(Common.config["l_u"]))
Common.appendError("[{}]房间未找到".format(Common.config["l_u"]))
return
d = None
t = threading.Thread(target=download)