Seek error added + yt_validate fixed

This commit is contained in:
killer069
2021-12-14 11:31:14 +05:30
parent c1d8aedc5e
commit 1c3b7f812a
2 changed files with 3 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ export async function stream_from_info(
final[0].codec === 'opus' && final[0].container === 'webm' ? StreamType.WebmOpus : StreamType.Arbitrary;
if(options.seek){
if(type === StreamType.WebmOpus) {
if(options.seek >= info.video_details.durationInSec) throw new Error(`Seeking beyond limit. [0 - ${info.video_details.durationInSec - 1}]`)
return new SeekStream(
final[0].url,
info.video_details.durationInSec,