youtube-dl-gui icon indicating copy to clipboard operation
youtube-dl-gui copied to clipboard

Error! Unhandled error (execa).

Open harrydevs2021 opened this issue 3 years ago • 19 comments

Describe the bug After pasting a video link, and clicking download, the progress bar turns red immediately and displays: Error! Unhandled error (execa). Was working correctly on previous verison 2.3.1

To Reproduce Steps to reproduce the behavior:

  1. Paste video link
  2. Click on +

Expected behavior Video should be downloaded

Additional info (please complete the following information):

  • OS: OS X El Capitan 10.11.6
  • Application version 2.4.0
  • Application type dmg in Applications folder

Additional context { "shortMessage": "Command failed with exit code 127: /Applications/Open Video Downloader.app/Contents/Resources/app.asar.unpacked/binaries/yt-dlp-unix -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 --no-check-certificate --yes-playlist undefined", "command": "/Applications/Open Video Downloader.app/Contents/Resources/app.asar.unpacked/binaries/yt-dlp-unix -J --flat-playlist --no-cache-dir --ignore-config --user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36 --no-check-certificate --yes-playlist undefined", "exitCode": 127, "stdout": "", "stderr": "env: python3: No such file or directory", "failed": true, "timedOut": false, "isCanceled": false, "killed": false }

harrydevs2021 avatar Nov 20 '21 01:11 harrydevs2021

Workaround, use version 2.3.1 instead

I think this is because of this commit: https://github.com/jely2002/youtube-dl-gui/commit/b288ff3083c94be626d09ede34dfbbe6c705c0c2 That now this application uses yt-dlp which has a dependency to phyton

StefanLobbenmeier avatar Nov 21 '21 13:11 StefanLobbenmeier

Youtube-dl has a dependency on python as well. Is this on a M1 Mac?

jely2002 avatar Nov 21 '21 13:11 jely2002

Oh I assumed that this would use the compiled version of YouTube-dl, not sure

then the issue might be an old macOS version shipping an outdated Python version? I can check the installer Python version later, but it Is macOS 10.12 on a 2015 MacBook Pro

StefanLobbenmeier avatar Nov 21 '21 14:11 StefanLobbenmeier

Thanks for investigating. Looks like the version used by the reporter only ships with Python 2.7. As a fix he can install python3 with using this link: https://www.python.org/ftp/python/3.5.0/python-3.5.0-macosx10.6.pkg

Please let me know if this fixed it on El Capitan.

jely2002 avatar Nov 21 '21 14:11 jely2002

I also did some more investigation and I think python3 is never preinstalled with macOS. Could you also consider using the compiled binary for macOS instead?

There is one for this version: https://github.com/yt-dlp/yt-dlp/releases/tag/2021.10.22 It looks like the build failed for the more recent versions and the fix is still in progress: https://github.com/yt-dlp/yt-dlp/pull/1221

StefanLobbenmeier avatar Nov 21 '21 16:11 StefanLobbenmeier

(I am on my own machine now - macOS 11.4, python 3.9.8 is installed, but ideally this works without python as well)

I just tried replacing /Applications/Open Video Downloader.app/Contents/Resources/app.asar.unpacked/binaries/yt-dlp-unix with the macOS one from the tag, a video+audio download worked. Downloading audio only I get

ERROR: Postprocessing: module mutagen was not found. Please install using `python -m pip install mutagen`

Looks like this is a known issue already though: https://github.com/jely2002/youtube-dl-gui/issues/241

StefanLobbenmeier avatar Nov 21 '21 16:11 StefanLobbenmeier

Good find. Looks like they disabled the Mac build. All we can do for now is wait until they re-enable it. The mutagen error is a separate issue (#241), I believe it can be worked around by disabling 'save-metadata' in the settings.

I'm already starting to regret the decision to switch to yt-dlp.

jely2002 avatar Nov 21 '21 22:11 jely2002

Youtube-dl has a dependency on python as well. Is this on a M1 Mac?

It's an Intel Mac

harrydevs2021 avatar Nov 22 '21 13:11 harrydevs2021

Thanks for investigating. Looks like the version used by the reporter only ships with Python 2.7. As a fix he can install python3 with using this link: https://www.python.org/ftp/python/3.5.0/python-3.5.0-macosx10.6.pkg

Please let me know if this fixed it on El Capitan.

Yes, in Terminal > Python -- version, shows 2.7.10

I downloaded and installed the pkg from the link provided.

Terminal > Python -- version, still shows shows 2.7.10 after restart.

The Error! Unhandled error (execa) in Open Video Downloader still occurs. I will revert back to v2.3.1 for now.

harrydevs2021 avatar Nov 22 '21 14:11 harrydevs2021

I have this same issue, running MacOS 10.14 with Python 3 installed (via Anaconda). Perhaps you could provide a setting to let us provide our own Python binary location.

mark-up avatar Dec 16 '21 21:12 mark-up

Good find. Looks like they disabled the Mac build. All we can do for now is wait until they re-enable it.

https://github.com/yt-dlp/yt-dlp/releases/tag/2021.12.01

Looks like it is back up again

StefanLobbenmeier avatar Dec 18 '21 13:12 StefanLobbenmeier

Perhaps you could provide a setting to let us provide our own Python binary location.

Looking through the source code I found this: https://github.com/jely2002/youtube-dl-gui/blob/453017f214116c02c2541057ec9ac8adb3c58a0c/modules/BinaryUpdater.js#L19

So I am pretty sure this means that if you put yt-dlp or ytdlp on the path it will use the one on the path instead.

Edit: ok I am not so sure anymore. Maybe this only affects the Updater, since for the actual query the preinstalled YouTube-dl is not checked: https://github.com/jely2002/youtube-dl-gui/blob/453017f214116c02c2541057ec9ac8adb3c58a0c/modules/types/Query.js#L60

I feel like there might be a bug there, or I am misunderstanding something.

StefanLobbenmeier avatar Dec 18 '21 13:12 StefanLobbenmeier

I have this same issue, running MacOS 10.14 with Python 3 installed (via Anaconda).

today I found out that there is a different path for the macOS gui. You can remedy that by launching OpenVideoDownloader from the terminal. Or you can set your launchctl path in your .bash_profile like this:

launchctl setenv PATH $PATH

source: https://apple.stackexchange.com/a/51678

~On my own machine I did not do that however, i just installed it through brew and that puts it in /usr/local/bin which seems to work as well~

I just found out that python3 seems to be preinstalled on my machine (Big Sur). Possibly it is also installed on earlier versions of macOS, but there is one in /usr/bin that I am pretty sure I did not put there:

➜  ~ which -a python3
/usr/local/bin/python3
/usr/bin/python3

Also confirmed by others here: https://stackoverflow.com/questions/62616464/what-versions-of-python-is-shipped-with-macos-11-big-sur

There is one more alternative to fix this within open Video downloader like this: https://github.com/sindresorhus/fix-path

StefanLobbenmeier avatar Dec 18 '21 18:12 StefanLobbenmeier

So ver 2.4.0 does not fix the issue correct? I installed mutagen with pip and pip3, both with no effect :( Downloading without metadata obv. solves it but is not a permanent solution

SecretUnicorn avatar Dec 31 '21 14:12 SecretUnicorn

Same error since updating to 2.4.0 - I'm on Osx 10.14.6

northwinds avatar Jan 29 '22 10:01 northwinds

https://github.com/jely2002/youtube-dl-gui/issues/354#issuecomment-1127269708

himyjan avatar May 16 '22 06:05 himyjan

Update electron-builder to version ^23.0.0 is going to fix this problem

olegshulyakov avatar Jun 18 '22 16:06 olegshulyakov

@olegshulyakov How is upgrading electron gonna fix the dependency on python3?

I think there is a separate error with the same error message in the other ticket(s), but this one was originally caused by missing python3 on older macOS versions.

StefanLobbenmeier avatar Jun 18 '22 17:06 StefanLobbenmeier

@StefanLobbenmeier Sorry for misleading. I have opened PR to address this issue since it happens quite often.

Fix of this issue contains of several parts:

  1. Fix when python is not found on local machine - this is done by updating electron-builder, see https://github.com/electron-userland/electron-builder/issues/6726
  2. Download binaries by correct urls.
  3. Create binary folder if it does not exist to avoid exception writing to not existing path.
  4. Set chmod 0755 to all binaries, not just first one.

olegshulyakov avatar Jun 18 '22 21:06 olegshulyakov