maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   youtube application (https://talk.maemo.org/showthread.php?t=16964)

iancumihai 2008-02-21 14:28

youtube application
 
Hi guys,

do you know if there is a youtube browser application
(not web based - slow)?

i've found enough pieces to start one
(youtube-dl, mplayer, gdata, python).

just that i would not like to reinvent the wheel and realize in the end
that it would have been better to contribute to another project
instead of starting a new one.

so, please help someone eager to throw away 2-3 nights :)

thanks

Mika73 2008-02-21 14:31

Re: youtube application
 
That would be nice. Something like iPhone has. :)

iancumihai 2008-02-21 14:34

Re: youtube application
 
Quote:

Originally Posted by Mika73 (Post 145729)
That would be nice. Something like iPhone has. :)

Kind of, only better ;)

i'm searching for about 1 hour such an application, so if someone
knows if such a thing exists, let me know so i won't waste precious
time and beers ;)

... right, beers are never wasted

Mara 2008-02-21 14:47

Re: youtube application
 
Quote:

Originally Posted by iancumihai (Post 145732)
Kind of, only better ;)

i'm searching for about 1 hour such an application, so if someone
knows if such a thing exists, let me know so i won't waste precious
time and beers ;)

... right, beers are never wasted

The closest I can think is UKTUBE, but that is just a "Utube flash video player in full screen". It doesn't let you browse videos, just play them from a URL link you have first copied from web browser.

Maybe you can contact Urho Konttori (author of UKTUBE) and see if you can add your browser part into UKTUBE player. That might become a killer app! :D

RobMtl007 2008-02-21 14:53

Re: youtube application
 
Greetings Iancumihai:

A YouTube application would be awesome.

The one feature that is really needed is the ability to record a video off the N800 and be able to post it right away on YouTube.

Actually, a better site that has more potential would be Daily Motion.
They are beginning to accept HD Video.

If you can intergrate this feature into your apps, then many users will be able to VideoBlog instantly.
This is a great feature for businesspeople, students, journalists, bloggers, etc.

Iancumihai if you need beta tester I can help.

Regards Robert

iancumihai 2008-02-21 15:01

Re: youtube application
 
Quote:

Originally Posted by RobMtl007 (Post 145739)
Greetings Iancumihai:
The one feature that is really needed is the ability to record a video off the N800 and be able to post it right away on YouTube.

i did not expected such an interest for a a youtube player.
let's see what i can do.

that feature will be left after listing and playing video content.

sachin007 2008-02-21 15:03

Re: youtube application
 
Quote:

Originally Posted by iancumihai (Post 145744)
i did not expected such an interest for a a youtube player.
let's see what i can do.

that feature will be left after listing and playing video content.

Yeah there is a real big interest for such a player. Infact Kontorri's uktube was really a big big hit. If you can come out with anything near to what you seem to be promising..... i think your app would be the killer app.

All the best.

anidel 2008-02-21 15:13

Re: youtube application
 
You stole my idea :)
I started digging on the gdata python bindings and was able to retrieve the information I needed, tried to play the video URL with gstreamer with no luck, I should try mplayer. It'll work for sure and better :)

But i do have other issues to solve first: my daily job.

Also I am not (yet) good at UI. Could someone post a mock up of the UI ? Big buttons, no particular effects (yet).

iancumihai 2008-02-21 15:28

Re: youtube application
 
hehe ... in the end there will be only one.

daily job problem here also.

if one of us gets something interesting/more advanced .. etc i think we should join forces :)

but for a couple of days i'll give it a try myself.

right, .... mockups ... there is need for mockups ... please help :)

anidel 2008-02-21 15:46

Re: youtube application
 
If you wish I can send you what I've done so far...
It's not that much, just a fast coding in python to get the final URL,

BTW, I am more than willing to join forces...

EDIT: added forgotten willingness :P
EDIT2: edited former EDIT :p (damn typos)

iancumihai 2008-02-21 15:56

Re: youtube application
 
great ... let's see if this could be a productive weekend.

anidel 2008-02-21 16:20

Re: youtube application
 
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 :)

Quote:

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:

Quote:

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:

Quote:

mplayer rtsp://....
gives an error :

Quote:

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

Quote:

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

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

anidel 2008-02-21 16:22

Re: youtube application
 
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 :/

iancumihai 2008-02-22 01:24

Re: youtube application
 
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?

bartsimpson123844 2008-02-22 01:32

Re: youtube application
 
Quote:

Originally Posted by iancumihai (Post 146054)

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. :)

jussik 2008-02-22 07:56

Re: youtube application
 
Quote:

Originally Posted by iancumihai (Post 145744)
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...

iancumihai 2008-02-22 09:00

Re: youtube application
 
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 :)

anidel 2008-02-22 09:21

Re: youtube application
 
We could join and help...

butelo 2008-02-22 10:30

Re: youtube application
 
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.
;)

iancumihai 2008-02-22 12:04

Re: youtube application
 
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

pycage 2008-02-22 12:56

Re: youtube application
 
I've been planning to integrate a YouTube client into MediaBox. Any help would be appreciated. :)

iancumihai 2008-03-10 02:23

Re: youtube application
 
hi,

here is the first version lots of bugs but usable

http://hugsy.dyndns.org/files/mytube_0.0.1.deb


(hope this is not a dead thread)

iancumihai 2008-03-10 02:45

Re: youtube application
 
it requires python-hildon, python-gdata, python-gtk and mplyaer

make sure you have them and post some impressions here


cheers
mihai

asqwasqw 2008-03-10 06:01

Re: youtube application
 
could you post some screens...

iancumihai 2008-03-10 06:49

Re: youtube application
 
it seems it's not working with Application Manager (oh well .. fist deb for maemo) but it does work using 'dpkg -i'.


i'll made another build soon.


.... right screenshots. will do

iancumihai 2008-03-10 07:23

Re: youtube application
 
4 Attachment(s)
here you go.

remember the dependencies:

python2.5
python-hildon, python-gdata, python-gtk and mplyaer
(can find them easily here http://www.gronmayer.com/it )

oh, and i kind of like the offline capability of "saved" section :P
THE LINK http://hugsy.dyndns.org/files/mytube_0.0.1.deb
ps: the link above now it's fixed. should work with Application Manager

iancumihai 2008-03-10 09:12

Re: youtube application
 
a confirmation that someone managed to install this would be helpful.

you know that dev line: "it works on my computer/n810" :)


Cheers
Mihai

miind 2008-03-10 09:58

Re: youtube application
 
Realy want to test it but I get a conflict with the python-gdata and gdataclient package that is needed for using erming and maemopicasa.. erming is a must-have for me. :)

iancumihai 2008-03-10 10:08

Re: youtube application
 
if you have gdata fo python it should work (aka. start, but not install)

you can force the install with apt-get install --ignore-missing *.deb from xterm

anyone has some tips about using python-gdata vs gdataclient ?

popularity etc etc? or how to solve dependecies from different repositories?

hns 2008-03-10 10:18

Re: youtube application
 
I'm able to install the package, but get this when starting from xterm:

Code:

~ $ mytube
Traceback (most recent call last):
  File "/usr/bin/mytube", line 3, in <module>
    from mytube import *
  File "/usr/lib/python2.5/site-packages/mytube/__init__.py",  line 3, in <module>
    from guimytube import *
  File "/usr/lib/python2.5/site-packages/mytube/guimytube.py" , line 4, in <module>
    from yclient import  YClient
ImportError: No module named yclient

Great work, really looking forward to see this working!

iancumihai 2008-03-10 10:37

Re: youtube application
 
the only difference i see in those files
is that /usr/lib/python2.5/site-packages/mytube/yclient.py
is the only file that starts with a script like header

#!/usr/bin/python

i doubt i can make a deb file in the next 3-4 hours, but if you are savvy with xterm you remove that header from the file and give it a try.

thanks,
Mihai

Aisu 2008-03-10 10:43

Re: youtube application
 
Looks great, just wish it would start x_x I had to do a 'dpkg -i myt* ---force' to install it. Output...

Code:

Nokia-N810-50-2:/home/user/MyDocs# mytube
Traceback (most recent call last):
  File "/usr/bin/mytube", line 3, in <module>
    from mytube import *
  File "/usr/lib/python2.5/site-packages/mytube/__init__.py", line 3, in <module>
    from guimytube import *
  File "/usr/lib/python2.5/site-packages/mytube/guimytube.py", line 4, in <module>
    from yclient import  YClient
  File "/usr/lib/python2.5/site-packages/mytube/yclient.py", line 2, in <module>
    import gdata
ImportError: No module named gdata

Thanks a lot :)

iancumihai 2008-03-10 10:45

Re: youtube application
 
use this site to install python-gdata
http://www.gronmayer.com/it

in case it won't start from menu/extras(it does on my tableta :) )
try running it from xterm --> mytube

Aisu 2008-03-10 10:49

Re: youtube application
 
Awesome ;) Thanks a lot! Works great! But, will only start from xterm...

iancumihai 2008-03-10 10:54

Re: youtube application
 
Quote:

Originally Posted by Aisu (Post 152933)
Awesome ;) Thanks a lot! Works great! But, will only start from xterm...

Well ... you are the first one using it so enjoy.

whenever i will have some time i'll add more things (i did this weekend).


FIRST step: make it install properly :)

Bundyo 2008-03-10 12:19

Re: youtube application
 
Confirm: only running as root.

qwerty12 2008-03-10 12:25

Re: youtube application
 
Thanks iancumihai :)

With MPlayer browser plugin, it seems like a multimedia day today :P

BTW: emtube is down but I believe the video playing component is oss.

I plan on releasing two debs today, nothing special or groundbreaking. Infact, not even apps :P

iancumihai 2008-03-10 12:30

Re: youtube application
 
Quote:

Originally Posted by Bundyo (Post 152944)
Confirm: only running as root.

Yeah, i should learn one day to properly make a dep :)

meanwhile, i hope this one works better

http://hugsy.dyndns.org/files/mytube_0.0.2.deb

Bundyo 2008-03-10 12:38

Re: youtube application
 
If it doesn't - this should help :)
Code:

chown user:users -R /usr/lib/python2.5/site-packages/mytube

hns 2008-03-10 12:57

Re: youtube application
 
Quote:

Originally Posted by iancumihai (Post 152949)
Yeah, i should learn one day to properly make a dep :)

meanwhile, i hope this one works better

http://hugsy.dyndns.org/files/mytube_0.0.2.deb

It works now! Very cool! Thanks a lot.


All times are GMT. The time now is 02:49.

vBulletin® Version 3.8.8