mirror of
https://github.com/YuzuZensai/play-dl-test.git
synced 2026-01-31 14:58:05 +00:00
Cookies fixes
This commit is contained in:
@@ -183,10 +183,10 @@ export function authorization(): void {
|
||||
console.log('Cookies has been added successfully.');
|
||||
let cookie: Object = {};
|
||||
cook.split(';').forEach((x) => {
|
||||
let [ key, value ] = x.split('=')
|
||||
if(!value) return;
|
||||
key = key.trim()
|
||||
value = value.trim()
|
||||
const arr = x.split('=')
|
||||
if(arr.length <= 1 ) return;
|
||||
const key = arr.shift()?.trim() as string
|
||||
const value = arr.join('=').trim()
|
||||
Object.assign(cookie, { [key] : value })
|
||||
})
|
||||
fs.writeFileSync('.data/youtube.data', JSON.stringify({ cookie }, undefined, 4));
|
||||
|
||||
Reference in New Issue
Block a user