Redwid / android-youtube-dl

The android library that wraps Python 2.7 and youtube-dl python scripts
36 stars 10 forks source link

Procedure to add more services #6

Closed hannojg closed 5 years ago

hannojg commented 5 years ago

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

Redwid commented 5 years ago

Hello, You could verify if my lib is working with other services/websites. That are my changes to youtube-dl code: https://github.com/Redwid/youtube-dl/commit/653c98af7ece18b89546dd2544ce6c72e57d3c10

It was a long time ago. And looks like I've used common code to write json to file instead of console. There was some errors for reading console output from android code. Don't really remember what was exactly... but probably we can't easily read python output. But it should work with others services/websites.

hannojg commented 5 years ago

Thank you for your response! I am going to explore your libraries within the coming days. Did you build everything under a linux distribution? Because I tried to run your build on Mac OS in order to customize youtube-dl python scripts or android native wrapper but it failed (some compilation error as the clang doesn't seem to support -mandroid tag but gcc does).

Redwid commented 5 years ago

On Mac OS X. There was a little compilation hell, unfortunately I've not write all my attempts down.

hannojg commented 5 years ago

Yes, I really struggled to get it working in any manner 😅 Got it all set up with python, pip, your custom p4a implementation but it seems that when it tries to compile the final binaries it fails (as it uses clang compiler which doesn't seem to support necessary tags). Do you remember which compiler you used? Or could you provide a build log (I think I could read from the log what goes different on your machine than it does on mine)? Once I managed to get it working I would like to rewrite the section on how to compile it :)

Redwid commented 5 years ago

Unfortunately can't help with that now. I've updated my mac, and now unable to compile as well. Had this issue for compiling cryptolib:

`In file included from cryptlib.c:117: ./cryptlib.h:62:11: fatal error: stdlib.h file not found

include

      ^~~~~~~~~~

1 error generated. make[1]: [cryptlib.o] Error 1 make: [build_crypto] Error 1 ` All solutions from google do not work :(

Redwid commented 5 years ago

OK, found solution. It's important to use NDK r16b. I've added set up instruction to my build script. Now I could build again without any issues.