fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.48k stars 790 forks source link

Invalid regular expression: missing / #1227

Open Mittelblut9 opened 1 year ago

Mittelblut9 commented 1 year ago
SyntaxError: Invalid regular expression: missing /
  File "node:vm", line 100, col 7, in new Script
  File "/app/node_modules/ytdl-core/lib/sig.js", line 116, col 51, in exports.decipherFormats
    const nTransformScript = functions.length > 1 ? new vm.Script(functions[1]) : null;
  File "node:internal/process/task_queues", line 95, col 5, in process.processTicksAndRejections
  File "index 0", in Promise.all
  File "/app/node_modules/ytdl-core/lib/info.js", line 401, col 17, in exports.getInfo
    let results = await Promise.all(funcs);
Pnlvfx commented 1 year ago

same

Pnlvfx commented 1 year ago

failed: evalmachine.:8 /,()[/,-71,//};Vla(ncode); ^

SyntaxError: Invalid regular expression: missing / at new Script (node:vm:94:7) at exports.decipherFormats (/Users/simo97/Desktop/api-bbs-music/node_modules/ytdl-core/lib/sig.js:116:51) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Promise.all (index 0) at async exports.getInfo (/Users/simo97/Desktop/api-bbs-music/node_modules/ytdl-core/lib/info.js:401:17)

azickri commented 1 year ago

Same here..

Laiirton commented 1 year ago

same here

cgjeffries commented 1 year ago

Also getting this issue.

talyuk commented 1 year ago

+1

Currypan1229 commented 1 year ago

me too

milanbabiclibrafire commented 1 year ago

same

Roninanu777 commented 1 year ago

Same here

4D5A90 commented 1 year ago

same

Eol1881 commented 1 year ago

Same This fix still works tho: https://github.com/fent/node-ytdl-core/issues/1110#issuecomment-1219856316

wanaimnn commented 1 year ago

Temporary fixed solution is downgrading ytdl-core version forked by @GreepTheSheep:

npm i ytdl-core@https://github.com/GreepTheSheep/node-ytdl-core

For mine, this fixed the "Invalid regular expression: missing / "

Roninanu777 commented 1 year ago

For me the patch by @khlevon worked

"ytdl-core": "https://github.com:khlevon/node-ytdl-core.git#v4.11.4-patch.2"

azickri commented 1 year ago

For me the patch by @khlevon worked

"ytdl-core": "https://github.com:khlevon/node-ytdl-core.git#v4.11.4-patch.2"

How about speed download? Its throttle?

milanbabiclibrafire commented 1 year ago

This worked for me: Using last ytdl version (same download speed)

  1. delete node_module, package-lock.json
  2. "ytdl-core": "github:milanbabiclibrafire/node-ytdl-core"
  3. npm i
Mittelblut9 commented 1 year ago

If you don't want to use a fork, you can also use a patch.

I use the patch-package to create a patch for a particular module

Example: https://github.com/Mittelbots/Mittelbot/blob/ae1ee59206ec51b15e51d4573c6aabec13bb3d53/patches/ytdl-core%2B4.11.4.patch

Shajeel-Afzal commented 1 year ago

"ytdl-core": "https://github.com:khlevon/node-ytdl-core.git#v4.11.4-patch.2"

It works perfectly on localhost however I am not able to deploy to Firebase Functions after adding this to package.json. Any solution?

talyuk commented 1 year ago

@Mittelblut9 in your patch one important line is removed, here is a correct one https://gist.github.com/talyuk/6f197e6a58b7b8107a7c2d7f442b97ae

Mittelblut9 commented 1 year ago

@Mittelblut9 in your patch one important line is removed, here is a correct one https://gist.github.com/talyuk/6f197e6a58b7b8107a7c2d7f442b97ae

Fixed 😅🫡

fpsone commented 1 year ago

I recommend using @distubejs fork since it is active, has fast bug fixes, and has better performance with undici. npm i @distube/ytdl-core

If you don't want to change your package name, you can overwrite the original package with this command. npm i ytdl-core@npm:@distube/ytdl-core

It should work better since #1217 patch is copied from this fork

Shajeel-Afzal commented 1 year ago

npm i ytdl-core@npm:@distubejs/ytdl-core

It says 404 not found!

fpsone commented 1 year ago

npm i ytdl-core@npm:@distubejs/ytdl-core

It says 404 not found!

Sorry, their package org doesn't have js suffix, it should be @distube/ytdl-core. Edited

alex-shestmincev commented 10 months ago

Seems like the issue is fixed, at least "ytdl-core": "4.11.5" is working for me

fpsone commented 10 months ago

Seems like the issue is fixed, at least "ytdl-core": "4.11.5" is working for me

Downgrade should work but the download speed is throttled and extremely slow. You can use "ytdl-core": "npm:@distube/ytdl-core@latest" for better performance.

fpsone commented 10 months ago

"ytdl-core": "4.11.5" is not working again

Changed to "ytdl-core": "npm:@distube/ytdl-core@latest" And it fails randomly with an error:

ffprobe exited with code 1
ffprobe version N-58069-gc253b180cb-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57.  2.100 / 57.  2.100

I don't think ytdl-core use ffmpeg/ffprobe

alex-shestmincev commented 10 months ago

"ytdl-core": "4.11.5" is not working again Changed to "ytdl-core": "npm:@distube/ytdl-core@latest" And it fails randomly with an error:

ffprobe exited with code 1
ffprobe version N-58069-gc253b180cb-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57.  2.100 / 57.  2.100

I don't think ytdl-core use ffmpeg/ffprobe

Yeah, there is no ffmpeg/ffprobe inside it this package

But this is my internal logic to use downloaded files. And seems like "ytdl-core": "npm:@distube/ytdl-core@latest" is randomly downloading empty files

azickri commented 10 months ago

"ytdl-core": "4.11.5" is not working again Changed to "ytdl-core": "npm:@distube/ytdl-core@latest" And it fails randomly with an error:

ffprobe exited with code 1
ffprobe version N-58069-gc253b180cb-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2021 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57.  2.100 / 57.  2.100

I don't think ytdl-core use ffmpeg/ffprobe

Yeah, there is no ffmpeg/ffprobe inside it this package

But this is my internal logic to use downloaded files. And seems like "ytdl-core": "npm:@distube/ytdl-core@latest" is randomly downloading empty files

After trying again, is it still the same? I never found that issue