From 3f2910cb1fb2c30eae1fec1cc22fbbcbfbb34caa Mon Sep 17 00:00:00 2001 From: wbt5 Date: Sun, 9 Aug 2020 11:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=89=BA=E6=B0=94=E5=B1=B1?= =?UTF-8?q?=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 173.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 173.py diff --git a/173.py b/173.py new file mode 100644 index 0000000..8eb7efb --- /dev/null +++ b/173.py @@ -0,0 +1,22 @@ +# 艺气山直播:http://www.173.com/room/category?categoryId=11 +import requests + + +def _173(rid): + params = 'roomId={}&format=m3u8'.format(rid) + with requests.Session() as s: + res = s.post('http://www.173.com/room/getVieoUrl', params=params).json() + data = res['data'] + if data: + status = data['status'] + if status == 2: + return data['url'] + else: + raise Exception('未开播') + else: + raise Exception('直播间不存在') + + +if __name__ == '__main__': + r = input('输入艺气山直播房间号:\n') + print(_173(r))