Open kysage1 opened 4 days ago
Thank you for your report. What code are you implementing? Also, can you tell me if this error occurs in all videos or only in some of them?
Thank you for your report. What code are you implementing? Also, can you tell me if this error occurs in all videos or only in some of them?
sorry below is my code...and this occurs in all videos
case 'dl': {
if (!text) {
return m.reply("Provide a search term!");
}
try {
const searchResults = await yts(args.join(" "));
const firstResult = searchResults.all.find(result => result?.videoId);
if (!firstResult) {
return m.reply("No valid results found for your search.");
}
const { videoId, title, timestamp, thumbnail } = firstResult;
const caption = `🎵 Title: ${title}\n⌛ Duration: ${timestamp}`;
const imageOptions = { url: thumbnail };
await client.sendMessage(from, { image: imageOptions, caption: caption }, { quoted: m });
const ytdl = new YtdlCore({
oauth2Credentials: {
accessToken: accessToken,
refreshToken: refreshToken,
expiryDate: expiryDate,
},
logDisplay: ["debug", "info", "success", "warning", "error"],
});
const videoInfo = await ytdl.getFullInfo(`https://www.youtube.com/watch?v=${videoId}`);
const stream = ytdl.downloadFromInfo(videoInfo, {
filter: "audioonly",
quality: 'lowestaudio'
});
const getRandom = (ext) => `${Math.floor(Math.random() * 10000)}${ext}`;
const filePath = `Del/${getRandom('.mp3')}`;
const downloadAudio = (stream, filePath) => {
return new Promise((resolve, reject) => {
const writer = fs.createWriteStream(filePath);
stream.pipe(writer);
writer.on("finish", () => {
writer.close();
resolve();
});
writer.on("error", reject);
});
};
await downloadAudio(stream, filePath);
console.log("Download Complete!");
await client.sendMessage(from, { audio: { url: filePath }, mimetype: "audio/mpeg" }, { quoted: m });
} catch (error) {
console.error("An error occurred:", error);
m.reply("An error occurred while processing your request.");
}
}
Basically, bot errors can be remedied by specifying OAuth2 or PoToken (which is automatically generated), so IP is most likely prohibited. To improve this, we recommend specifying OriginalProxy or using some other method to disguise the IP address, etc.
Basicamente, os erros de bot podem ser corrigidos especificando OAuth2 ou PoToken (que é gerado automaticamente), portanto, o IP provavelmente é proibido. Para melhorar isso, recomendamos especificar OriginalProxy ou usar algum outro método para disfarçar o endereço IP, etc.
Envie o código funcional por favor
Basicamente, os erros de bot podem ser corrigidos especificando OAuth2 ou PoToken (que é gerado automaticamente), portanto, o IP provavelmente é proibido. Para melhorar isso, recomendamos especificar OriginalProxy ou usar algum outro método para disfarçar o endereço IP, etc.
Envie o código funcional por favor
See examples. (examples/Default/OriginalProxy/)
Basicamente, os erros de bot podem ser corrigidos especificando OAuth2 ou PoToken (que é gerado automaticamente), portanto, o IP provavelmente é proibido. Para melhorar isso, recomendamos especificar OriginalProxy ou usar algum outro método para disfarçar o endereço IP, etc.
Envie o código funcional por favor
See examples. (examples/Default/OriginalProxy/)
what might be wrong in this....
I implimented proxy and I hot this error
Error checking for updates: The "options.agent" property must be one of Agent-like Object, undefined,
or false. Received an instance of ProxyAgent
0|botmo | [ WARNING ]: It can be disabled by setting noUpdate
to true
in the YtdlCore options.
0|botmo | [ INFO! ]: As a fallback to obtain the minimum information, the web client is forced to adapt.
0|botmo | [ ERROR ]: All player APIs responded with an error. (Clients: web, webCreator, tvEmbedded, ios, android)
0|botmo | For details, specify logDisplay: ["debug", "info", "success", "warning", "error"]
in the constructor options of the YtdlCore class.
0|botmo | [ INFO! ]: Only minimal information is available,
as information from the Player API is not available.
0|botmo | An error occurred: TypeError: Cannot read properties of undefined (reading 'videoDetails')
0|botmo | at _getBasicInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:11157)
0|botmo | at async _getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:25536)
0|botmo | at async getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:26490)
0|botmo | at async spike (/root/client/spike.js:791:27)
This is my code
case 'dl': {
if (!text) {
return m.reply("Provide a search term!");
}
try {
const searchResults = await yts(args.join(" "));
const firstResult = searchResults.all.find(result => result?.videoId);
if (!firstResult) {
return m.reply("No valid results found for your search.");
}
const { videoId, title, timestamp, thumbnail } = firstResult;
const caption = `🎵 Title: ${title}\n⌛ Duration: ${timestamp}`;
const imageOptions = { url: thumbnail };
await client.sendMessage(from, { image: imageOptions, caption: caption }, { quoted: m });
const proxies = fs.readFileSync('./proxy.txt', 'utf-8').split('\n').filter(Boolean);
const randomProxy = proxies[Math.floor(Math.random() * proxies.length)];
const AGENT = new ProxyAgent(randomProxy);
const ytdl = new YtdlCore({
disablePoTokenAutoGeneration: true,
fetcher: async (url, options) => {
const REQUEST_OPTIONS = {
...options,
agent: AGENT,
headers: {
...options.headers,
'Cookie': '',
},
credentials: 'omit'
};
return fetch(url, REQUEST_OPTIONS);
},
});
const videoInfo = await ytdl.getFullInfo(`https://www.youtube.com/watch?v=${videoId}`);
const stream = ytdl.downloadFromInfo(videoInfo, {
filter: "audioonly",
quality: 'lowestaudio'
});
const getRandom = (ext) => `${Math.floor(Math.random() * 10000)}${ext}`;
const filePath = `Del/${getRandom('.mp3')}`;
const downloadAudio = (stream, filePath) => {
return new Promise((resolve, reject) => {
const writer = fs.createWriteStream(filePath);
stream.pipe(writer);
writer.on("finish", () => {
writer.close();
resolve();
});
writer.on("error", reject);
});
};
await downloadAudio(stream, filePath);
console.log("Download Complete!");
await client.sendMessage(from, { audio: { url: filePath }, mimetype: "audio/mpeg" }, { quoted: m });
fs.unlinkSync(filePath);
} catch (error) {
console.error("An error occurred:", error);
m.reply("An error occurred while processing your request.");
}
}
if you are using undici, use dispatcher: AGENT
instead of agent: AGENT
.
(Example: examples/Default/Proxy/src/index.js)
if you are using undici, use
dispatcher: AGENT
instead ofagent: AGENT
. (Example: examples/Default/Proxy/src/index.js)
I did that....but this error again😑
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player"
was available.
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "poToken" was
available.
0|botmo | [ DEBUG ]: [ Request ]: GET -> https://raw.githubusercontent.com/ybd-project-ver1/ytdl-core/dev/package.json
0|botmo | [ DEBUG ]: [ FileCache ]: "poToken" is cached.
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player"
was available.
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player"
was available.
0|botmo | [ WARNING ]: Specify poToken for stable and fast operation. See README for details.
0|botmo | [ INFO! ]: Automatically generates poToken, but stable operation cannot be guaranteed.
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "visitorData"
was available.
0|botmo | [ WARNING ]: At least one client must be specified.
0|botmo | [ DEBUG ]: [ FileCache ]: "visitorData" is cached.0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false
0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc&prettyPrint=false&id=YQHsXMglC9A&t=QBYHWWqgz3BA
0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?prettyPrint=false
0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?prettyPrint=false
0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player"
was available.
0|botmo | [ DEBUG ]: [ FileCache ]: "oauth2" is cached.
0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false
0|botmo | [ DEBUG ]: Since PoToken and VisitorData are not specified, they are generated automatically.
0|botmo | [ DEBUG ]: [ FileCache ]: "poToken" is cached.
0|botmo | [ DEBUG ]: [ FileCache ]: "visitorData" is cached.0|botmo | [ DEBUG ]: [ Web ]: Error (Reason: Sign in to confirm you’re not a bot)
0|botmo | [ DEBUG ]: [ MWeb ]: Error (Reason: Sign in to confirm you’re not a bot)
0|botmo | [ DEBUG ]: [ Tv ]: Error (Reason: Sign in to confirm you’re not a bot)
0|botmo | [ DEBUG ]: [ Ios ]: Error (Reason: Sign in to confirm you’re not a bot)
0|botmo | An error occurred: UnrecoverableError: All player APIs responded with an error. (Clients: web, mweb, tv, ios)
0|botmo | For details, specify logDisplay: ["debug", "info", "success", "warning", "error"]
in the constructor options of the YtdlCore class.
0|botmo | Note: This error cannot continue processing. (Details: "Sign in to confirm you’re not a bot")
0|botmo | at PlayerApi.getApiResponses (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:913:174)
0|botmo | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
0|botmo | at async _getBasicInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:914:10600)
0|botmo | at async _getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:914:25625)
0|botmo | at async getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:914:26606)
0|botmo | at async spike (/root/client/spike.js:781:27) {
0|botmo | playabilityStatus: 'Sign in to confirm you’re not
a bot'
0|botmo | }
0|botmo | [ DEBUG ]: The specified OAuth2 token is valid.
0|botmo | [ DEBUG ]: [ Next ]: Success
Describe the bug
Even using Oauth2 I'm getting the Error Please sign in...I'm not sure if it's an error in my code or not.
Error Details (Log)
0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "poToken" was available. 0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "visitorData" was available. 0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "oauth2" was available. 0|botmo | [ DEBUG ]: Since PoToken and VisitorData are not specified, they are generated automatically. 0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player" was available. 0|botmo | [ DEBUG ]: [ Request ]: GET -> https://raw.githubusercontent.com/ybd-project-ver1/ytdl-core/dev/package.json 0|botmo | [ DEBUG ]: [ FileCache ]: "poToken" is cached. 0|botmo | [ DEBUG ]: [ FileCache ]: "visitorData" is cached.0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player" was available. 0|botmo | [ DEBUG ]: [ FileCache ]: "oauth2" is cached. 0|botmo | [ DEBUG ]: [ FileCache ]: "poToken" is cached. 0|botmo | [ DEBUG ]: [ FileCache ]: "visitorData" is cached.0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player" was available. 0|botmo | [ DEBUG ]: [ FileCache ]: Cache key "html5Player" was available. 0|botmo | [ WARNING ]: Specify poToken for stable and fast operation. See README for details. 0|botmo | [ INFO! ]: Automatically generates poToken, but stable operation cannot be guaranteed. 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyBUPetSUmoZL-OhlxA7wSac5XinrygCqMo&prettyPrint=false 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?prettyPrint=false 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyB-63vPrdThhKuerbB2N_l7Kwwcxj6yUAc&prettyPrint=false&id=YQHsXMglC9A&t=SeIwnGgKTuQG 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/player?key=AIzaSyA8eiZmM1FaDVjRy-df2KTyQ_vz_yYM39w&prettyPrint=false&id=YQHsXMglC9A&t=7en-3ieNlaZH 0|botmo | [ DEBUG ]: [ Request ]: POST -> https://www.youtube.com/youtubei/v1/next?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false 0|botmo | [ DEBUG ]: The specified OAuth2 token is valid. 0|botmo | [ DEBUG ]: [ web ]: Error 0|botmo | Reason: Sign in to confirm you’re not a bot 0|botmo | [ DEBUG ]: [ webCreator ]: Error 0|botmo | Reason: Please sign in 0|botmo | [ DEBUG ]: [ tvEmbedded ]: Error 0|botmo | Reason: Please sign in 0|botmo | [ DEBUG ]: [ ios ]: Error 0|botmo | Reason: Sign in to confirm you’re not a bot 0|botmo | [ DEBUG ]: [ android ]: Error 0|botmo | Reason: Sign in to confirm you’re not a bot 0|botmo | An error occurred: UnrecoverableError: All player APIs responded with an error. (Clients: web, webCreator, tvEmbedded, ios, android) 0|botmo | For details, specify
logDisplay: ["debug", "info", "success", "warning", "error"]
in the constructor options of the YtdlCore class. 0|botmo | Note: This error cannot continue processing. (Details: "Sign in to confirm you’re not a bot") 0|botmo | at PlayerApi.getApiResponses (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:883:174) 0|botmo | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 0|botmo | at async _getBasicInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:10702) 0|botmo | at async _getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:25536) 0|botmo | at async getFullInfo (/root/client/node_modules/@ybd-project/ytdl-core/bundle/node.cjs:884:26490) 0|botmo | at async spike (/root/client/spike.js:778:27) { 0|botmo | playabilityStatus: 'Sign in to confirm you’re not a bot' 0|botmo | } 0|botmo | [ DEBUG ]: [ web ]: SuccessEnvironment