maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Youtube browser - mYTube - released (https://talk.maemo.org/showthread.php?t=17739)

kavekave 2010-04-09 21:05

Re: Youtube browser - mYTube - released
 
youtube application for nokia n97 is better ...i don't like the one for nokia n900 honestly

liquid217 2010-04-10 02:27

Re: Youtube browser - mYTube - released
 
Ok, I have built on Emgmex's idea, and have gotten the new youtube-dl script to work somewhat. I have had to hack it so that its stdout looks similar to youtube-dl-x. I'm not quite there yet, but you can at least hit the download button, and watch the percent climb until it hits 100%. Once it does, you can hit the play button.
lines that I changed in youtube-dl are lines 360,361, and 382.

My guess is if we can get the stdout to look exactly like the youtube-dl-x, we should be good to go.

Edit: go here to get the deb, which installs Emgmex's modified script.
http://talk.maemo.org/showpost.php?p...&postcount=308

Engmex 2010-04-10 12:58

Re: Youtube browser - mYTube - released
 
Hi Liquid Many thanks! I'll take a look at your script later.

Engmex 2010-04-10 19:42

Re: Youtube browser - mYTube - released
 
Hi Liquid Yes your script is an improvement thanks. I'm trying to follow your suggestion and get youtube-dl to output the same as youtube-dl-x. Unfortunately it ain't that simple because youtube-dl-x has an additional parameter in the relevant line. Here is the line in youtube-dl-x (line 360)

cond_print('\nRetrieving video data: %5s%% (%8s of %s) at %8s/s ETA %s ' % (percent_str, counter, video_len_str, speed_str, eta_str))

and this is what we have in your version of youtube-dl

self.to_stdout(u'\nRetrieving video data: %s of %s at %s ETA %s' %
(percent_str, data_len_str, speed_str, eta_str), skip_eol=True)

I think the problem is the counter parameter in youtube-dl-x code, which does not exist in youtube-dl. I guess this is what tells mytube to launch mplayer. I'm trying to add the counter somehow , but is is proving difficult and isn't helped by the fact that I don't know python. What we need is a kind and friendly python programmer!
Regards

liquid217 2010-04-10 19:56

Re: Youtube browser - mYTube - released
 
Yea, i'm not really a python guy either. I think you are correct, that there is a "bytes outputted" line in the stdout that mytube watches for. As I get time, I'll look to see if I can figure that out.

Engmex 2010-04-11 04:15

Re: Youtube browser - mYTube - released
 
Well by messing with the script a bit and adding the code below at line 360 I now have a byte count on the std out, but unfortunately Mplayer still doesn't launch automatically. I guess there is something wrong with the byte count format.
Line 355
def report_progress(self, percent_str, data_len_str, speed_str, eta_str):
"""Report download progress."""
if self.params.get('noprogress', False):
return

#CHANGED BY ENGMEX
percent_str = percent_str.rstrip('%')
percent_str = float(percent_str)
data_len_str = data_len_str.rstrip('M')
data_len_str = float(data_len_str)
counter = int(((data_len_str*1048576)/100)*percent_str)

self.to_stdout(u'\nRetrieving video data: %5s%% (%8s of %sM) at %8s/s ETA %s ' %
(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
#END ENGMEX


def report_resuming_byte(self, resume_len):
"""Report attemtp to resume at given byte."""
self.to_stdout(u'[download] Resuming download at byte %s' % resume_len)

GeraldKo 2010-04-11 18:08

Re: Youtube browser - mYTube - released
 
Thanks, Engmex and liquid217. I'm sure looking forward to your success in fixing the Diablo mYTube.

(It seems like, so far, there's no point in a non-coder downloading any of what you've implemented these past few days; and that all we can do is thank you and wish you good luck. Good Luck!)

Engmex 2010-04-11 20:27

Re: Youtube browser - mYTube - released
 
sorry to dissappoint, but I now have the modified youtube-dl script producing the exact same output as the original youtube-dl-x script. Here is the code:
Line 359
#CHANGED BY ENGMEX
percent_str = percent_str.rstrip('%')
percent_str = float(percent_str)
data_len_str = data_len_str.rstrip('M')
data_len_str = float(data_len_str)
counter = float(((data_len_str*1048576)/100)*percent_str)
if counter < 1048576:
self.to_stdout(u'\nRetrieving video data: %5s%% (%.2fk of %sM) at %8s/s ETA %s ' %
(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
else:
counter = counter/1048576
self.to_stdout(u'\nRetrieving video data: %5s%% (%.2fM of %sM) at %8s/s ETA %s ' %
(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
#END ENGMEX

Unfortunately mplayer still does not launch automatically, so I guess that mytube does not use the std out to launch myplayer.

Engmex 2010-04-11 20:39

Re: Youtube browser - mYTube - released
 
Good news! I think I have it working. I made a silly mistake and was converting to bytes instead of kilobytes here is the new code:
#CHANGED BY ENGMEX
percent_str = percent_str.rstrip('%')
percent_str = float(percent_str)
data_len_str = data_len_str.rstrip('M')
data_len_str = float(data_len_str)
counter = float(((data_len_str*1024)/100)*percent_str)
if counter < 1024:
self.to_stdout(u'\nRetrieving video data: %5s%% (%8.2fk of %sM) at %8s/s ETA %s ' %
(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
else:
counter = counter/1024
self.to_stdout(u'\nRetrieving video data: %5s%% (%8.2fM of %sM) at %8s/s ETA %s ' %
(percent_str, counter, data_len_str, speed_str, eta_str), skip_eol=True)
#END ENGMEX
I will try and upload the file somewhere so that the rest of you can download it.

liquid217 2010-04-11 20:57

Re: Youtube browser - mYTube - released
 
Nice Engmex. Congratulations on getting it figured out.

Engmex 2010-04-11 20:59

Re: Youtube browser - mYTube - released
 
Ok I've uploaded the modified and working script to here:
http://wikisend.com/download/437498/youtube-dl
It seems to be working on my Nokia fine. Remember you will also need to download the getpass.py
posted by liquid217 above. You need to put the getpass.py in your /usr/lib/python2.5/site-packages

You need to place youtube-dl in
/usr/bin/

you need to make sure the permissions on the youtube-dl script are correct.

as root type:
chmod 755 /usr/bin/youtube-dl

You also need to go to mytube>preferences>more>youtube-dl and change
youtube-dl-x
to
youtube-dl
leave the rest of the options the same.
Good Luck!

Engmex 2010-04-11 21:28

Re: Youtube browser - mYTube - released
 
Thanks to you liquid for working out that we only needed to change the stdout, without that I wouldn't have known where to begin.

GeraldKo 2010-04-12 04:34

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by Engmex (Post 605971)
Ok I've uploaded the modified and working script to here:
http://wikisend.com/download/437498/youtube-dl
It seems to be working on my Nokia fine. Remember you will also need to download the getpass.py
posted by liquid217 above. You need to put the getpass.py in your /usr/lib/python2.5/site-packages
you need to make sure the permissions on the youtube-dl script are correct.

as root type:
chmod 755 /usr/bin/youtube-dl

You also need to go to mytube>preferences>more>youtube-dl and change
youtube-dl-x
to
youtube-dl
leave the rest of the options the same.
Good Luck!

Thanks, guys! That worked.

Trivial inconsistency: one of you put getpass.py in /usr/lib/python2.5/site-packages/ and the other put it in /usr/lib/python2.5/ So I put it in both -- messy, I guess, but no problem so far.

Still no download percent indicator, but no big deal, either.

Great to have YouTube back on my N800!

barg0n 2010-04-12 04:35

Re: Youtube browser - mYTube - released
 
hi, sorry for the noob question, but how do i get the getpass.py into the /usr/lib/python directory? i don't know how to access the directory

Engmex 2010-04-12 04:53

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by GeraldKo (Post 606314)
Still no download percent indicator, but no big deal, either.

Great to have YouTube back on my N800!

The percent indicator is working here!

Engmex 2010-04-12 05:02

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by barg0n (Post 606315)
hi, sorry for the noob question, but how do i get the getpass.py into the /usr/lib/python directory? i don't know how to access the directory

You need to become root I think the easiest way is to install the sudser package then.
open an x-terminal maybe you need to install the x-terminal package too.
in the x-terminal type:
cd /home/user/where you placed the downloaded files
then
sudo cp youtube-dl /usr/bin/
sudo cp getpass.py /usr/lib/python2.5/site-packages
sudo chmod 755 /usr/bin/youtube-dl

barg0n 2010-04-12 05:37

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by Engmex (Post 606329)
You need to become root I think the easiest way is to install the sudser package then.
open an x-terminal maybe you need to install the x-terminal package too.
in the x-terminal type:
cd /home/user/where you placed the downloaded files
then
sudo cp youtube-dl /usr/bin/
sudo cp getpass.py /usr/lib/python2.5/site-packages
sudo chmod 755 /usr/bin/youtube-dl

thanks for the quick reply
ive placed it on my external memory but i’m not sure what to type in cause
cd /home/user/Removable memory card/ doesn’t work.

liquid217 2010-04-12 11:20

Re: Youtube browser - mYTube - released
 
Honestly, I think the easiest method would be to install an ssh server on the tablet, then use an sftp client on the PC/MAC/Linux machine. I personally use Filezilla. Get the IP address of your tablet, and plug that information into filezilla. (To find this open the Connection manager and select Internet connection > IP address from the menu.) You will also need the root password, which you should set up when installing ssh.
Then, it's just a matter of navigating to the 2 directories and copying the files over. You can also chmod (change permissions) right from filezilla by right clicking on the files once they are copied over.

I don't think it really matters if you copy getpass.py to /usr/lib/python2.5/site-packages or /usr/lib/python2.5. I think python probably looks at both folders internally for any dependencies it needs.

http://filezilla-project.org/

Engmex 2010-04-12 11:56

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by barg0n (Post 606343)
thanks for the quick reply
ive placed it on my external memory but i’m not sure what to type in cause
cd /home/user/Removable memory card/ doesn’t work.

Read this!

http://www.ee.surrey.ac.uk/Teaching/Unix/

The external memory card files are in
/media/mmc1
so
cd /media/mmc1

barg0n 2010-04-12 20:13

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by liquid217 (Post 606759)
Honestly, I think the easiest method would be to install an ssh server on the tablet, then use an sftp client on the PC/MAC/Linux machine. I personally use Filezilla. Get the IP address of your tablet, and plug that information into filezilla. (To find this open the Connection manager and select Internet connection > IP address from the menu.) You will also need the root password, which you should set up when installing ssh.
Then, it's just a matter of navigating to the 2 directories and copying the files over. You can also chmod (change permissions) right from filezilla by right clicking on the files once they are copied over.

I don't think it really matters if you copy getpass.py to /usr/lib/python2.5/site-packages or /usr/lib/python2.5. I think python probably looks at both folders internally for any dependencies it needs.

http://filezilla-project.org/

thanks for your input. i installed both filezilla and openssh client and server. however, it hasn't asked me to set up a root password, so i'm a little stuck now. and looking at filezilla, will it ask me to set up a username as well? or is the username the name of the device?


Quote:

Originally Posted by Engmex (Post 606803)
Read this!

http://www.ee.surrey.ac.uk/Teaching/Unix/

The external memory card files are in
/media/mmc1
so
cd /media/mmc1

thank you. after typing in cd /media/mmc1 it goes from ~$ to /media/mmc1 $
and when i try typing in sudo cp youtube-dl /usr/bin/ it gives me
cp: cannot stat 'youtube-dl'? No such file or directory
so i'm still a little stuck. but in the meantime i'll be reading the article you sent me, thanks

liquid217 2010-04-12 20:21

Re: Youtube browser - mYTube - released
 
Did you install the openssh server on your tablet? Many moons ago, when I installed it from the application manager, it asked me to enter a root password. Something may have changed since then.

Obviously, 'root' is your username.

barg0n 2010-04-12 21:36

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by liquid217 (Post 607499)
Did you install the openssh server on your tablet? Many moons ago, when I installed it from the application manager, it asked me to enter a root password. Something may have changed since then.

Obviously, 'root' is your username.

oh! it works! it works perfectly, with the numbers loading and everything. :D
thanks liquid217 and Engmex!

manvik60 2010-04-13 10:47

Re: Youtube browser - mYTube - released
 
Great app.
It works like a charm. Able to view and download the video on my N900.
But what I couldn't see is that, while playing the downloaded video inside mytube, its not able to pause.

Is it possible to pause the video ? If not, is it possible to add the pause/play/forward/reverse function ?

Thanks everyone for the effort.

tso 2010-04-13 10:52

Re: Youtube browser - mYTube - released
 
playback is handled by mplayer, try the spacebar ;)

lucas777 2010-04-13 10:54

Re: Youtube browser - mYTube - released
 
Im having trouble with this app, if downloaded it installed it, it finds what im after if i click play or download i can see the thing next to the time loading but it just stops nothing happends.....

marcdxn 2010-04-13 10:57

Re: Youtube browser - mYTube - released
 
Mplayer doesn't pick up the downloaded media in the Video section. Would like a way to do this so i can view all my video downloads straight from Mplayer hub.

manvik60 2010-04-13 11:35

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by tso (Post 608363)
playback is handled by mplayer, try the spacebar ;)

Excellent. works as you said. Even the arrow keys, works for forward/reverse.

liquid217 2010-04-15 21:13

Re: Youtube browser - mYTube - released
 
1 Attachment(s)
Here is a deb file which should update the youtube-dl script for you automatically. It's my first time making a deb, so I hope it works right. (worked for me anyway).
Edit:
-It will replace the existing youtube-dl-x script, so you do not need to change anything in mYTube.
-It will also copy over the getpass.py to the site-packages directory.

rwestphal 2010-04-17 04:46

Re: Youtube browser - mYTube - released
 
thanks liquid217, worked like a charm for my n800.

Den in USA 2010-04-17 04:49

Re: Youtube browser - mYTube - released
 
The patch works great, thanks!

davadio 2010-04-21 06:57

Re: Youtube browser - mYTube - released
 
:)Mytube/N800 fixed! That was easy thanks to your patch liquid217 and engmex. Really appreciate your work. Thanks.

andraeseus1 2010-04-21 07:06

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by iancumihai (Post 153034)
new version 0.1.5

+ improved/more space using kinetic list
+ video are cached by default instead of being saved
+ cached video can be stored withoud downloading (duh!! :P )
+ videos can be organized using tags
+ sorting by date for local files
- temporarily removed black theme
*fix: delete video
*fix: tags list coherence
* TODO: cached video explorer/cleaner
* TODO: more code restructure

help me with a confirmation
see http://www.internettablettalk.com/fo...&postcount=220

i AM JUST NOW LEARNING ABOUT THIS APP SO I AM KIND ABEHIND THE CURVE AS FAR AS UPDATES BUT DOES THIS THING DOWNLOAD YOUTUBE VIDS TO THE N900?

Lake 2010-04-22 19:55

Re: Youtube browser - mYTube - released
 
Apologies if a solution to this is buried within the many pages of this thread (I have searched) -

I can download and install Mytube OK but when I try to run it, it says "Creating Video Directory" but then resets to desktop!

What am I doing wrong?

maemonk 2010-04-23 01:00

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by Lake (Post 623281)
Apologies if a solution to this is buried within the many pages of this thread (I have searched) -

I can download and install Mytube OK but when I try to run it, it says "Creating Video Directory" but then resets to desktop!

What am I doing wrong?

I have the same problem and Here I asked, but no one replied.

Help us pleaseeee

liquid217 2010-04-23 01:12

Re: Youtube browser - mYTube - released
 
try running it from the command line and see what kind of output you get. Just type "mytube" from the prompt.

maemonk 2010-04-23 01:44

Re: Youtube browser - mYTube - released
 
Okay, I got it.

I installed OpenSSH Server + Client and logged in to delete the file

/home/user/.mytuberc

mYtube now wanted me to choose a new path

I chose
/home/user/MyDocs(in the device it's called N900)/Youtube(or whatever you want)

Now it starts but I can't watch the videos, it shows the first frame in Mplayer, nothing else :(
I also applied the patch

edit:rebooted the device and it plays dat shat :D

I hope that I can heldp others with my post :)

Lake 2010-04-23 16:53

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by liquid217 (Post 623680)
try running it from the command line and see what kind of output you get. Just type "mytube" from the prompt.

I get (amongst lots of things)

OSError: [Errno 13] Permission denied: '/media/mtube'

liquid217 2010-04-23 16:56

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by Lake (Post 624706)
I get (amongst lots of things)

OSError: [Errno 13] Permission denied: '/media/mtube'

I'm not a N900 user, but I would try what maemonk said above.

Lake 2010-04-23 17:12

Re: Youtube browser - mYTube - released
 
Quote:

Originally Posted by maemonk (Post 623693)
Okay, I got it.

I installed OpenSSH Server + Client and logged in to delete the file

/home/user/.mytuberc

mYtube now wanted me to choose a new path

I chose
/home/user/MyDocs(in the device it's called N900)/Youtube(or whatever you want)

Now it starts but I can't watch the videos, it shows the first frame in Mplayer, nothing else :(
I also applied the patch

edit:rebooted the device and it plays dat shat :D

I hope that I can heldp others with my post :)

Can someone walk me through this - unfortunately I have no knowledge of OpenSSH and I don;t want to break anything! Thanks

Shame really, I think mytube sounds really good.

liquid217 2010-04-23 17:14

Re: Youtube browser - mYTube - released
 
You were already at the prompt. Just do:
rm /home/user/.mytuberc


All times are GMT. The time now is 16:31.

vBulletin® Version 3.8.8