thomasarmel / uqload_downloader

Download videos from uqload

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in macos M1 (bigsur)

jdsampayo opened this issue · comments

Here it is the output of configure and make, it is missing any dependency?

cli % ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for curl_easy_setopt in -lcurl... yes
libcurl library is present
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/homebrew/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
% make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/jdsampayo/apps/uqload_downloader/cli/build-aux/missing aclocal-1.16
 cd . && /bin/sh /Users/jdsampayo/apps/uqload_downloader/cli/build-aux/missing automake-1.16 --foreign
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /Users/jdsampayo/apps/uqload_downloader/cli/build-aux/missing autoconf
/bin/sh ./config.status --recheck
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --no-create --no-recursion
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking for curl_easy_setopt in -lcurl... yes
libcurl library is present
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/homebrew/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
 /bin/sh ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
depbase=`echo uqload_downloader.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	g++ -DPACKAGE_NAME=\"uqload_downloader\" -DPACKAGE_TARNAME=\"uqload_downloader\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"uqload_downloader\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"uqload_downloader\" -DVERSION=\"1.0\" -I.     -g -O2 -MT uqload_downloader.o -MD -MP -MF $depbase.Tpo -c -o uqload_downloader.o uqload_downloader.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from uqload_downloader.cpp:3:
./Downloader.h:16:1: error: unknown type name 'error_t'; did you mean 'errno_t'?
error_t fopen_s(FILE** f, const char* name, const char* mode);
^~~~~~~
errno_t
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h:30:32: note: 'errno_t' declared here
typedef int                    errno_t;
                               ^
In file included from uqload_downloader.cpp:3:
./Downloader.h:48:46: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
    DownloaderListener *m_downloaderListener = nullptr;
                                             ^
1 warning and 1 error generated.
make: *** [uqload_downloader.o] Error 1

For now what worked for me was using as fallback youtube-dl:

youtube-dl --referer "https://uqload.com/" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36" https://[DIRECT_LINK].mp4

Hello,
which version of gcc do you use for compilation ?
Does error_t.h exist on your system ? (https://fossies.org/linux/glibc/bits/types/error_t.h)

By the way this code works only by changing the Referer header on HTTP request.
You could also try the C# version (cd README.md).

This is the version of GCC:

% gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

According to a comment in this question: The error() function is a GNU extension. It is available only if you are using the GNU C library. Per its own man page, it should not be used in any program intended to be portable.

Nevertheless I added the code from error_t.h in Downloader.h and it did not send any more that error but now having different issues:

% make
 cd . && /bin/sh /Users/jdsampayo/apps/uqload_downloader/cli/build-aux/missing automake-1.16 --foreign Makefile
 cd . && /bin/sh ./config.status Makefile depfiles
config.status: creating Makefile
config.status: executing depfiles commands
depbase=`echo Downloader.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	g++ -DPACKAGE_NAME=\"uqload_downloader\" -DPACKAGE_TARNAME=\"uqload_downloader\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"uqload_downloader\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"uqload_downloader\" -DVERSION=\"1.0\" -I.     -g -O2 -MT Downloader.o -MD -MP -MF $depbase.Tpo -c -o Downloader.o Downloader.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from Downloader.cpp:1:
./Downloader.h:54:46: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions]
    DownloaderListener *m_downloaderListener = nullptr;
                                             ^
Downloader.cpp:32:109: error: delegating constructors are permitted only in C++11
Downloader::Downloader(std::string uqUrl, std::string outputFile, DownloaderListener *downloaderListener) : Downloader()
                                                                                                            ^~~~~~~~~~
Downloader.cpp:105:11: error: cannot initialize a variable of type 'void *' with an lvalue of type 'int (void *, curl_off_t, curl_off_t, curl_off_t, curl_off_t)' (aka 'int (void *, long, long, long, long)')
    void *m_downloadCallback = Downloader::downloadCallback;
          ^                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 2 errors generated.

It appears for mac will need more changes.

Hello,
please could you try ./configure CXXFLAGS=-std=gnu++11 ?
and void *m_downloadCallback = (void*)Downloader::downloadCallback;

That worked! thank you very much 👏

% ./configure CXXFLAGS=-std=gnu++11
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking for curl_easy_setopt in -lcurl... yes
libcurl library is present
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/homebrew/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
% make
depbase=`echo Downloader.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	g++ -DPACKAGE_NAME=\"uqload_downloader\" -DPACKAGE_TARNAME=\"uqload_downloader\" -DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"uqload_downloader\ 1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"uqload_downloader\" -DVERSION=\"1.0\" -I.     -std=gnu++11 -MT Downloader.o -MD -MP -MF $depbase.Tpo -c -o Downloader.o Downloader.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
g++  -std=gnu++11 -lcurl  -o uqload_downloader uqload_downloader.o Downloader.o
 % ./uqload_downloader https://example.com/video.mp4 01.mp4
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1256  100  1256    0     0   6939      0 --:--:-- --:--:-- --:--:--  6939
Video URL not found

I commited some changes so it should work with

./configure
make

now