Skip to content

Commit

Permalink
fix: add parameters to get_video_info endpoint
Browse files Browse the repository at this point in the history
fixes 404 errors
  • Loading branch information
D3SOX authored Jun 19, 2021
1 parent 6320df0 commit d1f5357
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ const VIDEO_EURL = 'https://youtube.googleapis.com/v/';
const getVideoInfoPage = async(id, options) => {
const url = new URL(`https://${INFO_HOST}${INFO_PATH}`);
url.searchParams.set('video_id', id);
url.searchParams.set('c', 'TVHTML5');
url.searchParams.set('cver', '7.20190319');
url.searchParams.set('eurl', VIDEO_EURL + id);
url.searchParams.set('ps', 'default');
url.searchParams.set('gl', 'US');
Expand Down

8 comments on commit d1f5357

@timbly5000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix worked for me - many thanks
There are NO instructions on how to apply this though - should I have been able to use npm install ytdl-core@ to achieve this?
As it happens, I had to dig into //.nvm/versions........../info.js and add the lines manually.
For my (and everyone else's refenrence) how should I have applied this?

Many thanks for the fix and I hope it reaches the main branch soon.
Tim.

@Tomato6966
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm i git+github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a.git

@Leirach
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran npm i git://github.com/fent/node-ytdl-core.git#d1f535712410eebd79a7468abd07d94f8c4ebe5a and its working now, hopefully it's patched soon. Thanks!

@kevin4dhd
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@TheJerryFox
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it started working for me too but I had to change the version in the package.json to 4.8.3 before it actually worked. Before I did that, the 404 error was gone but I had no audio. After changing it to 4.8.3 it was back yo normal

@TrumpMySpade
Copy link

@TrumpMySpade TrumpMySpade commented on d1f5357 Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm i git+github.com/fent/node-ytdl-core/commit/d1f535712410eebd79a7468abd07d94f8c4ebe5a.git

Thanks so much! This error was really annoying.

For anyone having troubles where to put it if this doesnt work try this

ytdl-core > lib > info.js add it to line 328

url.searchParams.set('c', 'TVHTML5');
url.searchParams.set('cver', '7.20190319');

image

@oPROoYT
Copy link

@oPROoYT oPROoYT commented on d1f5357 Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url.searchParams.set('c', 'TVHTML5');
url.searchParams.set('cver', '7.20190319');

I added this but I'm still getting a

MinigetError: Status code: 404
at ClientRequest. (C:\Users\oproo\Desktop\favorito\node_modules\miniget\dist\index.js:211:27)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient (_http_client.js:641:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:509:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at TLSSocket.Readable.push (internal/streams/readable.js:223:10) {
statusCode: 404
}

@GrapsZ
Copy link

@GrapsZ GrapsZ commented on d1f5357 Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same error.

Please sign in to comment.