You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`import { readFileSync, writeFileSync, existsSync } from 'fs';
import { Innertube, UniversalCache } from 'youtubei.js';
import { DeleteLink } from './db/WaitList';
const creds_path = './client_secret.json';
const creds = existsSync(creds_path) ? JSON.parse(readFileSync(creds_path).toString()) : undefined;
export async function UploadShorts (filename:string,ShortTitle:string,desc:string | undefined,LinkID:string) {
const yt = await Innertube.create({ cache: new UniversalCache(false) });
yt.session.on('auth-pending', (data) => {
console.info(`Hello!\nOn your phone or computer, go to ${data.verification_url} and enter the code ${data.user_code}`);
});
yt.session.on('auth', (data) => {
writeFileSync(creds_path, JSON.stringify(data.credentials));
console.info('Successfully signed in!');
});
yt.session.on('update-credentials', (data) => {
writeFileSync(creds_path, JSON.stringify(data.credentials));
console.info('Credentials updated!', data);
});
await yt.session.signIn(creds);
const file = readFileSync('./ffmpeg-auto/'+filename+'.mp4');
console.log(`UPLOADING ...`);
try{
const upload = await yt.studio.upload(file.buffer, {
title: ShortTitle,
description: desc || hashtags,
privacy: 'PUBLIC'
});
console.info('Done!', upload);
if(upload.success){
console.log('Uploaded Succesfully')
await DeleteLink(LinkID);
return true
}else{
console.log('eerror while uploading')
return false
}
}catch(error){
console.log('Error While Uploading , '+error)
UploadShorts(filename,ShortTitle,desc,LinkID)
}
//delete file
}
Failure Logs
Successfully signed in!
UPLOADING ...
Error While Uploading , Error: Request to https://www.youtube.com/youtubei/vtrue/upload/createvideo?prettyPrint=false&alt=json failed with status 400
Expected behavior
Uploaded Succesfully + some metadata about the video
i've been testing this library for so long , everyday , this morning is the first time i see this issue
Current behavior
failed to fetch
Version
Default
Anything else?
.
Checklist
I am running the latest version.
I checked the documentation and found no answer.
I have searched the existing issues and made sure this is not a duplicate.
I have provided sufficient information.
The text was updated successfully, but these errors were encountered:
Having the same issue with a search request. Been working for years and just now it's broken. Seems like something has broken/changed on YouTube's end.
Steps to reproduce
example of code
Failure Logs
Expected behavior
Uploaded Succesfully + some metadata about the video
i've been testing this library for so long , everyday , this morning is the first time i see this issue
Current behavior
failed to fetch
Version
Default
Anything else?
.
Checklist
The text was updated successfully, but these errors were encountered: