-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LOGIN_REQUIRED #760
Comments
yes, i can confirm that the Trusted Session aka poToken solution isnt working anymore, even on Another Death Strike, using oAuth Tokens only working for few minutes.. Accounts get banned really quickly. |
Irmão vc tem alguma solução? Só preciso receber o áudio |
@tonykx please use English so others can understand you. |
How can I login to get the audio? It's ok if the Google account is banned. Please adapt it in my code |
@tonykx here's an example for oauth2 |
I left it like this here, but I noticed that it shows a date, meaning it will expire tomorrow, does anyone know what I can do? case 'playyy': {
} |
rustynail1984 if we subscribe to youtube premium then use its oauth token will it work? |
for some reason i cant play any video while i am logged in to an account i tried subscribing to premium still cant play anything. |
Steps to reproduce
Estou tendo esse problema, por favor, alguém pode verificar o que há de errado no meu código:
case 'playyy': {
try {
if (args.length < 1) {
return reply("Insira o comando, e em seguida um nome para a pesquisa!");
}
const { Innertube } = require('youtubei.js');
const youtube = await Innertube.create({
access_token: "x"
});
const searchResults = await youtube.search(args.join(" "));
if (!searchResults.results || searchResults.results.length === 0) {
return reply("Nenhum vídeo encontrado.");
}
const firstResult = searchResults.results[0];
const videoId = firstResult.id;
const videoInfo = await youtube.getBasicInfo(videoId);
const playabilityStatus = videoInfo.playability_status.status;
const message =
Título: ${firstResult.title.text}\n
+Autor: ${firstResult.author.name}\n
+Duração: ${firstResult.duration.text}\n
+Visualizações: ${firstResult.view_count.text}\n
+Publicado: ${firstResult.published.text}\n
+Link: https://www.youtube.com/watch?v=${videoId}
;await reply(message);
if (playabilityStatus === 'LOGIN_REQUIRED') {
return reply("Este vídeo requer login para acesso.");
}
const audioFormat = videoInfo.streaming_data?.formats?.find(format => format.mimeType.includes('audio/mp4'));
if (!audioFormat) {
return reply("Formato de áudio não encontrado.");
}
const audioUrl = audioFormat.decipher(youtube.session.player);
const vidName = await getRandom('.mp3');
const path =
Del/${vidName}
;const writer = fs.createWriteStream(path);
fetch(audioUrl, {
headers: {
'Authorization':
Bearer ${accessToken}
}
})
.then(res => {
if (!res.ok) {
throw new Error(
Erro na resposta do fetch: ${res.status} ${res.statusText}
);}
return res.body.pipe(writer);
})
.catch(err => {
return reply("Erro ao baixar o áudio.");
});
writer.on("finish", async () => {
await conn.sendMessage(from, { audio: { url: path }, mimetype: "audio/mpeg" }, { quoted: info });
await fs.unlinkSync(path);
});
}
Failure Logs
Expected behavior
Obter áudio
Current behavior
Obtenho as informações do vídeo, como título, link. Porém não estou conseguindo obter o áudio, pede autorização de login, veja se há algo de errado no meu código.
Version
Default
Anything else?
Se alguém puder corrigir, ficarei grato
Checklist
The text was updated successfully, but these errors were encountered: