node-ytdl-core icon indicating copy to clipboard operation
node-ytdl-core copied to clipboard

fix: youtube base.js parsing logic

Open khlevon opened this issue 2 years ago • 14 comments

Summary

Youtube again changed the base.js code for more details, you can check this comment

To have stable lib, I suggest approving this refactoring of lib/sig.js file, which was done by @distubejs, and reviewed and improved by me.

Results

Fixed issue: https://github.com/fent/node-ytdl-core/issues/1216

Code tested by me on my own product, also I updated outdated tests. You can use this patch until we make a decision regarding this PR

"ytdl-core": "git+ssh://[email protected]:khlevon/node-ytdl-core.git#v4.11.4-patch.2"

khlevon avatar Apr 27 '23 14:04 khlevon

will check the test cases tomorrow

khlevon avatar Apr 27 '23 14:04 khlevon

@fent please have a look at this PR, and if you agree, please let's merge it :)

khlevon avatar Apr 28 '23 09:04 khlevon

@khlevon Any idea if there are any blockers on merging this? Appreciate the PR!

ShantanuNair avatar May 17 '23 11:05 ShantanuNair

@ShantanuNair I don't see any blocker. We need someone with merge access to review, approve and merge this PR.

khlevon avatar May 18 '23 09:05 khlevon

Would you be able to make a version available for me to download and test?

Salientekill avatar Aug 24 '23 03:08 Salientekill

@fent it'd be great if you could give @khlevon access to the repository so he can help with the development!

dani-mp avatar Sep 05 '23 21:09 dani-mp

Você poderia disponibilizar uma versão para eu baixar e testar?

you can use this version while PR is open:

"ytdl-core": "git+ssh://[email protected]:khlevon/node-ytdl-core.git#v4.11.4-patch.2"

gmagreti avatar Sep 07 '23 04:09 gmagreti

Can you merge this PR ? last versions are broken

helloworld9912 avatar Sep 07 '23 12:09 helloworld9912

@khlevon the patch is not working anymore, right?

dani-mp avatar Sep 09 '23 22:09 dani-mp

@khlevon the patch is not working anymore, right?

its still working in my app as of yesterday

stedel avatar Sep 10 '23 07:09 stedel

@stedel I'm glad to read that. Mine is getting this error since last Wednesday using the patch mentioned above:

2023-09-11T08:33:15.805Z	097f75ee-1b9a-40bc-aaa2-387d1577a90c	ERROR	evalmachine.<anonymous>:426
Ama=function(a,b,c,d){var e=null;switch(b){case "JSON":try{var f=c.responseText}catch(h){throw d=Error("Error reading responseText"),d.params=a,oC(d),h;}a=c.getResponseHeader("Content-Type")||"";f&&0<=a.indexOf("json")&&(")]};Ila(ncode);
                                                                                                                                                                                                                             ^^^^^^^^^^^^^^^^

SyntaxError: Invalid or unexpected token
    at new Script (node:vm:100:7)
    at Object.exports2.decipherFormats (/var/task/build/server.cjs:1013223:55)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 0)
    at exports2.getInfo (/var/task/build/server.cjs:1013525:21)

dani-mp avatar Sep 11 '23 08:09 dani-mp

Can confirm that this patch does fix #1261 for me. Hoping this gets merged soon!

libhide avatar Nov 15 '23 10:11 libhide

I say if @fent doesn't get back to us in three months, we have someone who knows what they're doing fork this repo and maintain it. There's just a lot of people wanting to contribute that have great ideas, and this repo might die if we don't do anything about it. There just aren't that many great ytdl's out there.

twarped avatar Apr 11 '24 16:04 twarped

I say if @fent doesn't get back to us in three months, we have someone who knows what they're doing fork this repo and maintain it. There's just a lot of people wanting to contribute that have great ideas, and this repo might die if we don't do anything about it. There just aren't that many great ytdl's out there.

I second this.

FurblandChannel avatar Apr 20 '24 09:04 FurblandChannel

I say if @fent doesn't get back to us in three months, we have someone who knows what they're doing fork this repo and maintain it. There's just a lot of people wanting to contribute that have great ideas, and this repo might die if we don't do anything about it. There just aren't that many great ytdl's out there.

There already is such a fork: https://github.com/distubejs/ytdl-core

Install this over the old one, update your imports to point at the new ytdl, and it should just work.

MCFX2 avatar Jul 12 '24 16:07 MCFX2