Active Topics

 



Notices


Reply
Thread Tools
Posts: 858 | Thanked: 890 times | Joined on Sep 2010
#1
Moving this out of the mYTube thread...

Here is a complete script to download and play youtube videos that have been copied to the clipboard. Read the REQUIRED and USAGE sections in the script for more details.

http://asui.garage.maemo.org/_download/yt


.

Last edited by auouymous; 2012-06-12 at 03:27.
 

The Following 2 Users Say Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,807 | Thanked: 1,133 times | Joined on Oct 2007 @ East Lansing, MI
#2
Thank you so much auouymous.

It works almost perfect for me.

There are still some times when it will fire up playing the wrong video, but that's about it.

A few things to note.

There was talk about immediately deleting a video in the script once it's finished playing... Not a good idea.

My memory card would constantly corrupt this way for some reason. I'm not sure why.

Besides, if something is good, I'd rather move it to a Favorites folder anyway.

The new script to stop a current download is spot on now.

I did add this to the end of the kill youtube script just to clean up the memory card at the same time.

rm /media/mmc1/Videos/*.*

I no longer have to keep checking inside the Videos folder to see what's going on anymore. All the weirdness has completely stopped.

It would be neat if there was a simple way to like a video and have it moved to a Saved or Favorites folder.

Also perhaps a way to resume a download if something ever happened while downloading.

Lastly, for those really long vids, a way to resume watching it at a certain point rather than holding the fast forward key.

I guess there's no timestamp of where you left off if the video is still downloading.

Overall, this is amazing though and probably my most used activity while on the tablet these days.

Thanks again for breathing much needed life into this auouymous.

I absolutely love these scripts.
 
Posts: 858 | Thanked: 890 times | Joined on Sep 2010
#3
New version available.

It now queries the video name from youtube-dl-x and uses that to launch mplayer. That should fix the problem with it not playing the correct video.

The new yt clean command removes all videos in the download directory. This command invokes the kill option before removing videos.

I removed the keep option since mplayer probably terminates if it reaches the end of the video while it is still downloading. If it doesn terminate then the video would be deleted while youtube-dl-x is still downloading it. The file should be recreated but it could have been causing corruption. @Addison: do you have problems with the video not downloading fast enough and mplayer terminates before playing all of it?

The new yt save moves an already download video (URL must be in clipboard) to a saved video directory.




Originally Posted by Addison View Post
Also perhaps a way to resume a download if something ever happened while downloading.
Nope. Unless youtube-dl-x does it.


Originally Posted by Addison View Post
Lastly, for those really long vids, a way to resume watching it at a certain point rather than holding the fast forward key.
Nope.


Originally Posted by Addison View Post
I guess there's no timestamp of where you left off if the video is still downloading.
Eh?
 

The Following User Says Thank You to auouymous For This Useful Post:
Addison's Avatar
Posts: 3,807 | Thanked: 1,133 times | Joined on Oct 2007 @ East Lansing, MI
#4
Sweet!

I'll definitely be grabbing this.

To answer your one question, yeah, I think my DSL internet runs on shoe strings and dixie cups.

There will be times I can only get like 40 or so bytes per second.

I'm almost considering the idea of upgrading to dial up. *lol*

So anyway, there are times when Mplayer runs faster than the download itself.

In regards to the timestamp I mentioned...

When you fire up Mplayer and play a video that's fully downloaded, if you stop at some point, there's an option to resume where you left off.

However, if you start this at a time when the video is still downloading, that feature isn't available.

Well, you will always have my thanks for what you have done with this.

It's easily 5 times faster and easier to use than MyTube.

Congrats.
 
Addison's Avatar
Posts: 3,807 | Thanked: 1,133 times | Joined on Oct 2007 @ East Lansing, MI
#5
Okay. Just 3 things.

They can be ignored though since I'm completely happy already.

yt doesn't seem like a good idea.

I've had my memory card corrupted about a dozen times deleting a video immediately after Mplayer shuts down. Perhaps it has something to do with my slow internet speed. Maybe there should be a small, few second delay between these two commands. I'm not sure, I just know that it didn't work for me.

There are times when a download will time out and I'll have to start it all over again. This is kind of a pain for those 100+ meg videos.

I thought for sure youtube-dl-x had an option to resume a download if this were to ever happen.

Lastly, yt save. How do you know that you'll want to save the video before even viewing it>

Seems like that decision would come after.

Anyway, great ideas and concepts and your coding is awesome.

I wish that I had half your talents.

EDIT:

Fount it. -c, --continue (resume partially downloaded files)

Last edited by Addison; 2012-06-04 at 06:44.
 
Posts: 2,802 | Thanked: 4,487 times | Joined on Nov 2007
#6
Originally Posted by Addison View Post
I've had my memory card corrupted about a dozen times deleting a video immediately after Mplayer shuts down.
How do you recover? It may be that the filesystem on the card is still corrupted and deleting a file simply causes the kernel to realise it.
 

The Following User Says Thank You to lma For This Useful Post:
Addison's Avatar
Posts: 3,807 | Thanked: 1,133 times | Joined on Oct 2007 @ East Lansing, MI
#7
^ I get on my computer, reformat my entire memory card and then fill it back up again with a back up copy that I have on my Windows desktop.

It's kind of annoying.
 
Posts: 2,802 | Thanked: 4,487 times | Joined on Nov 2007
#8
That's a bit ... brute force, but should guarantee the filesystem is in good shape. Weird that it gets corrupted reproducibly simply by deleting a file. Does that happen in either SD slot?
 
Addison's Avatar
Posts: 3,807 | Thanked: 1,133 times | Joined on Oct 2007 @ East Lansing, MI
#9
Hey lma.

I really don't write to my internal memory card that much since it always seems to be in use.

But yeah, with my external one, I pound it with like 400 megs in files every day it seems like.

One question, since I've been using this YouTube script, there are times when my MMC1 card suddenly vanishes.

I have to pull it out and put it back in again for it to be recognized.

Is there perhaps just a command line to recheck the card?
 
Posts: 858 | Thanked: 890 times | Joined on Sep 2010
#10
Originally Posted by Addison View Post
yt doesn't seem like a good idea.
The last release no longer removed files unless you ran yt clean. I've updated the USAGE section so it no longer says it removes files.


Originally Posted by Addison View Post
Lastly, yt save. How do you know that you'll want to save the video before even viewing it
It does come after. You have to use yt get or yt to download the file and while the URL is still in clipboard you type yt save and it moves the already downloaded file. If you download a lot of files at once then yt save won't work unless you copy the URL again.


Originally Posted by Addison View Post
Fount it. -c, --continue (resume partially downloaded files)
New version uses -c.
 

The Following User Says Thank You to auouymous For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:05.