has verified parameter added
This commit is contained in:
parent
5d6b9167ed
commit
704ddd303a
@ -65,7 +65,7 @@ export async function video_basic_info(url: string, options: InfoOptions = {}) {
|
|||||||
if (yt_validate(url) !== 'video') throw new Error('This is not a YouTube Watch URL');
|
if (yt_validate(url) !== 'video') throw new Error('This is not a YouTube Watch URL');
|
||||||
video_id = extractID(url);
|
video_id = extractID(url);
|
||||||
} else video_id = url;
|
} else video_id = url;
|
||||||
const new_url = `https://www.youtube.com/watch?v=${video_id}`;
|
const new_url = `https://www.youtube.com/watch?v=${video_id}&has_verified=1`;
|
||||||
const body = await request(new_url, {
|
const body = await request(new_url, {
|
||||||
proxies: options.proxy ?? [],
|
proxies: options.proxy ?? [],
|
||||||
headers: options.cookie
|
headers: options.cookie
|
||||||
|
|||||||
@ -173,9 +173,9 @@ export function parsePlaylist(data?: any): YouTubePlayList {
|
|||||||
].width
|
].width
|
||||||
},
|
},
|
||||||
channel: {
|
channel: {
|
||||||
id: data.playlistRenderer.shortBylineText.runs[0].navigationEndpoint.browseEndpoint.browseId,
|
id: data.playlistRenderer.shortBylineText.runs?.[0].navigationEndpoint.browseEndpoint.browseId,
|
||||||
name: data.playlistRenderer.shortBylineText.runs[0].text,
|
name: data.playlistRenderer.shortBylineText.runs?.[0].text,
|
||||||
url: `https://www.youtube.com${data.playlistRenderer.shortBylineText.runs[0].navigationEndpoint.commandMetadata.webCommandMetadata.url}`
|
url: `https://www.youtube.com${data.playlistRenderer.shortBylineText.runs?.[0].navigationEndpoint.commandMetadata.webCommandMetadata.url}`
|
||||||
},
|
},
|
||||||
videos: parseInt(data.playlistRenderer.videoCount.replace(/[^0-9]/g, ''))
|
videos: parseInt(data.playlistRenderer.videoCount.replace(/[^0-9]/g, ''))
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user