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

Odd error during installing #79

Open
alikaylan opened this issue Jul 31, 2024 · 10 comments
Open

Odd error during installing #79

alikaylan opened this issue Jul 31, 2024 · 10 comments
Assignees
Labels
Bug Something isn't working question Further information is requested

Comments

@alikaylan
Copy link

I run into this while installing for the first time:

sh: -c: line 0: unexpected EOF while looking for matching '" sh: -c: line 1: syntax error: unexpected end of file
sh: -c: line 0: unexpected EOF while looking for matching '"
sh: -c: line 1: syntax error: unexpected end of file (2)

How to go past? Thanks.

PS. both 1.27, and 1.27.1

@section83
Copy link
Owner

Hello alikaylan ,

Apologies for this trouble. I've just completed clean installs on Intel Macs running macOS 10.10, 12 and 13 and a M1 Mac running macOS 14 with no errors. So, can you help with a few questions:

  • Which version of macOS are you using ?
  • Which model of Mac are you using ?
    • Can you get the exact model number ? e.g. MacBook Pro 15,1.
  • Have you used MacYTDL before ?
    • If so, do you know if any components are still installed ?
  • On starting MacYTDL, did you see any alerts saying something was being installed ?
  • Do you have Homebrew of MacPorts installs of yt-dlp and/or FFmpeg ?

Again, sorry for this and many thanks for posting the issue.

Cheers.

@section83 section83 self-assigned this Aug 1, 2024
@section83 section83 added Bug Something isn't working question Further information is requested labels Aug 1, 2024
@section83 section83 added this to the Research underway milestone Aug 1, 2024
@alikaylan
Copy link
Author

No worries, and appreciate your work very much...

I have two machines, both with the same error. One is an Intel based hack, and the other is M2 MacBook Pro. Both machines have had Homebrew, ytd-dl and FFmpeg, and the old youtube-dl is still in there installed. No MacPorts. The exact number of the M2 is Mac14,10. Both running Sonoma 14.6. I have not used MacYTDL before, first time install, I believe. No alerts on something installed, screen shot of the actual alert message is attached. It pops up an install request, and displays the error subsequently. Thanks again... Much appreciated.

Screenshot 2024-08-01 at 10 11 26 AM

Screenshot 2024-07-31 at 12 29 48 PM

@section83
Copy link
Owner

Many thanks for all that. It will take a day or two to isolate the bug and make a fix. I've tried to ensure MacYTDL is friendly with Homebrew installs but, it's been hard – I suspect the bug is in that code. One thing though, MacYTDL can't update Homebrew installs of FFmpeg or yt-dlp. yt-dlp especially is being actively developed – MacYTDL can install nightly releases. MacYTDL largely ignores youtube-dl as it hasn't had a stable release since December 2021 and they do not provide a Python runtime for Macs. I believe the yt-dlp developers try to ensure yt-dlp includes fixes made in youtube-dl.

Cheers.

@alikaylan
Copy link
Author

Much appreciated. Please let me know when I can retry.

@section83
Copy link
Owner

I can't find the bug that's causing that error. I've installed Homebrew on a MacBook Air running Monterey then used Homebrew to install yt-dlp and FFmpeg. Did a clean install of MacYTDL and had no errors. The error you get suggests there is an errant single quote character in a call to run a shell command (i.e. "sh"). I've scanned the shell calls used during first install and startup and can't find anything out of place. I only use the single-quote character later on when videos are bing downloaded.

On Intel Macs, Homebrew puts a symlink for FFmpeg and yt-dlp into usr/local/bin which is found by MacYTDL i.e. MacYTDL doesn't try to overwrite the existing install. Because you have yt-dlp, MacYTDL ignores your youtube-dl install.

I should have asked, did you install yt-dlp and FFmpeg using Homebrew or did you use another method ? If so, do you know where they are stored ?

Did you see this dialog ?

Install

Have you tried to run MacYTDL again after getting that error ? If so, did you get a different error ? If not, can you try again and let me know what happens.

Lastly, can you do this in Terminal ?

[yourMac] - % ffmpeg -version

Copy the result and paste into a new reply here. I'm hoping that your install returns version text that is a different format to Homebrew and my usual binary.

If you feel like giving up, I can recommend "Downie" from Charlie Monroe. I have no links with Charlie. In my testing, his is the most functional, fast and solid commercial downloader I've seen.

Many thanks.

@alikaylan
Copy link
Author

Thanks, appreciated, and no, not giving up. After a recent brew upgrade, the terminal produces the following:

ffmpeg version 7.0.1 Copyright (c) 2000-2024 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.3.9.4)
configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100

But I also have had ffmpeg, yt-dlp, and youtube-dl installed in /usr/local/bin as well. Manually installed. The ffmpeg version there is an older version. These are actual bins, and NOT sym links for homebrew. So in essence, there is duplicate and potentially conflicting binary there. But only for ffmpeg. yt-dlp and youtube-dl not installed in homebrew. I have renamed that ffmpeg binary in /usr/local/bin, but the error does not go away. Renaming yt-dlp in /usr/local/bin produces a new dialog box (attached), stating that it did find youtube-dl, would I want to switch to yt-dlp, and clicking yes ends up with the very same error message.

Screenshot 2024-08-03 at 7 58 11 AM

As I mentioned before, one machine is running on Intel, and the other machine is an M2. Behavior is exactly the same on both machines.

Finally, yes indeed, I had seen that dialog you mentioned on both machines. And yes indeed, tried to run reinstall multiple times. Hope this helps solve the mystery.

@alikaylan
Copy link
Author

Ah, I solved the mystery. Your app assumes that the app is sitting in /Applications, but in my case, it was installed at another location... So it could not find whatever it was looking for... It needs to check where it is before it starts its operations.

Moving to the Applications folder resolved the issue. Thanks for your kind help... Much appreciated...

@section83
Copy link
Owner

section83 commented Aug 3, 2024

Ouch. MacYTDL should work in any location – I usually run it from the Desktop or from ~/[home]/Applications/ without trouble. The Applications folder is best as it's available to all user accounts and I believe has additional protections from macOS.

I don't have /Applications/ hard coded anywhere – there is code which gets MacYTDL's location and uses that as the source for components etc. Can you tell me where MacYTDL was stored ? Was it a folder containing a single quote in its name ?

Multiple copies of binaries shouldn't cause errors. I think macOS searches the usual locations in order and runs the first binary found. The PATH and other environment variables control what Terminal does. But, different versions of the same binary will probably return different results. MacYTDL only has trouble when a binary returns its version in a different format to the usual, which is rare – Homebrew formulae don't change that.

But, I still have a bug in there somewhere. You should not get the shell error. Will keep looking.

Many thanks for all this detail. Please let me know if there is a feature you would like added to MacYTDL.

Cheers.

Edited @ 16.10 (AEST): had a thought which was wrong.
Edited @ 16.23 (AEST): added question about location name

@alikaylan
Copy link
Author

The Application was stored at /Applications/Ali's Applications/MacYTDL and either that apostrophe which I think you are referring to as a single quote, or the space is causing the error. Given that the error message is also displaying a "'", my money is on the apostrophe...

@section83
Copy link
Owner

Many thanks for that. Yes, the apostrophe is causing problems. In some testing, I found it crashed MacYTDL but with a different error. I'll try to get a fix into the next version of MacYTDL.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants