-
Notifications
You must be signed in to change notification settings - Fork 810
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
Is not working any more #945
Comments
can this be a dupe of #939 ? |
@TimeForANinja @yasahmed |
Just subscribe to release, they will do their update here. |
How to do that |
@vincenzo882: I'm not a maintainer, and I don't mean to come off rude, but this project is totally open-source. It's pretty much instant if you make it, otherwise, you are dependent on unpaid volunteer's free time. Nobody owes you free development, we're all in it together, and it's not helpful to be like "when will it be done?" a bunch. For people looking into this, here is a simplified function that also fails, but uses similar to current method: export const getVideoInfo = async (id, options = {}) => {
const url = new URL(`https://www.youtube.com/get_video_info`)
url.searchParams.set('video_id', id)
url.searchParams.set('eurl', `https://youtube.googleapis.com/v/${id}`)
url.searchParams.set('ps', 'default')
url.searchParams.set('gl', options.country || 'US')
url.searchParams.set('hl', options.lang || 'en')
url.searchParams.set('html5', '1')
const u = url.toString()
const r = await fetch(u)
console.log('URL', u)
console.log('REQUEST', r.status, await r.text())
}
In the context of a youtube player page, you can get lots of great info with this (including video URLS in Here is a quick function exploiting those things, which currently works: import fetch from 'node-fetch'
const regex = /var ytInitialPlayerResponse = (.+);<\/script>/gm
export async function getInfo (id) {
const r = await fetch(`https://www.youtube.com/watch?v=${id}`)
const str = await r.text()
const m = regex.exec(str)
if (m && m.length === 2){
return JSON.parse(m[1])
}
}
getInfo('K-281doxOMc')
.then(console.log) @fent if this seems like an ok direction, I can make a PR. It seems a bit fragile, like it will fail if they format their code some different way, but at least right this second, it seems to work. |
On further inspection, the not all of the video URLs it returns seem to actually open, so that might be a dead-path. |
Ah yes, sorry, I looked closer at the code. It grabs |
there is a reason we use multiple sources - just one is not reliable |
any solution? |
a fix has been implemented in #938, now you just gotta wait for the merger (or like me manually patch the lib) |
how do you "patch the lib"? and who is "lib"? where does he/she hang out? |
lol lib isn't a person, lib == library and i used |
Hi |
as i said new at this , but where to find "In node_modules/ytdl-core/lib/info.js" and wher do i get the "origin package" Latest that was released. |
In node_modules/ytdl-core/lib/info.js
Not me who found this out but it may be a temp fix until next version comes |
my "code files" don't under stand |
it's pretty simple, just follow the steps below:
this will make it so every time you run a npm/yarn install it automatically patches |
@regales I think my regex above does essentially the same thing, but is maybe a tiny bit more efficient. As far as I understand it, the problem is in another place, though. It's because the lib combines data from several different sources, and one of them is failing, so looking for As for patching, hand-editing your changes, and all that stuff, I personally would recommend against all this.
That is where the PR comes from ( The bonus of this method is it's very easy to go back to the official version, once the changes are published on npm:
Either one of those commands will save the version in your package.json, on modern versions of npm, so other users and your CI or whatever will have the changes. It's a way to record "it's working in this PR, so use that until it's published." |
@vincenzo882 not sure I follow. This isn't anyone's homework we're helping with, it's a library that lots of other projects depend on. I am 43 years old, and have been programming professionally for about 25 years. (not in college, or highschool or wherever else people have homework assignments.) I think maybe you are trying to be funny, but the sarcasm isn't really translating in text form, in a github issue queue.
Again, nobody owes you support or development or anything else. If they feel like providing it, lucky you, if not, then maybe pay someone for support. We are just all trying to make a cool library work for our projects that depend on it, that is what github issue queues are for.
Why are you in this issue queue, if it's an issue with a firefox plugin? Maybe you should go talk to them.
Ok. That addon has nothing to do with this library, other than depending on it. Go take it up with them. |
this has barely anything to do with ytdl-core as @konsumer said. if you're trying to be funny this isn't the right place buddy |
gonna close this as related to #939 and fixed with v4.8.3 |
this dependecy is not working any more formats object is empty now
The text was updated successfully, but these errors were encountered: