's'
This commit is contained in:
@@ -43,6 +43,19 @@ export function extractDouyinLiveUrls(urlIni: string): string[] {
|
||||
return Array.from(new Set(out)).slice(0, 16);
|
||||
}
|
||||
|
||||
/** 从进程日志中解析「当前」抖音房间号(取文本中最后一次出现的 live.douyin.com/xxx) */
|
||||
export function extractDouyinCurrentRoomFromLog(logText: string): string | null {
|
||||
if (!logText) return null;
|
||||
let last: string | null = null;
|
||||
for (const line of logText.split(/\r?\n/)) {
|
||||
const m = line.match(/live\.douyin\.com\/([a-zA-Z0-9_-]+)/i);
|
||||
if (m) last = m[1];
|
||||
const m2 = line.match(/https?:\/\/[^/\s]*douyin\.com\/(\d{8,})/i);
|
||||
if (m2) last = m2[1];
|
||||
}
|
||||
return last;
|
||||
}
|
||||
|
||||
/** URL_config 文本中提取抖音房间线索(与 d2y electron 一致) */
|
||||
export function extractDouyinRoomHints(urlIni: string): string[] {
|
||||
const out: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user