Skip to content

Commit

Permalink
fix tiktok
Browse files Browse the repository at this point in the history
  • Loading branch information
jlvihv committed Jun 11, 2024
1 parent b63a82c commit 43dcc1a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib/platform/tiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export async function getLiveInfoForTiktok(url: string): Promise<LiveInfo> {
// 解析 html,填充 LiveInfo
function parseHtmlAndFillLiveInfo(html: string, info: LiveInfo) {
// match <script id="SIGI_STATE" type="application/json">(.*?)</script><script id="SIGI_RETRY" type="application/json">
let jsonStr = html.match(
/<script id="SIGI_STATE" type="application\/json">(.*?)<\/script><script id="SIGI_RETRY" type="application\/json">/
);
let jsonStr = html.match(/<script id="SIGI_STATE" type="application\/json">(.*?)<\/script>/);
if (!jsonStr || jsonStr.length < 2) {
throw new Error('can not match json string');
}
Expand Down

0 comments on commit 43dcc1a

Please sign in to comment.