redwid / android-youtube-dl Goto Github PK
View Code? Open in Web Editor NEWThe android library that wraps Python 2.7 and youtube-dl python scripts
The android library that wraps Python 2.7 and youtube-dl python scripts
Hey Redwid, thank you for this hacky approach to get youtube-dl working in android ๐
I have seen that in order to get it working you are not using a console output as in the youtube-dl library, instead, you are writing the output to a file which you can read and parse afterwards.
Am I seeing it correctly that in order to make more services/websites from the original youtube-dl library compatible all we would need to do is changing the way of the output in the extractors? Or are there any other barriers you could think of?
I would love to extend this, as having all services available from youtube-dl in android would be great!
happy to hear from you
cheers
1.
working: make: *** [/Users/zhangkuixun/.python-for...(and 93 more) Exception in thread background thread for pid 75852:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2:
RAN: /Users/zhangkuixun/Library/Android/sdk/android-ndk-r10e/ndk-build V=1
2.
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c: In function 'main':
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:74:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 0; i < argc; i++) {
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:74:3: note: use option -std=c99 or -std=gnu99 to compile your code
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:109:3: warning: passing argument 1 of 'Py_SetProgramName' from incompatible pointer type [enabled by default]
Py_SetProgramName(L"android_python");
^
In file included from /Users/zhangkuixun/.python-for-android/build/other_builds/python2-openssl/armeabi-v7a__ndk_target_21/python2/python-install/include/python2.7/Python.h:127:0,
from /Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:3:
/Users/zhangkuixun/.python-for-android/build/other_builds/python2-openssl/armeabi-v7a__ndk_target_21/python2/python-install/include/python2.7/pythonrun.h:22:18: note: expected 'char *' but argument is of type 'unsigned int *'
PyAPI_FUNC(void) Py_SetProgramName(char *);
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c: In function 'Java_org_redwid_android_youtube_dl_YoutubeDlWorker_nativeStart':
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:366:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 0; i < stringCount; i++) {
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:375:3: warning: passing argument 2 of 'main' from incompatible pointer type [enabled by default]
main(stringCount, argv);
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:68:5: note: expected 'char **' but argument is of type 'const char **'
int main(int argc, char *argv[]) {
^
make: *** [/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/obj/local/armeabi-v7a/objs/main/start.o] Error 1
STDERR:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/bin/p4a", line 11, in <module>
load_entry_point('python-for-android==0.6.0', 'console_scripts', 'p4a')()
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/toolchain.py", line 1028, in main
ToolchainCL()
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/toolchain.py", line 550, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/toolchain.py", line 149, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/toolchain.py", line 188, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/build.py", line 617, in build_recipes
recipe.build_arch(arch)
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/recipes/sdl2/__init__.py", line 41, in build_arch
shprint(sh.ndk_build, "V=1", _env=env)
File "/Users/zhangkuixun/Downloads/download/python-for-android/pythonforandroid/logger.py", line 176, in shprint
for line in output:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 863, in next
self.wait()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_2:
RAN: /Users/zhangkuixun/Library/Android/sdk/android-ndk-r10e/ndk-build V=1
3.
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c: In function 'main':
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:74:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 0; i < argc; i++) {
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:74:3: note: use option -std=c99 or -std=gnu99 to compile your code
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:109:3: warning: passing argument 1 of 'Py_SetProgramName' from incompatible pointer type [enabled by default]
Py_SetProgramName(L"android_python");
^
In file included from /Users/zhangkuixun/.python-for-android/build/other_builds/python2-openssl/armeabi-v7a__ndk_target_21/python2/python-install/include/python2.7/Python.h:127:0,
from /Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:3:
/Users/zhangkuixun/.python-for-android/build/other_builds/python2-openssl/armeabi-v7a__ndk_target_21/python2/python-install/include/python2.7/pythonrun.h:22:18: note: expected 'char *' but argument is of type 'unsigned int *'
PyAPI_FUNC(void) Py_SetProgramName(char *);
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c: In function 'Java_org_redwid_android_youtube_dl_YoutubeDlWorker_nativeStart':
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:366:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 0; i < stringCount; i++) {
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:375:3: warning: passing argument 2 of 'main' from incompatible pointer type [enabled by default]
main(stringCount, argv);
^
/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/jni/src/start.c:68:5: note: expected 'char **' but argument is of type 'const char **'
int main(int argc, char *argv[]) {
^
make: *** [/Users/zhangkuixun/.python-for-android/build/bootstrap_builds/sdl2-python2/obj/local/armeabi-v7a/objs/main/start.o] Error 1
04-16 16:48:21.759 2468-2503/org.redwid.android.youtube.dl.app I/python2.7: File "/Users/viacheslav.vdovenko/.python-for-android/build/other_builds/python2-openssl/arm64-v8a__ndk_target_21/python2/python-install/lib/python2.7/io.py", line 60, in <module>
04-16 16:48:21.760 2468-2503/org.redwid.android.youtube.dl.app I/python2.7: ImportError: dlopen failed: "/data/data/org.redwid.android.youtube.dl.app/files/youtube_dl/lib/python2.7/lib-dynload/_io.so" is 64-bit instead of 32-bit
Thanks again for your code, i hope you gonna be able to resolve these issues cause i plan to develop an app based on your code, unfortunately this is too complex to me. But Seems like openssl cause trouble with armeabi-v7a.
Text representation of error dialog follows:
ERROR
Unable to finish request for the url: https://youtu.be/TEn7oZg-_Jc
{"result":"Error file is not exist: /data/user/11/org.redwid.android.youtube.dl.app/files/youtube_dl/youtube_dl.done"}
OK
Perhaps you could give me the top output of sdkmanager --list so I can match your build environment? I am on Debian 9.
First Thanks for your work, i'm getting an error after second sharing from twitch for exemple with this url : https://www.twitch.tv/streamerhouse
hello, @Redwid
How does this project run python cold of youtube-dl?
I don't found youtube-dl cold?
I need to use android call youtube-dl to download video. There have been many ways to integrate youtube-dl code on Android, but they all failed, I don't know how you integrate it. please
ERROR: Unable to download webpage: <urlopen error [Errno 110] Connection timed out> (caused by URLError(error(110, 'Connection timed out'),))
Hello, when try to download from Twitter app stopping or don't get response
Text representation of error dialog follows:
ERROR
Unable to finish request for the url: https://youtu.be/qvMerFd3FUE
{"result":"DownloadError"}
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 4071 (Thread-6), pid 3973 (.youtube.dl.app)
The current youtube-dl is too old, Can you compile one with a new "private.mp3"?
@Redwid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.