Notices


Reply
Thread Tools
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#451
Originally Posted by auouymous View Post
xclip is what you want. Version 0.8 is in the debfarm repo but is twice the size it should be so might be compromised. I compiled version 0.12 and put it up on the ASUI download page http://asui.garage.maemo.org/_download/xclip . It isn't the full xclip package, only the xclip binary. Copy it to /usr/bin/xclip and chmod 755 it. You must then install the libxmu6 dependancy by running the following command as root:

Code:
apt-get install libxmu6
Now change your script to call xclip, those are grave marks around the command, it is the character on the tilde key of a full size keyboard.

Code:
#!/bin/sh
cd /media/mmc1/Videos
youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" `xclip -out`
Now you can just run that script without any parameters and it will download the selected youtube URL. Enjoy!
I've been really digging on this lately.

Going to http://m.youtube.com/ using Tear, setting the zoom_step to 0.8 and zooming in once works great and is super fast.

Is there anything that could be done in addition to make this even better?

Maybe have it so that it will highlight and copy the url for you, or perhaps have a 30 wait as it begins to download, then it would automatically start playing it in mplayer?
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#452
Originally Posted by Addison View Post
Maybe have it so that it will highlight and copy the url for you, or perhaps have a 30 wait as it begins to download, then it would automatically start playing it in mplayer?
You could append an & to the end of the downloader line to background that process and then add sleep 30 ; mplayer `/bin/ls -1t |head -1`. That will play the newest file in the directory, which should be the downloading video.
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#453
Okay. So I have this here.

cd /media/mmc1/Videos ;youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" `xclip -out` sleep 30 ; mplayer `/bin/ls -1t |head -1`

It downloads the correct video, then in about 40 seconds, it opens up mplayer but it plays a different video then what was chosen.

Any ideas?

And yeah, I really like this set up you made for us.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#454
Originally Posted by Addison View Post
Code:
cd /media/mmc1/Videos
youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" `xclip -out` &
sleep 30
mplayer `/bin/ls -1t |head -1`
It downloads the correct video, then in about 40 seconds, it opens up mplayer but it plays a different video then what was chosen.
You forgot the & at the end of the youtube-dl command. Without it, the sleep and mplayer commands won't run until youtube-dl terminates.

As for not playing the correct video, try running /bin/ls -1tl (one tee el) in the video directory and see if it sorts the files by time with newest at top.
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#455
Here's a brief summary of the results I've had of it playing the correct video.

-1t - 2/8
-1tl - 0/5 (it never played anything)
-1c - 4/5

So yeah, -1c got me the best average.

I'll try and mess around some more and see if I can get it at 100% if possible.
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#456
I think -1c is correct.

The reason it wasn't playing the most recent video was because 30 seconds wasn't long enough of a delay for the video to begin downloading.

Anyway, I used to despise Youtube until all of this.

Now, it's actually quite nice and super easy and fast.

Thanks for everything Auouymous!

I found another new joy on my tablet.
 
Posts: 875 | Thanked: 918 times | Joined on Sep 2010
#457
Originally Posted by Addison View Post
I think -1c is correct.

The reason it wasn't playing the most recent video was because 30 seconds wasn't long enough of a delay for the video to begin downloading.
The -c flag sorts by ctime and -t sort by mtime, if a new file is created both should return it at the top (head -1). Maybe try the following code, it grabs the newest file prior to download and then compares it with the current newest file until it changes. Once it detects the downloading file it sleeps for 30 seconds to let it download some and then begins playing.

Code:
cd /media/mmc1/Videos
FILE=`/bin/ls -1t |head -1`
youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" `xclip -out` &
sleep 5
while [ "$FILE" = "`/bin/ls -1t |head -1`" ]; do sleep 5 ; done
sleep 30
mplayer `/bin/ls -1t |head -1`
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#458
Awesome!!!!
 
Addison's Avatar
Posts: 3,811 | Thanked: 1,151 times | Joined on Oct 2007 @ East Lansing, MI
#459
I tried your new script and it's perfect.

It takes about 55 seconds to play the video.

Before, it would take around 45 seconds or so, but with running Modest and doing two other things at a time, sometimes even a 45 second delay wasn't enough.

But this way, it fires up every time.

So yeah, big time thanks again!

I love it!
 
Posts: 215 | Thanked: 348 times | Joined on May 2011
#460
Originally Posted by auouymous View Post
xclip is what you want. Version 0.8 is in the debfarm repo but is twice the size it should be so might be compromised. I compiled version 0.12 and put it up on the ASUI download page http://asui.garage.maemo.org/_download/xclip . It isn't the full xclip package, only the xclip binary. Copy it to /usr/bin/xclip and chmod 755 it. You must then install the libxmu6 dependancy by running the following command as root:

Code:
apt-get install libxmu6
Now change your script to call xclip, those are grave marks around the command, it is the character on the tilde key of a full size keyboard.

Code:
#!/bin/sh
cd /media/mmc1/Videos
youtube-dl-x --no-part -f 5 -o "%(stitle)s.%(ext)s" `xclip -out`
Now you can just run that script without any parameters and it will download the selected youtube URL. Enjoy!
Thanks for this! I was just searching for something like xclip today, but it is not working for me... (I am using N900, could that be a reason why?)

Code:
Nokia-N900:~# xclip -version
xclip version 0.12
Copyright (C) 2001-2008 Kim Saunders et al.
Distributed under the terms of the GNU GPL
edit: after some more testing it does work, but not when I copy something from opera browser

Last edited by lonk; 2012-02-14 at 17:55.
 
Reply


 
Forum Jump


All times are GMT. The time now is 01:44.