fabiospampinato / cliflix

Watch anything instantaneously, just write its name.
MIT License
1.49k stars 65 forks source link

Crash when downloading subtitles #32

Open unwillexist opened 5 years ago

unwillexist commented 5 years ago

Everything works perfectly without selecting subtitles, but when I say yes to Do you want subtitles prompt and select subtitles I am getting this output and program crashes.

? Which language? English ? Which subtitles? Being John Malkovich (1999) Criterion BluRay 1h 53m 18s @23.976fps.English ? Which app? (Use arrow keys) ❯ VLC ────────────── Airplay Chromecast DLNA MPlayer mpv IINA XBMC events.js:177 throw er; // Unhandled 'error' event ^

Error: ENOENT: no such file or directory, open '~/.downloads/Being John Malkovich (1999) Criterion BluRay 1h 53m 18s @23.976fps.English.srt' Emitted 'error' event at: at /usr/local/lib/node_modules/cliflix/node_modules/graceful-fs/graceful-fs.js:228:14 at /usr/local/lib/node_modules/cliflix/node_modules/graceful-fs/graceful-fs.js:258:16 at FSReqCallback.oncomplete (fs.js:153:23) { errno: -2, code: 'ENOENT', syscall: 'open', path: '~/.downloads/Being John Malkovich (1999) ' + 'Criterion BluRay 1h 53m 18s ' + '@23.976fps.English.srt' }

fabiospampinato commented 5 years ago

🤔 Maybe the subtitles file didn't got saved as ~/.downloads/Being John Malkovich (1999) Criterion BluRay 1h 53m 18s @23.976fps.English.srt but something else? Perhaps we can fix this by sanitizing a subtitle name before using it.

unwillexist commented 5 years ago

It doesn't download it there is no subtitle file in that dir or anywhere on system, when I choose subtitle and hit return instantly I am getting this output, the problem should be about downloading subtitles is it using any GNU tools which is not compatible with BSD ? Actually I am not programmer but if you show me part of that code responsible for downloading subtitles maybe I can determine where is the problem.

fabiospampinato commented 5 years ago

is it using any GNU tools which is not compatible with BSD ?

I don't think so.

Actually I am not programmer but if you show me part of that code responsible for downloading subtitles maybe I can determine where is the problem.

The code is here: https://github.com/fabiospampinato/cliflix/blob/master/src%2Futils.ts/#L148-L158

cataldoc commented 4 years ago

I am experiencing this also on Manjaro Linux. It is possible this is a node module issue or a node version issue ?

I noticed during the installation the following warnings:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

npm WARN deprecated mkdirp@0.5.4: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

and

npm WARN cloudscraper@4.6.0 requires a peer of brotli@^1.3.2 but none is installed. You must install peer dependencies yourself.

[cataldo@manjaro ~]$ node -v v13.12.0

[cataldo@manjaro ~]$ npm -v 6.14.4