mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Fixed Playlist toJSON function
This commit is contained in:
@@ -49,17 +49,17 @@ export function setCookieToken(options: { cookie: string }) {
|
||||
|
||||
/**
|
||||
* Updates cookies locally either in file or in memory.
|
||||
*
|
||||
*
|
||||
* Example
|
||||
* ```ts
|
||||
* const response = ... // Any https package get function.
|
||||
*
|
||||
*
|
||||
* play.cookieHeaders(response.headers['set-cookie'])
|
||||
* ```
|
||||
* ```
|
||||
* @param headCookie response headers['set-cookie'] array
|
||||
* @returns Nothing
|
||||
*/
|
||||
export function cookieHeaders(headCookie: string[]): void {
|
||||
export function cookieHeaders(headCookie: string[]): void {
|
||||
if (!youtubeData?.cookie) return;
|
||||
headCookie.forEach((x: string) => {
|
||||
x.split(';').forEach((z) => {
|
||||
|
||||
@@ -128,7 +128,8 @@ export async function video_basic_info(url: string, options: InfoOptions = {}):
|
||||
cookies: true
|
||||
});
|
||||
}
|
||||
if (body.indexOf('Our systems have detected unusual traffic from your computer network.') !== -1) throw new Error('Captcha page: YouTube has detected that you are a bot!');
|
||||
if (body.indexOf('Our systems have detected unusual traffic from your computer network.') !== -1)
|
||||
throw new Error('Captcha page: YouTube has detected that you are a bot!');
|
||||
const player_data = body
|
||||
.split('var ytInitialPlayerResponse = ')?.[1]
|
||||
?.split(';</script>')[0]
|
||||
|
||||
Reference in New Issue
Block a user