Skip to content

Commit

Permalink
feat: add vvxqiu live record
Browse files Browse the repository at this point in the history
  • Loading branch information
ihmily committed Oct 14, 2024
1 parent c75b5e7 commit 5ffce76
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ yinbo_cookie =
yingke_cookie =
zhihu_cookie =
chzzk_cookie =
haixiu_cookie =
vvxqiu_cookie =

[Authorization]
popkontv_token =
Expand Down
5 changes: 5 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
"haixiu": {
"url": "https://www.haixiutv.com/6095106",
"func": spider.get_haixiu_stream_url,
},
"vvxqiu": {
"url": "https://h5webcdn-pro.vvxqiu.com//activity/videoShare/videoShare.html?h5Server=https://h5p.vvxqiu.com"
"&roomId=LP115924473&platformId=vvstar",
"func": spider.get_vvxqiu_stream_url,
}
}

Expand Down
30 changes: 30 additions & 0 deletions douyinliverecorder/spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,4 +2585,34 @@ def get_haixiu_stream_url(url: str, proxy_addr: Union[str, None] = None, cookies
flv_url = stream_data['media_url_web']
result['flv_url'] = flv_url
result['record_url'] = flv_url
return result


@trace_error_decorator
def get_vvxqiu_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 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
'Access-Control-Request-Method': 'GET',
'Origin': 'https://h5webcdn-pro.vvxqiu.com',
'Referer': 'https://h5webcdn-pro.vvxqiu.com/',
}

if cookies:
headers['Cookie'] = cookies

room_id = get_params(url, "roomId")
api_1 = f'https://h5p.vvxqiu.com/activity-center/fanclub/activity/captain/banner?roomId={room_id}&product=vvstar'
json_str = get_req(api_1, proxy_addr=proxy_addr, headers=headers)
json_data = json.loads(json_str)
anchor_name = json_data['data']['anchorName']
result = {
"anchor_name": anchor_name,
"is_live": False,
}
if json_data['data']['anchorRank'] != 0:
result["is_live"] = True
m3u8_url = f'https://liveplay-pro.wasaixiu.com/live/1400442770_{room_id}_{room_id[2:]}_single.m3u8'
result['m3u8_url'] = m3u8_url
result['record_url'] = m3u8_url
return result
12 changes: 10 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

version = "v3.0.9"
platforms = ("\n国内站点:抖音|快手|虎牙|斗鱼|YY|B站|小红书|bigo|blued|网易CC|千度热播|猫耳FM|Look|TwitCasting|百度|微博|"
"酷狗|花椒|流星|Acfun|时光|映客|音播|知乎|嗨秀"
"酷狗|花椒|流星|Acfun|时光|映客|音播|知乎|嗨秀|VV星球"
"\n海外站点:TikTok|AfreecaTV|PandaTV|WinkTV|FlexTV|PopkonTV|TwitchTV|LiveMe|ShowRoom|CHZZK")

recording = set()
Expand Down Expand Up @@ -695,6 +695,12 @@ def start_record(url_data: tuple, count_variable: int = -1):
port_info = spider.get_haixiu_stream_url(
url=record_url, proxy_addr=proxy_address, cookies=haixiu_cookie)

elif record_url.find("h5webcdn-pro.vvxqiu.com/") > -1:
platform = 'VV星球'
with semaphore:
port_info = spider.get_vvxqiu_stream_url(
url=record_url, proxy_addr=proxy_address, cookies=vvxqiu_cookie)

else:
logger.error(f'{record_url} {platform}直播地址')
return
Expand Down Expand Up @@ -1423,6 +1429,7 @@ def read_config_value(config_parser: configparser.RawConfigParser, section: str,
zhihu_cookie = read_config_value(config, 'Cookie', 'zhihu_cookie', '')
chzzk_cookie = read_config_value(config, 'Cookie', 'chzzk_cookie', '')
haixiu_cookie = read_config_value(config, 'Cookie', 'haixiu_cookie', '')
vvxqiu_cookie = read_config_value(config, 'Cookie', 'vvxqiu_cookie', '')

video_save_type_list = ("FLV", "MKV", "TS", "MP4", "MP3音频", "M4A音频")
if video_save_type and video_save_type.upper() in video_save_type_list:
Expand Down Expand Up @@ -1512,7 +1519,8 @@ def contains_url(string: str) -> bool:
'wap.ybw1666.com',
'www.inke.cn',
'www.zhihu.com',
'www.haixiutv.com'
'www.haixiutv.com',
"h5webcdn-pro.vvxqiu.com"
]
overseas_platform_host = [
'www.tiktok.com',
Expand Down

0 comments on commit 5ffce76

Please sign in to comment.