Closed Xing-Deal closed 2 weeks ago
Same here :X
use cookies bro
use cookies, cara
Não sei como adicionar, você pode me enviar sua case sem o token?
use cookies, cara
Não sei como adicionar, você pode me enviar sua case sem o token?
I just followed the instructions in the README, and it worked for me.
Use cookies, cara
Não sei como adicionar, você pode me enviar sua case sem o token?
Eu apenas segui as instruções no README e funcionou para mim.
Envie aqui sua função completa pra eu testar na minha máquina
Apenas a função, os cookies eu consigo encontrar
const cookies = [....]
const agent = distube.createAgent(cookies);
exports.audioOnly = async (req, res) => { const { videoId } = req.query; let info = await distube.getInfo(videoId, { agent }); let audioFormats = distube.filterFormats(info.formats, "audioonly"); res.json(audioFormats); };
const cookies = [....]
const agente = distube.createAgent(cookies);
exports.audioOnly = async (req, res) => { const { videoId } = req.query; let info = await distube.getInfo(videoId, { agent }); let audioFormats = distube.filterFormats(info.formats, "audioonly"); res.json(audioFormats); };
Envia a função completa por favor, da case ao break, ficarei grato!
Where can I get a cookie? to use in the example
Where can I get a cookie? to use in the example
Thank you bro, I will try this.
I just tested, cookies works, but any idea how long does the cookies work?
Acabei de testar, os cookies funcionam, mas alguma ideia de quanto tempo os cookies funcionam?
Me envia aí mano sua função adaptada com os cookies pra eu ver como fica, não consegui adaptar no meu! Não precisa enviar seus cookies
Well I did about the cookies, it works in my local, but in the server isn't work I have the same error, i did the same steps that in the documentation
Acabei de testar, os cookies funcionam, mas alguma ideia de quanto tempo os cookies funcionam?
Me envia aí mano sua função adaptada com os cookies pra eu ver como fica, não consegui adaptar no meu! Não precisa enviar seus cookies
Aquí encontré un código que usa las cookies y si me funcionó. Ejemplo
Well I did about the cookies, it works in my local, but in the server isn't work I have the same error, i did the same steps that in the documentation
In my case, I used a proxy like 152.26.229.66:9443 to address this issue. (#70) However, it does slow down the processing speed a bit.
Well I did about the cookies, it works in my local, but in the server isn't work I have the same error, i did the same steps that in the documentation
Same here
@EAxelGM Adding the referer works for me.
const agentOptions = {
headers: {
referer: 'https://www.youtube.com/',
},
};
const agent = ytdl.createAgent(cookies, agentOptions);
@EAxelGM Adding the referer works for me.
const agentOptions = { headers: { referer: 'https://www.youtube.com/', }, }; const agent = ytdl.createAgent(cookies, agentOptions);
I did the following, but it does not work on my Glitch server.
const agentOptions = {
headers: {
referer: "https://www.youtube.com/",
},
},
agent = ytdl.createAgent(cookies, agentOptions);
const info = await ytdl.getInfo(url, { agent });
@ybd-project Male sure to get the cookies while in incognito and then close the browser, do not log out
Went through the steps to get the cookies through incognito mode, used known good working proxies and still having the issue:
As mentioned above by another user, It works on my local machine but not on my server. Now I can assume it's something to do with whom I'm hosting with. But shouldn't the proxies fix that?
@ybd-project Male sure to get the cookies while in incognito and then close the browser, do not log out
Cookies still do not work as expected and only work locally. For non-local use, using a proxy is the most promising solution at this time.
Update: I am looking for proxies that can be used successfully. But there are very few of these, only about 10 at this time. (Proxies like 152.26.xxx.xx:9443 are competent because they are fast and work correctly.)
I have try, and it working fine Step 1, Go to :https://chrome.google.com/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg and install it; Step 2, Go to Youtube, then login,next in icon EditCookie, choose export data ; Step 3 Paste cookie to file: cookies.json in root project NestJS Code:
import * as ytdl from '@distube/ytdl-core';
import axios from 'axios';
import * as fs from 'fs';
import * as path from 'path';
export class YouTubeService implements OnModuleInit {
constructor() {
super();
}
}
private agent: ytdl.Agent;
onModuleInit() {
this.initializeAgent();
}
private initializeAgent() {
const cookiesPath = path.join(__dirname, '..', 'cookies.json');
const cookiesContent = fs.readFileSync(cookiesPath, 'utf8');
this.agent = ytdl.createAgent(JSON.parse(cookiesContent));
}
getAgent(): ytdl.Agent {
return this.agent;
}
protected async downloadYoutube(youtubeLink: any, ipAddress: string) {
try {
if (!ytdl.validateURL(youtubeLink)) {
throw new Error('Youtube url not invalid');
}
const agent = await this.getAgent();
const info = await ytdl.getInfo(youtubeLink, { agent });
const videoFormat = ytdl.chooseFormat(info.formats, {
quality: 'highestvideo',
filter: 'videoandaudio',
});
if (videoFormat && videoFormat.container === 'mp4') {
return {
title: info.videoDetails.title,
channelId: info.videoDetails.channelId,
artist: info.videoDetails.author.name,
verified: info.videoDetails.author.verified,
category: info.videoDetails.category,
description: info.videoDetails.description,
keywords: info.videoDetails.keywords,
thumbnails: info.videoDetails.thumbnails
};
} else {
throw new Error('Error');
}
} catch (err) {
return {
message: 'Server error',
error: err.message,
};
}
}
I have try, and it working fine Step 1, Go to :https://chrome.google.com/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg and install it; Step 2, Go to Youtube, then login,next in icon EditCookie, choose export data ; Step 3 Paste cookie to file: cookies.json in root project NestJS Code:
Thank you very much, I will try it. But using the cookie does not work in my environment (Glitch server). I got the cookie from EditThisCookie and pasted it as is without editing, but no luck.
use cookies bro
doing this and not working, is there a specific way to do this?
use cookies bro
doing this and not working, is there a specific way to do this?
Cookies do not work well, so we use proxies instead.
Glitch server)
I you no have mysql or sql server database, I think you should try use server vercel ^^
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
use cookies bro
doing this and not working, is there a specific way to do this?
Cookies do not work well, so we use proxies instead.
how do i use proxies?
Like how do i get a proxy url to use
Glitch server)
I you no have mysql or sql server database, I think you should try use server vercel ^^
i was using vercel server all this while it was working, it stopped today
how do i use proxies?
Implement as follows Specify 152.26.229.66:9443 for the proxy IP.
const ytdl = require('@distube/ytdl-core');
const url = 'https://www.youtube.com/watch?v=' + videoId;
const agent = ytdl.createProxyAgent({
uri: "http://" + proxyIp,
});
const info = await ytdl.getInfo(url, {
agent,
});
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
how do i use proxies?
Implement as follows Specify 152.26.229.66:9443 for the proxy IP.
const ytdl = require('@distube/ytdl-core'); const url = 'https://www.youtube.com/watch?v=' + videoId; const agent = ytdl.createProxyAgent({ uri: "http://" + proxyIp, }); const info = await ytdl.getInfo(url, { agent, });
thanks dude let me try it
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^
Very nice. I am curious how you implement it.
how do i use proxies?
Implement as follows Specify 152.26.229.66:9443 for the proxy IP.
const ytdl = require('@distube/ytdl-core'); const url = 'https://www.youtube.com/watch?v=' + videoId; const agent = ytdl.createProxyAgent({ uri: "http://" + proxyIp, }); const info = await ytdl.getInfo(url, { agent, });
this proxy doesn't work locally i get connect timeout error
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^
Very nice. I am curious how you implement it.
As I have said above, I do steps bellow : Step 1, Go to :https://chrome.google.com/webstore/detail/fngmhnnpilhplaeedifhccceomclgfbg and install it; Step 2, Go to Youtube, then login,next in icon EditCookie, choose export data ; Step 3 Paste cookie to file: cookies.json in root project NestJS Code:
import * as ytdl from '@distube/ytdl-core';
import axios from 'axios';
import * as fs from 'fs';
import * as path from 'path';
export class YouTubeService implements OnModuleInit {
constructor() {
super();
}
}
private agent: ytdl.Agent;
onModuleInit() {
this.initializeAgent();
}
private initializeAgent() {
const cookiesPath = path.join(__dirname, '..', 'cookies.json');
const cookiesContent = fs.readFileSync(cookiesPath, 'utf8');
this.agent = ytdl.createAgent(JSON.parse(cookiesContent));
}
getAgent(): ytdl.Agent {
return this.agent;
}
protected async downloadYoutube(youtubeLink: any, ipAddress: string) {
try {
if (!ytdl.validateURL(youtubeLink)) {
throw new Error('Youtube url not invalid');
}
const agent = await this.getAgent();
const info = await ytdl.getInfo(youtubeLink, { agent });
const videoFormat = ytdl.chooseFormat(info.formats, {
quality: 'highestvideo',
filter: 'videoandaudio',
});
if (videoFormat && videoFormat.container === 'mp4') {
return {
title: info.videoDetails.title,
channelId: info.videoDetails.channelId,
artist: info.videoDetails.author.name,
verified: info.videoDetails.author.verified,
category: info.videoDetails.category,
description: info.videoDetails.description,
keywords: info.videoDetails.keywords,
thumbnails: info.videoDetails.thumbnails
};
} else {
throw new Error('Error');
}
} catch (err) {
return {
message: 'Server error',
error: err.message,
};
}
}
My Server : VPS or Vercel
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
Can you have give me id youtube ?
this proxy doesn't work locally i get connect timeout error
Indeed, locally the proxy does not work... However, I don't know why, but it works when deployed to Glitch, etc.
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
Try this one 11JI_2dQZqU
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
Try this one 11JI_2dQZqU
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
Try this one 11JI_2dQZqU
Local or server? I try before, 403
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
Try this one 11JI_2dQZqU
Oh some video HD, FULL HD url get error 403
I you no have mysql or sql server database, I think you should try use server vercel ^^
I had deployed an app with ytdl-core to a serverless function in Vercel, but this error prevented it from working. I tried changing cookies, creating a new account, etc., but it did not work and now using a proxy is working.
You can have check my API at here : https://api.phuongmychi.vn/v3/video-stream?id=cSofAIqJ7mE ^^ This is API temp, I will delete it after 2 hour
But, still can't bypass 403 the url video/audio
oh let me check
Try this one 11JI_2dQZqU
Oh some video HD, FULL HD url get error 403
Try the audio also
this proxy doesn't work locally i get connect timeout error
Indeed, locally the proxy does not work... However, I don't know why, but it works when deployed to Glitch, etc.
ok, i wanna deploy to vercel and render i hope it works there if not i don't know what else to do
Try the audio also
Try the audio also
Yess, it works
Describe the bug
Debug File
Environment