Stream and Validate fixes

This commit is contained in:
killer069
2021-10-05 18:47:09 +05:30
parent f30c4f458b
commit 79419d2205
5 changed files with 137 additions and 59 deletions

View File

@@ -41,7 +41,7 @@ export function yt_validate(url: string): 'playlist' | 'video' | false {
if (Playlist_id.length !== 34 || !Playlist_id.startsWith('PL')) {
return false;
}
return 'playlist';
else return 'playlist';
}
}
/**
@@ -115,8 +115,8 @@ export async function video_basic_info(url: string, options: InfoOptions = {}) {
url: `https://www.youtube.com/watch?v=${vid.videoId}`,
title: vid.title,
description: vid.shortDescription,
duration: vid.lengthSeconds,
duration_raw: parseSeconds(vid.lengthSeconds),
duration: Number(vid.lengthSeconds),
duration_raw: parseSeconds(Number(vid.lengthSeconds)),
uploadedAt: microformat.publishDate,
thumbnail: vid.thumbnail.thumbnails[vid.thumbnail.thumbnails.length - 1],
channel: {