distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
213 stars 43 forks source link

WARNING: Could not parse n transform function. #22

Closed PatrykPatryk5 closed 2 months ago

PatrykPatryk5 commented 2 months ago

Describe the bug

I have no idea what happened. I didn't change anything and it broke

WARNING: Could not parse n transform function. Please report this issue with the "1720463648608-base.js" file on https://github.com/distubejs/ytdl-core/issues. Stream URL may be slow but still works.

File

1720463648608-base.zip

Environment

Landjager commented 2 months ago

I had the same issue. Try npm update or npm i @distube/ytdl-core@latest that fixxed it for me.

yagizza commented 2 months ago

i got the same issue aswell. it was fine until this morning. i didnt change anything either but bot disconnects immediately after joining vc and gives this error.

vitor-kb commented 2 months ago

Same here, tried npm update or reinstalling ytdl-core, still nothing

mamdouhaass commented 2 months ago

anyone what should i do to make it work??

execaman commented 2 months ago

switch to soundcloud for now, youtube is being strict even after having cookies this time

ryokr commented 2 months ago

youtube cooked

AVAT1010 commented 2 months ago

Same error anyone figureout?

mamdouhaass commented 2 months ago

Will it be resolved?

soya-daizu commented 2 months ago

Here's the patch until it's fixed in the upstream https://github.com/soya-daizu/ytdl-core/tree/sig-patch

package.json: "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"

note: This is essentially just copying Lavalink's patch https://github.com/lavalink-devs/youtube-source/commit/7103b1a14cd8731d2fa1e0b401253443f7358f68

mamdouhaass commented 2 months ago

@soya-daizu can u tell us how to do it?

mamdouhaass commented 2 months ago

@soya-daizu should i just copy your package.json and copy it to my code?

soya-daizu commented 2 months ago

@mamdouhaass Yes you can just replace it and it should work. However, I'm not going to update this further, so you should put it back as it used to be when it's fixed in this repo.

mamdouhaass commented 2 months ago

U will not fix it for good? @soya-daizu

omerman commented 2 months ago

here's the patch until it's fixed in the upstream https://github.com/soya-daizu/ytdl-core/tree/sig-patch

package.json: "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"

@soya-daizu Your patch works. Thank you so much. appreciate you ❤️

soya-daizu commented 2 months ago

@mamdouhaass It should work until youtube breaks it again. It's just that this branch will not be maintained alongside the original one.

vitor-kb commented 2 months ago

Here's the patch until it's fixed in the upstream https://github.com/soya-daizu/ytdl-core/tree/sig-patch

package.json: "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"

note: This is essentially just copying Lavalink's patch lavalink-devs/youtube-source@7103b1a

It worked!

mamdouhaass commented 2 months ago

@vitor-kb bro can u tell me what u did?

mamdouhaass commented 2 months ago

what should i copy from the patch?

smclean117 commented 2 months ago

Here's the patch until it's fixed in the upstream https://github.com/soya-daizu/ytdl-core/tree/sig-patch

package.json: "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"

note: This is essentially just copying Lavalink's patch lavalink-devs/youtube-source@7103b1a

Thank you, saved the day.

mamdouhaass commented 2 months ago

@smclean117 can u tell me what to do?

Seukoooowwdd commented 2 months ago

Help

WARNING: Could not parse n transform function. Please report this issue with the "1720559747647-base.js" file on https://github.com/distubejs/ytdl-core/issues. Stream URL may be slow but still works.

Seukoooowwdd commented 2 months ago

@smclean117 I need help please

smclean117 commented 2 months ago

@smclean117 can u tell me what to do?

I'm a relative rookie when it comes to this but I replaced ytdl-core line in package.json with the line "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch" deleted ytdl-core from node_modules folder then ran npm install again

mamdouhaass commented 2 months ago

i have more than one line in package.json called ytdl @smclean117

smclean117 commented 2 months ago
"dependencies": {
    "@discord-player/extractor": "^4.4.1",
    "@discordjs/opus": "^0.9.0",
    "conf": "^12.0.0",
    "discord-player": "^6.6.2",
    "discord.js": "^14.12.1",
    "dotenv": "^16.3.1",
    "ffmpeg": "0.0.4",
    "fluent-ffmpeg": "^2.1.2",
    "opusscript": "0.0.8",
    "prism-media": "^1.3.5",
    "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"
  },

this is my dependencies section if that helps

Seukoooowwdd commented 2 months ago

@smclean117 I did what you said to do and when I do npm install I get this error

PS C:\Users\conta\OneDrive\Desktop> npm install npm ERR! code ENOENT npm ERR! syscall spawn git npm ERR! path git npm ERR! errno -4058 npm ERR! enoent An unknown git error occurred npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\conta\AppData\Local\npm-cache_logs\2024-07-09T21_29_36_194Z-debug-0.log

soya-daizu commented 2 months ago

@Seukoooowwdd What you should have done is to replace only one line which defines the dependency to this package (@distube/ytdl-core) Revert your changes and find the line that starts with "@distube/ytdl-core":. That should look like "@distube/ytdl-core": "^4.13.4" or something. Now replace that line with "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch" and run npm install again.

Notice that you're changing the source of @distube/ytdl-core to my branch. Once this problem is also fixed on the original branch, you should put it back to the original or you won't receive future updates to this package.

soya-daizu commented 2 months ago

@mamdouhaass ^This is essentially what you also need to do

Seukoooowwdd commented 2 months ago

@soya-daizuShould I do that? Because that's what I did and when I do npm install I get an error I think there is something I didn't do that needed to be done

mamdouhaass commented 2 months ago

@soya-daizu thats what i did when i run npm i i get this error npm ERR! code ENOENT npm ERR! syscall spawn git npm ERR! path git npm ERR! errno -4058 npm ERR! enoent An unknown git error occurred npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache_logs\2024-07-09T21_42_29_535Z-debug-0.log

mamdouhaass commented 2 months ago

should i change the package.lock json? too?

soya-daizu commented 2 months ago

@mamdouhaass I think you don't have git installed on your system and that's causing the problem.

Seukoooowwdd commented 2 months ago

@soya-daizu How to install git?

mamdouhaass commented 2 months ago

how to do that?

mamdouhaass commented 2 months ago

i installed git windows same problem

smclean117 commented 2 months ago

i installed git windows same problem

what does running git --version state?

Seukoooowwdd commented 2 months ago

It's good for me but when I start the music it disconnects straight away

mamdouhaass commented 2 months ago

mine doesnt disconnect it create a new js file with numbers

mamdouhaass commented 2 months ago

what did u install @Seukoooowwdd

Seukoooowwdd commented 2 months ago

Thank you, it's all good for me, will the problem come back one day or not or is it good? @soya-daizu

soya-daizu commented 2 months ago

@Seukoooowwdd I don't know. This will be the permanent fix for this specific problem, but if youtube decides to break things again then people need to find another workaround. Until then it will just happen to work and that's always how downloading from youtube has been. I guess it will be okay for a couple of months or so.

vitor-kb commented 2 months ago

@vitor-kb bro can u tell me what u did?

Updated package.json and run npm i again

Seukoooowwdd commented 2 months ago

What should I do when I have this? WARNING: Using old cookie format, please use the new one instead. (https://github.com/distubejs/ytdl-core#cookies-support)

4uuc commented 2 months ago

What should I change? The problem is not solved. Please help me ?

{ "name": "ytdl-core", "description": "YouTube video downloader in pure javascript.", "keywords": [ "youtube", "video", "download" ], "version": "4.11.5", "repository": { "type": "git", "url": "git://github.com/fent/node-ytdl-core.git" }, "author": "fent fentbox@gmail.com (https://github.com/fent)", "contributors": [ "Tobias Kutscha (https://github.com/TimeForANinja)", "Andrew Kelley (https://github.com/andrewrk)", "Mauricio Allende (https://github.com/mallendeo)", "Rodrigo Altamirano (https://github.com/raltamirano)", "Jim Buck (https://github.com/JimmyBoh)", "Paweł Ruciński (https://github.com/Roki100)", "Alexander Paolini (https://github.com/Million900o)" ], "main": "./lib/index.js", "types": "./typings/index.d.ts", "files": [ "lib", "typings" ], "scripts": { "test": "nyc --reporter=lcov --reporter=text-summary npm run test:unit", "test:unit": "mocha --ignore test/irl-test.js test/*-test.js --timeout 4000", "test:irl": "mocha --timeout 16000 test/irl-test.js", "lint": "eslint ./", "lint:fix": "eslint --fix ./", "lint:typings": "tslint typings/index.d.ts", "lint:typings:fix": "tslint --fix typings/index.d.ts" }, "dependencies": { "m3u8stream": "^0.8.6", "miniget": "^4.2.2", "sax": "^1.1.3" }, "devDependencies": { "@types/node": "^13.1.0", "assert-diff": "^3.0.1", "dtslint": "^3.6.14", "eslint": "^6.8.0", "mocha": "^7.0.0", "muk-require": "^1.2.0", "nock": "^13.0.4", "nyc": "^15.0.0", "sinon": "^9.0.0", "stream-equal": "~1.1.0", "typescript": "^3.9.7" }, "engines": { "node": ">=12" }, "license": "MIT" }

asssaaa21 commented 2 months ago

@Seukoooowwdd What you should have done is to replace only one line which defines the dependency to this package (@distube/ytdl-core) Revert your changes and find the line that starts with "@distube/ytdl-core":. That should look like "@distube/ytdl-core": "^4.13.4" or something. Now replace that line with "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch" and run npm install again.

Notice that you're changing the source of @distube/ytdl-core to my branch. Once this problem is also fixed on the original branch, you should put it back to the original or you won't receive future updates to this package.

i did exacly like your method, used it in my file and everything, yet bot when playing song joins and everything is okay, issue only does not play any song, even tried to sudo apt-get ffmpeg and update phyton also, sometimes it makes the problem for that too, but as i can see this time its not ffmpeg its actually tydl-core issue, and yet your method isn't working also bot keeps leaving the voice channel after joinning..

ryokr commented 2 months ago

"dependencies": {

 "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch",

},

Just simply replace "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch" at the line started with "@distube/ytdl-core" in your package.json.

Then run npm i. If it still warning, remove node_module, package-lock.json completely, run npm i again.

It worked for me.

matthewmichel commented 2 months ago

This is really interesting. The patch worked for me locally. When I deployed it it no longer is working and is still returning the 403/could not parse n transform function error. Any thoughts to why this would be happening?

bagaspwibisono commented 2 months ago

@matthewmichel have you delete .npm(if exist), node_modules & package_lock.json files and try run again npm i script?

AlexInCube commented 2 months ago

I am delete node_modules, pnpm-lock.yaml, execute "pnpm store prune", changed package to "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch", execute "pnpm install". And i still get WARNING: Could not parse n transform function + Server returned 403 Forbidden (access denied). I tried to change cookies and remove cookies entirely. Nothing changed.

brusnaclee commented 2 months ago

Here's the patch until it's fixed in the upstream https://github.com/soya-daizu/ytdl-core/tree/sig-patch

package.json: "@distube/ytdl-core": "github:soya-daizu/ytdl-core#sig-patch"

note: This is essentially just copying Lavalink's patch lavalink-devs/youtube-source@7103b1a

Thank you it's worked