Skip to content

Commit

Permalink
fix(tvp): match more tvp sport video urls
Browse files Browse the repository at this point in the history
  • Loading branch information
bpawel10 committed Mar 24, 2023
1 parent 43bf696 commit 3fde414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/tvp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ export class Tvp implements IVideo {
method: 'GET',
responseType: ResponseType.Text,
});
const [, videoId] = data.replace(/\s+/g, '').match(/"video_id":(\d+)/)!;

const [, , videoId] = data
.replace(/\s+/g, '')
.match(/"(video_id|_id)":(\d+)/)!;

const { data: json } = await fetch<Record<string, any>>(
`https://api.tvp.pl/tokenizer/token/${videoId}`,
);
Expand Down

0 comments on commit 3fde414

Please sign in to comment.