Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    youtube application

    Reply
    Page 2 of 8 | Prev |   1   2   3     4   | Next | Last
    iancumihai | # 11 | 2008-02-21, 15:56 | Report

    great ... let's see if this could be a productive weekend.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    anidel | # 12 | 2008-02-21, 16:20 | Report

    Here it is the code, remember it's just a hack to retrieve the URL and see if that can be played back, that is not meant to be production quality code

    Originally Posted by
    def get_rtsp():
    youtubeclient = gdata.service.GDataService(server="gdata.youtube.c om")
    results = youtubeclient.Get("http://gdata.youtube.com/feeds/api/videos?orderby=viewCount&max-results=1&format=1&vq=n810")
    for video in results.entry:
    mediaGroup = video.FindExtensions(tag='group')
    print mediaGroup[0].FindChildren(tag='title')[0].text
    for content in mediaGroup[0].FindChildren(tag='content'):
    print content.attributes['url']
    content = mediaGroup[0].FindChildren(tag='content')[1]
    return content.attributes['url']
    Sorry for the ", but looks like it's the only way to make indent here.
    Anyway the trick is to get the GDataService first and then make the query by means of GET HTTP requests.
    In those GET yuo can provide a bounch of parameters to refine the search.
    The Youtube GDATA API documents all of them exaustively.

    The answer is an XML message that need to be parsed (and here the power of python helps a lot).
    There was a python library, but Google updated the youtube API to adapt them to the Google ones.

    The URL we're looking for, looks like its[1] in the <media:group> block for that video entry. Specifically the <media:content ...> tag.
    The 'url' attribute is the RTSP stream URI.
    (Other attributes will be useful when displaying it to the user).

    So that's the easy part actually

    Once I've got the URL we need to play it.
    I've tried to call the GStreamer player with:

    Originally Posted by
    player = gst.element_factory_make("playbin", "player")
    ....
    player.set_property('uri', uri)
    player.set_state(gst.STATE_PLAYING)
    but with no luck so far.
    Moreover, executing:

    Originally Posted by
    mplayer rtsp://....
    gives an error :

    Originally Posted by
    unsupported RTSP server. Server type is 'Google RTSP 1.0'.
    along with a

    Originally Posted by
    Connecting to server rtsp2.youtube.com[72.14.221.177]: 80...
    connect error: Connection refused
    References:

    [1] http://code.google.com/apis/youtube/...earchingVideos

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by anidel; 2008-02-21 at 16:30.

     
    anidel | # 13 | 2008-02-21, 16:22 | Report

    Wow.. the quote above makes the thread look very bad!
    And the "edit" button is hidden to me!

    UPDATE: Safari 3 renders the page correctly, while Firefox 2...12 does not. Great :/

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by anidel; 2008-02-21 at 16:27.

     
    iancumihai | # 14 | 2008-02-22, 01:24 | Report

    playing with python a little i got this

    http://www.postimage.org/image.php?v=Pq1EKPM9

    double clicking will start playing the video after a 5% buffering
    using the great mplayer port.

    the gui is usable only by me

    improvments as soon as i get some time.

    a mock up will be very useful

    PS: how do i post a image in this thread?

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by iancumihai; 2008-02-22 at 01:28.

     
    bartsimpson123844 | # 15 | 2008-02-22, 01:32 | Report

    Originally Posted by iancumihai View Post

    PS: how do i post a image in this thread?
    You have to use image tags ([IMG*]url[/IMG*])

    *take out the asterisks in that.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jussik | # 16 | 2008-02-22, 07:56 | Report

    Originally Posted by iancumihai View Post
    i did not expected such an interest for a a youtube player.
    let's see what i can do.
    There is such a player in the works, quite far in development. I happened to be in #maemo when the developer asked for testers (maybe 1-2 weeks ago) and had a go with it: It looked quite promising, even though it had some bugs

    I just checked IRC logs: his nick was tigrux.

    Inz seems to have saved the testing packages he was hosting for tigrux: http://inz.fi/youtube-viewer-for-tablet/ . NOTE: These were testing packages, not meant for users. So don't blame me or the developer if something goes wrong...

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by jussik; 2008-02-22 at 08:03.

     
    iancumihai | # 17 | 2008-02-22, 09:00 | Report

    F@#@!#@k .... if only i would have known yesterday!

    Now i'm too eager to continue what i've started, i'll do some more
    coding until i run out of beers

    Edit | Forward | Quote | Quick Reply | Thanks

     
    anidel | # 18 | 2008-02-22, 09:21 | Report

    We could join and help...

    Edit | Forward | Quote | Quick Reply | Thanks

     
    butelo | # 19 | 2008-02-22, 10:30 | Report

    My idea:
    Youtube generates a XML file for a search:
    http://googlesystem.blogspot.com/200...ube-feeds.html

    I know a command line app that can download any youtube video or can be connected through a pipe with a player/encoder, mplayer or ffmpeg or whatever

    http://home.gna.org/clive/

    I want to integrate that in a GUI to make a youtube player

    But If you want you can use the idea because I don't know a lot of development stuff and it can take me ages to do that.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    iancumihai | # 20 | 2008-02-22, 12:04 | Report

    that's what i have done in 3hours of coding last night.

    i took a look at youtube-viewer_0.1-1_all.deb code.

    it's pretty nicely written, it uses gstreamer and has a more complex approach, you can give it a try (check the link provided above by jussik)

    i'm still stubborned enough to see i can i do with my app and i will still give it a try a few more days

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 2 of 8 | Prev |   1   2   3     4   | Next | Last
vBulletin® Version 3.8.8
Normal Logout