yausername / youtubedl-android

youtube-dl for android
GNU General Public License v3.0
947 stars 172 forks source link

Add Aria2 #185

Closed xibr closed 1 year ago

xibr commented 1 year ago

close https://github.com/yausername/youtubedl-android/issues/177

xibr commented 1 year ago

@JunkFood02 Can you test this?

include and initialize the aria2c library.

Aria2c.getInstance().init(this);
implementation 'com.github.xibr.youtubedl-android:aria2c:fc01d681a8'
JunkFood02 commented 1 year ago
WARNING: [youtube] MXlsgBNRTR4: nsig extraction failed: You may experience throttling for some formats
         Install PhantomJS to workaround the issue. Please download it from https://phantomjs.org/download.html
         n = 4YKttGoUoUcZOX1T3iWd7 ; player = https://www.youtube.com/s/player/f96f6702/player_ias.vflset/en_US/base.js
CANNOT LINK EXECUTABLE "libaria2c.so": library "libcares.so" not found: needed by main executable

ERROR: aria2c exited with code 1
CANNOT LINK EXECUTABLE "libaria2c.so": library "libcares.so" not found: needed by main executable

ERROR: aria2c exited with code 1
xibr commented 1 year ago

Just add

implementation 'com.github.xibr.youtubedl-android:aria2c:4b7974c61f'
implementation 'com.github.xibr.youtubedl-android:library:4b7974c61f'

Because we modified YoutubeDL.java in #L81 this is why 'libcares.so' was not found.

JunkFood02 commented 1 year ago

I guess you're attempting to make aria2c and FFmpeg link to same .so libraries to reduce the libraries? No idea about where's the problem. Is the version of the .so matters or just issue with the paths?

val youtubedlAndroidVersion = "4b7974c61f"
implementation ("com.github.xibr.youtubedl-android:library:$youtubedlAndroidVersion")
implementation ("com.github.xibr.youtubedl-android:ffmpeg:$youtubedlAndroidVersion")
implementation ("com.github.xibr.youtubedl-android:aria2c:$youtubedlAndroidVersion")
CANNOT LINK EXECUTABLE "libaria2c.so": library "libc++_shared.so" not found: needed by main executable

ERROR: aria2c exited with code 1
CANNOT LINK EXECUTABLE "libaria2c.so": library "libc++_shared.so" not found: needed by main executable

ERROR: aria2c exited with code 1
xibr commented 1 year ago

I guess you're attempting to make aria2c and FFmpeg link to same .so libraries to reduce the libraries?

Yes that's what I wanted to do but I forgot we've updated ffmpeg, So the depends libc++, libxml2 and zlib no longer exists in the current version, So I will include it later.

No idea about where's the problem. Is the version of the .so matters or just issue with the paths?

The problem now is to provide libxml2.so libz.so.1.2.11 and libc++_shared.so .

I will fix that later.

JunkFood02 commented 1 year ago

aa680fbdd0 works fine so far

xibr commented 1 year ago

Yes, I tested it on Android 5 (armeabi-v7a) and Android 9 (arm64-v8a) and I didn't find any problem.

Screenshot_20220909-034007_dvd.jpg