Skip to content

Conversation

@viperfx
Copy link
Contributor

@viperfx viperfx commented Apr 27, 2016

I have made the following changes to the python file and the main.c. I compiled the main.c using ndk-build.

When I run the function using the app, I get the following error:

import python module failed!!

@jianglei12138
Copy link
Owner

I'm sorry, these days I have to study on my graduate design. This may until May 2, after this I will continue paying attention to this. If you have any questions, you can contact me via email. jianglei12138@gmail.com

@viperfx
Copy link
Contributor Author

viperfx commented Apr 28, 2016

No problem! Focus on your studies! We can continue this when you are free.

@viperfx viperfx closed this Apr 28, 2016
@viperfx viperfx reopened this Apr 28, 2016
@viperfx
Copy link
Contributor Author

viperfx commented Apr 28, 2016

I have what I want working in the adb shell now. I think I am really close to getting that working on the app. I am really happy with the progress in the past few days, thanks so much for your efforts.

@jianglei12138
Copy link
Owner

Hi, @viperfx how's it going? Do you have finished using the python in android app?

@viperfx
Copy link
Contributor Author

viperfx commented May 4, 2016

I have also been busy studying for something the last few days :) last I
tried. It was still crashing on the C API. So I would appreciate if you
could take a quick look.

Hope the exams went well!
On 4 May 2016 9:13 a.m., "jianglei" notifications@github.com wrote:

Hi, @viperfx https://github.com/viperfx how's it going? Do you have
finished using the python in android app?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#6 (comment)

@jianglei12138
Copy link
Owner

Good luck in the examination!!!
And i will focus on it these days.
Good luck!

@viperfx
Copy link
Contributor Author

viperfx commented May 7, 2016

Hey, were you able to reproduce the issue? Any progress?

@jianglei12138
Copy link
Owner

jianglei12138 commented May 9, 2016

These day i was interrupted by other things, and i finally finished just now.

@viperfx
Copy link
Contributor Author

viperfx commented May 9, 2016

Awesome! Is it ready for me to try out?

@jianglei12138
Copy link
Owner

Oh, it's my fault! it's not mean I have done the app, it means I accomplished other things.
I encountered some problems here. Because i am not familiar with Python, and i am living in China, it is not easy for us to surf youtube. Could you tell me how to wrap the youtube-dl in a python function with the whole url of video.
like this.

#the url like this: http://v.youku.com/v_show/id_XOTYwNzg5OTg4.html?from=s1.8-1-1.2
def getVideo(url):
    #what should i do here 
    return obj

@viperfx
Copy link
Contributor Author

viperfx commented May 10, 2016

Sure, the code is very similar for one found in pythonforandroid.py. I made small adjustments for youku.

import youtube_dl

class SimpleYDL(youtube_dl.YoutubeDL):

    def __init__(self, *args, **kargs):
        super(SimpleYDL, self).__init__(*args, **kargs)
        self.add_default_info_extractors()

def get_stream(ytid):
    ydl_opts = {
        'nocheckcertificate': True,
        'skip_download': True,
        'cachedir': False,
        'format': 18,
        'prefer_insecure': True,
    }
    res = SimpleYDL(ydl_opts).extract_info(ytid, process=False, download=False)
    return res

Call the function like so

get_stream("http://v.youku.com/v_show/id_XOTYwNzg5OTg4.html?from=s1.8-1-1.2")

res returns a dictionary. Ideally, I want this to be passed to Java.

@jianglei12138
Copy link
Owner

I'm sorry, these days i have been interrupted by other things, I did anything for this project. Today, I try this, and I found it easier to use python2 in the app. Eventually i solve this by using python2. You could find it in my repository. Here is the address. And i will commit the whole source code later.

@jianglei12138
Copy link
Owner

@viperfx I am not sure if it could work on another android device and platform....

@viperfx
Copy link
Contributor Author

viperfx commented May 15, 2016

Oh right? You think it will be difficult to release in an app? Surely the
platform is the only dependancy? and the arch? Why the device?

On Sun, May 15, 2016 at 10:32 AM, jianglei notifications@github.com wrote:

@viperfx https://github.com/viperfx I am not sure if it could work on
another android device and platform....


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#6 (comment)

Tharshan

@jianglei12138
Copy link
Owner

Oh, it is android platform, but i think we can solve these problem ~~

@viperfx
Copy link
Contributor Author

viperfx commented Aug 4, 2016

Hey, I was curious if you ever solved this issue? Are you interested in looking into it again perhaps? I would really like to get this going again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants