Skip to content

Commit

Permalink
fix: update stream id parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sawaYch committed Sep 3, 2024
1 parent 8e80739 commit c1f71db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next-youtube-livechat/src/libs/youtubeApiParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export function getOptionsFromLivePage(
): FetchOptions & { liveId: string } {
let liveId: string;
const idResult = data.match(
/<link rel="canonical" href="https:\/\/www.youtube.com\/watch\?v=(.+?)">/
/{"webCommandMetadata":{"url":"\/watch\?v=(.+?)","webPageType":/
);
if (idResult) {
liveId = idResult[1];
liveId = idResult[2];
} else {
throw new Error('Live Stream was not found');
}
Expand Down

0 comments on commit c1f71db

Please sign in to comment.