Open Xing-Deal opened 1 month ago
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
So far my app (Vercel Serverless Function) is working well with proxies. (It is unstable compared to before...) If the proxies listed before don't work, try the following IP addresses.
I just got the URL for the video from my API, so please test if you can view it.
Worked for me. Although made me want to throw up a little.
I just got the URL for the video from my API, so please test if you can view it.
Worked for me. Although made me want to throw up a little.
By using a proxy, I can avoid 403 errors, etc. But instead, the proxy is unstable, so my API is getting errors for about 20% of all requests... (processing is too slow and times out (15 seconds))
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
So far my app (Vercel Serverless Function) is working well with proxies. (It is unstable compared to before...) If the proxies listed before don't work, try the following IP addresses.
- 152.26.229.42:9443
- 152.26.229.66:9443
- 152.26.229.86:9443
- 152.26.229.88:9443
- 152.26.231.42:9443
- 152.26.231.77:9443
- 152.26.231.86:9443
- 177.234.241.25:999 (low speed)
- 177.234.241.26:999 (low speed)
- 177.234.241.27:999 (low speed)
- 177.234.241.30:999 (low speed)
the proxy works in vercel, but one of my routes get timed out, i'm checking out whether it will timeout on render now
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
So far my app (Vercel Serverless Function) is working well with proxies. (It is unstable compared to before...) If the proxies listed before don't work, try the following IP addresses.
- 152.26.229.42:9443
- 152.26.229.66:9443
- 152.26.229.86:9443
- 152.26.229.88:9443
- 152.26.231.42:9443
- 152.26.231.77:9443
- 152.26.231.86:9443
- 177.234.241.25:999 (low speed)
- 177.234.241.26:999 (low speed)
- 177.234.241.27:999 (low speed)
- 177.234.241.30:999 (low speed)
the proxy works in vercel, but one of my routes get timed out, i'm checking out whether it will timeout on render now
You should upgrade to vercel $20/month for setup timeout 30s, or optimize timeout 10s , because vercel free is 10s timeout
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
So far my app (Vercel Serverless Function) is working well with proxies. (It is unstable compared to before...) If the proxies listed before don't work, try the following IP addresses.
- 152.26.229.42:9443
- 152.26.229.66:9443
- 152.26.229.86:9443
- 152.26.229.88:9443
- 152.26.231.42:9443
- 152.26.231.77:9443
- 152.26.231.86:9443
- 177.234.241.25:999 (low speed)
- 177.234.241.26:999 (low speed)
- 177.234.241.27:999 (low speed)
- 177.234.241.30:999 (low speed)
the proxy works in vercel, but one of my routes get timed out, i'm checking out whether it will timeout on render now
You should upgrade to vercel $20/month for setup timeout 30s, or optimize timeout 10s , because vercel free is 10s timeout
as of the time i sent that message till now, even with the render url, the route is still loading, it hasn't error'ed but it is still loading so upgrading vercel won't work idk if i should just abandon it
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
So far my app (Vercel Serverless Function) is working well with proxies. (It is unstable compared to before...) If the proxies listed before don't work, try the following IP addresses.
- 152.26.229.42:9443
- 152.26.229.66:9443
- 152.26.229.86:9443
- 152.26.229.88:9443
- 152.26.231.42:9443
- 152.26.231.77:9443
- 152.26.231.86:9443
- 177.234.241.25:999 (low speed)
- 177.234.241.26:999 (low speed)
- 177.234.241.27:999 (low speed)
- 177.234.241.30:999 (low speed)
the proxy works in vercel, but one of my routes get timed out, i'm checking out whether it will timeout on render now
You should upgrade to vercel $20/month for setup timeout 30s, or optimize timeout 10s , because vercel free is 10s timeout
as of the time i sent that message till now, even with the render url, the route is still loading, it hasn't error'ed but it is still loading so upgrading vercel won't work idk if i should just abandon it
oh i think i know what is going on, the stream doesn't show even with proxy, only details
oh i think i know what is going on, the stream doesn't show even with proxy, only details
Can you show me the code you implemented?
oh i think i know what is going on, the stream doesn't show even with proxy, only details
Can you show me the code you implemented?
const agent = yt.createProxyAgent({
uri:"http://152.26.229.66:9443"
})
In the specific route:
const filter = req.query.filter === 'mp3' ? 'audioonly':'audioandvideo' ;
const stream = yt(req.query.link, { filter: filter, agent: agent})
let bytes = 0
stream.on("data", (chunk)=>{
bytes += chunk.length;
})
stream.on("end", ()=>{
console.log(bytes)
res.send(`${formatBytes(bytes)}`)
})
not working with cookie and proxy?
not working with cookie and proxy?
in proxy only info works
This probably depends on the internal internet speed of the server; the following implementation on a Glitch server works fine. Actual example: http://marsh-numerous-oak.glitch.me/chunk?ytid=dQw4w9WgXcQ (It will not be loaded immediately.)
const agent = ytdl.createProxyAgent({
uri: "http://152.26.229.66:9443",
});
const url = `http://www.youtube.com/watch?v=${youtubeid}`;
const stream = ytdl(url, {
filter: "videoandaudio",
agent,
requestOptions: {
headersTimeout: 1000 * 10, // 10 Seconds
bodyTimeout: 1000 * 10, // 10 Seconds
headers: {
referer: "https://www.youtube.com/",
},
},
});
res.setHeader("Content-Type", "video/mp4");
stream.on("data", (chunk) => {
// bytes += chunk.length;
res.write(chunk);
});
stream.on("end", () => {
// res.send(`${formatBytes(bytes)}`);
res.end();
});
Adding cookies did not work initially but then creating cookies with a youtube premium account worked.
Adding cookies did not work initially but then creating cookies with a youtube premium account worked.
Is the cookie running locally? Or is it running on a VPS (server)?
A função funciona sem cookies e sem proxies no termux, mas quando Upo para o servidor, já não funciona, alguém conhece algum outra função? Se conhecerem, por favor compartilhe conosco!
A função funciona sem cookies e sem proxies no termux, mas quando Upo para o servidor, já não funciona, alguém conhece algum outra função? Se conhecerem, por favor compartilhe conosco!
Is termux running locally? In most cases, it works properly locally.
A função funciona sem cookies e sem proxies no termux, mas quando Upo para o servidor, já não funciona, alguém conhece algum outra função? Se conhecerem, por favor compartilhe conosco!
O termux está sendo executado localmente? Na maioria dos casos, funciona corretamente localmente.
Sim, você conhece algum outro módulo?
Sim, você conhece algum outro módulo?
Please let me know what you would like to implement using ytdl-core. The example I provided is to stream video, so it may not work in some environments.
Hello, i was doing everything but my download from nuxt in the server
`//import ytdl from 'ytdl-core'; import ytdl from '@distube/ytdl-core'; import { sanitizeHeaderContent } from '~/utils'; import { cookiesUtil } from '~/utils/cookies';
export default defineEventHandler(async (event) => { const body = await readBody(event); const videoURL = body.url; // El parámetro 'url' se espera en la consulta if (!videoURL || !ytdl.validateURL(videoURL)) { throw { message: 'URL de video de YouTube no válida' }; }
const agent = ytdl.createAgent(cookiesUtil); const info = await ytdl.getInfo(videoURL, { agent }); const title = sanitizeHeaderContent(info.videoDetails.title); const format = ytdl.chooseFormat(info.formats, { quality: 'highest' });
event.res.setHeader('Content-Disposition', attachment; filename="${title}.mp4"
);
event.res.setHeader('filename', ${title}.mp4
);
const stream = ytdl(videoURL, {
format: format,
requestOptions: {
//maxReconnects: 5,
//maxRetries: 3,
highWaterMark: 1 << 25,
},
})
console.log("Download?")
return stream.pipe(event.res);
});
`
there is the my example, all is okay, show the console.log() but never end :c so never get the download
Hello, i was doing everything but my download from nuxt in the server there is the my example, all is okay, show the console.log() but never end :c so never get the download
I have looked at the code and it does not seem to use a proxy. So far the cookie only works locally in most cases.
Please change ytdl.createAgent
to ytdl.createProxyAgent({uri: 'http://152.26.229.66:9443'})
and try it.
In my case, it works by implementing it as shown in the image. (Server)
BROOOUUU Thank you so much! is some strange, because in my local does not working with proxies jajaja, but in the server yes, so thank you bro, this is in Nuxt Server, really works
For download Mp4
For download Mp3
Really thank you so much
Really thank you so much
You're welcome. There is one thing I am wondering about though. You commented out the format
in the stream
variable, which I don't think needs to be commented out.
const stream = ytdl(videoURL, {
//format: foramt, <- this
filter: ....
....
})
i try it with format
, but never download the video/music, so i comment the variable format
and works fine, idk what happens, but your code really works for me, and i hope work for other developers
i try it with
format
, but never download the video/music, so i comment the variableformat
and works fine, idk what happens, but your code really works for me, and i hope work for other developers
I see :) Keep up the good work!
Hi, I am currently using the following methods in our application: ytdl.getBasicInfo, ytdl.getInfo, ytdl.getURLVideoID, ytdl.downloadFromInfo, ytdl.filterFormats, and ytdl.chooseFormat. After implementing the suggested changes, we've encountered the following errors:
Thanks!
Hi, I am currently using the following methods in our application: ytdl.getBasicInfo, ytdl.getInfo, ytdl.getURLVideoID, ytdl.downloadFromInfo, ytdl.filterFormats, and ytdl.chooseFormat. After implementing the suggested changes, we've encountered the following errors:
- Without a proxy server: We receive an UnrecoverableError: Sign in to confirm you’re not a bot.
- With public proxies added: We encounter an UnrecoverableError: This video is unavailable.
- Intermittently: We are also seeing request timeout errors. Any assistance with resolving these issues would be greatly appreciated.
Thanks!
Can you tell me what code you are implementing or the IP address of the proxy you are using? Also, the timeout depends on the proxy, so I think the only way is to use a better proxy.
Hi, I am currently using the following methods in our application: ytdl.getBasicInfo, ytdl.getInfo, ytdl.getURLVideoID, ytdl.downloadFromInfo, ytdl.filterFormats, and ytdl.chooseFormat. After implementing the suggested changes, we've encountered the following errors:
- Without a proxy server: We receive an UnrecoverableError: Sign in to confirm you’re not a bot.
- With public proxies added: We encounter an UnrecoverableError: This video is unavailable.
- Intermittently: We are also seeing request timeout errors. Any assistance with resolving these issues would be greatly appreciated.
Thanks!
Can you tell me what code you are implementing or the IP address of the proxy you are using? Also, the timeout depends on the proxy, so I think the only way is to use a better proxy.
curl --location 'https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: vi,en;q=0.9,vi-VN;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-US;q=0.5' \
--header 'author: phuongmychimusic' \
--header 'origin: https://phuongmychi.vn'
You can try it, but some video/audio type webm is 403, else anything working fine
curl --location 'https://api.phuongmychi.vn/v3/video-stream?id=11JI_2dQZqU' \ --header 'accept: application/json, text/plain, */*' \ --header 'accept-language: vi,en;q=0.9,vi-VN;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-US;q=0.5' \ --header 'author: phuongmychimusic' \ --header 'origin: https://phuongmychi.vn'
You can try it, but some video/audio type webm is 403, else anything working fine
Thank you very much. Also, I noticed one important thing.
The query parameter for URLs that return 403 has c=ANDROID
set, and the URLs that can be viewed have c=IOS
set! The ones with c=ANDROID
set are almost all WebM codecs, and most, but not all, return 403.
Currently it is a good idea to exclude these.
Por favor, alguém pode corrigir essa função:
case 'p': { try { const agent = ytdl.createProxyAgent({ uri: "http://152.26.229.66:9443", });
const stream = ytdl("https://youtube.com/watch?v=" + firstResult.videoId, {
filter: "audioonly", //
agent,
requestOptions: {
headersTimeout: 1000 * 10,
bodyTimeout: 1000 * 10,
headers: {},
referer: "https://www.youtube.com/",
},
});
const VidName = await getRandom('.mp3');
const path = `Del/${VidName}`;
const writer = fs.createWriteStream(path);
stream.pipe(writer);
writer.on("finish", async () => {
writer.close();
console.log("Download Completed!");
await conn.sendMessage(from, { audio: { url: path }, mimetype: "audio/mpeg" }, { quoted: info });
await fs.unlinkSync(path);
});
} catch (error) {
console.error(error);
reply("Ocorreu um erro ao processar seu pedido.");
}
break;
}
Por favor, alguém pode corrigir essa função:
What error is occurring? Please provide details.
You can try it, but some video/audio type webm is 403, else anything working fine
Thank you very much. Also, I noticed one important thing. The query parameter for URLs that return 403 has
c=ANDROID
set, and the URLs that can be viewed havec=IOS
set! The ones withc=ANDROID
set are almost all WebM codecs, and most, but not all, return 403. Currently it is a good idea to exclude these.
URLs with the query parameter of c=ANDROID
are initially viewable, but after opening a URL with c=IOS
, the URL with c=ANDROID
stops working with a 403 and only the URL with c=IOS
works.
I don't think this is a coincidence.
Por favor, alguém pode corrigir essa função:
Que erro está ocorrendo? Por favor, forneça detalhes.
No servidor não aparece erro, porém não faz download do áudio. No local aparece esse erro:
Connect Timeout Error ConnectTimeoutError: Connect Timeout Error
Por favor, alguém pode corrigir essa função:
Que erro está ocorrendo? Por favor, forneça detalhes.
No servidor não aparece erro, porém não faz download do áudio. No local aparece esse erro:
Connect Timeout Error ConnectTimeoutError: Connect Timeout Error
I don't know why, but proxies do not work locally. Local is recommended to use cookies or some other method.
Por favor, alguém pode corrigir essa função:
Que erro está ocorrendo? Por favor, forneça detalhes.
No servidor não aparece erro, porém não faz download do áudio. No local aparece esse erro: Erro de tempo limite de conexão ConnectTimeoutError: Erro de tempo limite de conexão
Não sei por que, mas os proxies não funcionam localmente. Recomenda-se o uso de cookies ou algum outro método.
Mas no servidor também não está funcionando, não está dando resposta alguma
Mas no servidor também não está funcionando, não está dando resposta alguma
Then try another proxy.
Thank you very much. Also, I noticed one important thing. The query parameter for URLs that return 403 has
c=ANDROID
set, and the URLs that can be viewed havec=IOS
set! The ones withc=ANDROID
set are almost all WebM codecs, and most, but not all, return 403. Currently it is a good idea to exclude these.URLs with the query parameter of
c=ANDROID
are initially viewable, but after opening a URL withc=IOS
, the URL withc=ANDROID
stops working with a 403 and only the URL withc=IOS
works. I don't think this is a coincidence.
Update: Once opened, almost all URLs containing c=ANDROID
will return 403.
Mas no servidor também não está funcionando, não está dando resposta alguma
Em seguida, tente outro proxy.
- 152.26.229.42:9443
- 152.26.229.66:9443
- 152.26.229.86:9443
- 152.26.229.88:9443
- 152.26.231.42:9443
- 152.26.231.77:9443
- 152.26.231.86:9443
Nenhum fez o download do áudio, apenas criou áudios vazios dentro da pasta:
case 'p': {
const Results = await yts(args.join(" "));
const firstResult = Results.all[0];
try {
const proxies = [
"152.26.229.42:9443",
"152.26.229.66:9443",
"152.26.229.86:9443",
"152.26.229.88:9443",
"152.26.231.42:9443",
"152.26.231.77:9443",
"152.26.231.86:9443"
];
function getRandomProxy() {
const randomIndex = Math.floor(Math.random() proxies.length);
return proxies[randomIndex];
}
const proxyUri = getRandomProxy();
console.log("Usando proxy:", proxyUri);
const agent = ytdl.createProxyAgent({
uri: http://${proxyUri}
,
});
const stream = ytdl("https://youtube.com/watch?v=" + firstResult.videoId, {
filter: "audioonly",
agent,
requestOptions: {
headersTimeout: 1000 10,
bodyTimeout: 1000 * 10,
headers: {},
referer: "https://www.youtube.com/",
},
});
const VidName = await getRandom('.mp3');
const path = Del/${VidName}
;
const writer = fs.createWriteStream(path);
stream.pipe(writer);
writer.on("finish", async () => {
writer.close();
console.log("Download Completed!");
await conn.sendMessage(from, { audio: { url: path }, mimetype: "audio/mpeg" }, { quoted: info });
await fs.unlinkSync(path);
});
} catch (error) {
console.error(error);
reply("Ocorreu um erro ao processar seu pedido.");
}
break;
}
Nenhum fez o download do áudio, apenas criou áudios vazios dentro da pasta:
What is the value of the VidName
? Also, are you running that app on a server?
It is a Glitch server and works properly in the example I implemented. (Express)
https://marsh-numerous-oak.glitch.me/chunk?ytid=dQw4w9WgXcQ
const agent = ytdl.createProxyAgent({
uri: "http://152.26.229.66:9443",
});
const stream = ytdl(url, {
filter: "audioonly",
agent,
requestOptions: {
headersTimeout: 1000 * 10, // 10 Seconds
bodyTimeout: 1000 * 10, // 10 Seconds
headers: {
referer: "https://www.youtube.com/",
},
},
});
res.setHeader("Content-Type", "video/mp4");
stream.pipe(res);
Nenhum fez o download do áudio, apenas criou áudios vazios dentro da pasta:
Qual é o valor do ? Além disso, você está executando esse aplicativo em um servidor? É um servidor Glitch e funciona corretamente no exemplo que implementei. (Expresso) https://marsh-numerous-oak.glitch.me/chunk?ytid=dQw4w9WgXcQ`VidName`
const agent = ytdl.createProxyAgent({ uri: "http://152.26.229.66:9443", }); const stream = ytdl(url, { filter: "audioonly", agent, requestOptions: { headersTimeout: 1000 * 10, // 10 Seconds bodyTimeout: 1000 * 10, // 10 Seconds headers: { referer: "https://www.youtube.com/", }, }, }); res.setHeader("Content-Type", "video/mp4"); stream.pipe(res);
Uso na aws
Understood. Once you do, try to run the ytdl.getInfo function instead of the ytdl function. That should get you the URL of the audio. If you can open it successfully, then there is a problem with the file writing (fs).
ybd-project
Hello bro can you help to create yt-dl core api i am previously using node ytdl core api this one is not working last 1 month. I have my old api code and please upgrade it with new one. please help me and share your email address i send you my api code
Hello bro can you help to create yt-dl core api i am previously using node ytdl core api this one is not working last 1 month. I have my old api code and please upgrade it with new one. please help me and share your email address i send you my api code
I understand. I can help as I am also using ytdl-core to create an API. My email address is =========. Please contact me.
Hello bro can you help to create yt-dl core api i am previously using node ytdl core api this one is not working last 1 month. I have my old api code and please upgrade it with new one. please help me and share your email address i send you my api code
I understand. I can help as I am also using ytdl-core to create an API. My email address is ybd.project@gmail.com. Please contact me.
Please sir i send you my api code in your email please check it. and helo me to update the lastest distube ytdlcore code.
I checked the code. I can't work on it right now due to a few things, so it will be about 6 hours before I can send you the completed code.
I checked the code. I can't work on it right now due to a few things, so it will be about 6 hours before I can send you the completed code.
ok bro done i am waiting :) Thank you so much for cooperate with me
You're welcome. I'll do my best!
Many thanks to @ybd-project for the support and patience :'3
Many thanks to @ybd-project for the support and patience :'3
You you right bro very thankfull to this man
Many thanks to @ybd-project for the support and patience :'3
You you right bro very thankfull to this man
I have sent you the implemented code. Please check it.
Hello bro please see the email i have an error
Describe the bug
Debug File
Environment