Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending video to wall error #61

Open
nys99 opened this issue Aug 5, 2021 · 1 comment
Open

Sending video to wall error #61

nys99 opened this issue Aug 5, 2021 · 1 comment

Comments

@nys99
Copy link

nys99 commented Aug 5, 2021

Hi, I am trying to use the video-url-input.js file to send a youtube video to the wall. However, when I pass the function a URL I get the following output:

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1330:5)
    at Object.<anonymous> (/home/pi/Desktop/rio/rio-server/node_modules/youtube-dl/lib/youtube-dl.js:16:71)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)

I have installed ffmpeg and I get the follow output when I run ffmpeg:


ffmpeg version 4.1.6-1~deb10u1+rpt2 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Raspbian 8.3.0-6+rpi1)

What might be causing this issue?

@blauzaaan
Copy link

blauzaaan commented Sep 29, 2021

Not sure whether this is still relevant for you after such a long time, but it is for me, so I'm documenting what I figured out.
Fixed in blauzaaan@55337fa

I'm getting errors during npm run install-server:

> youtube-dl@1.11.0 postinstall /home/pi/rio/rio-server/node_modules/youtube-dl
> node ./scripts/download.js

Error: Could not find download link in https://rg3.github.io/youtube-dl/download.html
...

See: przemyslawpluta/node-youtube-dl#162
It's fixed later versions, so change rio-server/package.json:
"youtube-dl": "1.11.0" --> "youtube-dl": "1.13.1"

(newer versions seem to depend on a package which require newer node versions, so not using those for now)

However, with the video I selected, I got

Error: Command failed: /home/pi/rio/rio-server/node_modules/youtube-dl/bin/youtube-dl --dump-json --format=17 http://www.youtube.com/watch?v=MLFWLJSPN7I
ERROR: requested format not available

Therefore I additionally changed the format in rio-server/inputs/video-worker.js:

//    var video = youtubedl(url, ['--format=17']); // 176 x 144 @ 12fps
    var video = youtubedl(url, ['--format=worst']); // changed as at least some videos are not available in format 17

If considering switching to youtube-dl-exec, remember to not only in package.json, but also in inputs/video-worker.js:

const youtubedl = require('youtube-dl');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants