mirror of
https://github.com/ihmily/DouyinLiveRecorder.git
synced 2025-12-26 05:48:32 +08:00
refactor: rename shiguang live to changliao live
This commit is contained in:
parent
5ffce76060
commit
c2e79e125d
@ -72,7 +72,7 @@ huajiao_cookie =
|
||||
liuxing_cookie =
|
||||
showroom_cookie =
|
||||
acfun_cookie =
|
||||
shiguang_cookie =
|
||||
changliao_cookie =
|
||||
yinbo_cookie =
|
||||
yingke_cookie =
|
||||
zhihu_cookie =
|
||||
|
||||
6
demo.py
6
demo.py
@ -120,9 +120,9 @@ LIVE_STREAM_CONFIG = {
|
||||
"url": "https://live.acfun.cn/live/17912421",
|
||||
"func": spider.get_acfun_stream_data,
|
||||
},
|
||||
"shiguang": {
|
||||
"url": "https://www.rengzu.com/180778",
|
||||
"func": spider.get_shiguang_stream_url,
|
||||
"changliao": {
|
||||
"url": "https://www.tlclw.com/801044397",
|
||||
"func": spider.get_changliao_stream_url,
|
||||
},
|
||||
"yingke": {
|
||||
"url": "https://www.inke.cn/liveroom/index.html?uid=710032101&id=1720857535354099",
|
||||
|
||||
@ -2356,13 +2356,13 @@ def get_acfun_stream_data(url: str, proxy_addr: Union[str, None] = None, cookies
|
||||
|
||||
|
||||
@trace_error_decorator
|
||||
def get_shiguang_stream_url(url: str, proxy_addr: Union[str, None] = None, cookies: Union[str, None] = None) -> \
|
||||
def get_changliao_stream_url(url: str, proxy_addr: Union[str, None] = None, cookies: Union[str, None] = None) -> \
|
||||
Dict[str, Any]:
|
||||
headers = {
|
||||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1',
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
|
||||
'Referer': 'https://wap.rengzu.com/122377?promoters=956629',
|
||||
'Referer': 'https://wap.tlclw.com/phone/801044397?promoters=0',
|
||||
}
|
||||
if cookies:
|
||||
headers['Cookie'] = cookies
|
||||
@ -2370,9 +2370,9 @@ def get_shiguang_stream_url(url: str, proxy_addr: Union[str, None] = None, cooki
|
||||
room_id = url.split('?')[0].rsplit('/', maxsplit=1)[-1]
|
||||
params = {
|
||||
'roomidx': room_id,
|
||||
'currentUrl': f'https://wap.rengzu.com/{room_id}',
|
||||
'currentUrl': f'https://wap.tlclw.com/{room_id}',
|
||||
}
|
||||
play_api = f'https://wap.rengzu.com/api/ui/room/v1.0.0/live.ashx?{urllib.parse.urlencode(params)}'
|
||||
play_api = f'https://wap.tlclw.com/api/ui/room/v1.0.0/live.ashx?{urllib.parse.urlencode(params)}'
|
||||
json_str = get_req(play_api, proxy_addr=proxy_addr, headers=headers)
|
||||
json_data = json.loads(json_str)
|
||||
anchor_name = json_data['data']['roomInfo']['nickname']
|
||||
|
||||
14
main.py
14
main.py
@ -658,11 +658,11 @@ def start_record(url_data: tuple, count_variable: int = -1):
|
||||
port_info = stream.get_stream_url(
|
||||
json_data, record_quality, url_type='flv', extra_key='url')
|
||||
|
||||
elif record_url.find("rengzu.com/") > -1:
|
||||
platform = '时光直播'
|
||||
elif record_url.find("tlclw.com/") > -1:
|
||||
platform = '畅聊直播'
|
||||
with semaphore:
|
||||
port_info = spider.get_shiguang_stream_url(
|
||||
url=record_url, proxy_addr=proxy_address, cookies=shiguang_cookie)
|
||||
port_info = spider.get_changliao_stream_url(
|
||||
url=record_url, proxy_addr=proxy_address, cookies=changliao_cookie)
|
||||
|
||||
elif record_url.find("ybw1666.com/") > -1:
|
||||
platform = '音播直播'
|
||||
@ -1423,7 +1423,7 @@ while True:
|
||||
liuxing_cookie = read_config_value(config, 'Cookie', 'liuxing_cookie', '')
|
||||
showroom_cookie = read_config_value(config, 'Cookie', 'showroom_cookie', '')
|
||||
acfun_cookie = read_config_value(config, 'Cookie', 'acfun_cookie', '')
|
||||
shiguang_cookie = read_config_value(config, 'Cookie', 'shiguang_cookie', '')
|
||||
changliao_cookie = read_config_value(config, 'Cookie', 'changliao_cookie', '')
|
||||
yinbo_cookie = read_config_value(config, 'Cookie', 'yinbo_cookie', '')
|
||||
yingke_cookie = read_config_value(config, 'Cookie', 'yingke_cookie', '')
|
||||
zhihu_cookie = read_config_value(config, 'Cookie', 'zhihu_cookie', '')
|
||||
@ -1513,8 +1513,8 @@ while True:
|
||||
'wap.7u66.com',
|
||||
'live.acfun.cn',
|
||||
'm.acfun.cn',
|
||||
'www.rengzu.com',
|
||||
'wap.rengzu.com',
|
||||
'www.tlclw.com',
|
||||
'wap.tlclw.com',
|
||||
'live.ybw1666.com',
|
||||
'wap.ybw1666.com',
|
||||
'www.inke.cn',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user