![]() |
Youtube download script
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 . |
Re: Youtube download script
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. :) |
Re: Youtube download script
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. Quote:
Quote:
Quote:
|
Re: Youtube download script
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. :) |
Re: Youtube download script
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) |
Re: Youtube download script
Quote:
|
Re: Youtube download script
^ 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. :) |
Re: Youtube download script
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?
|
Re: Youtube download script
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? |
Re: Youtube download script
Quote:
Quote:
Quote:
|
Re: Youtube download script
Wow!
This is wonderful! Many thanks again chief. :) |
Re: Youtube download script
Quote:
|
Re: Youtube download script
I've never once bothered to swap them.
I was going to pick up a 128 gig card this month. Now that would be a real pain if it ever got corrupted. My computer only has like 80 megs on it. :( |
Re: Youtube download script
Quote:
|
Re: Youtube download script
Somebody tried it and said that it worked.
By the way, I never new that there were so many full, modern, Hollywood movies that can be found on YouTube until today. So happy. <3 |
Re: Youtube download script
Quote:
|
Re: Youtube download script
Quick question.
For something like this... http://m.youtube.com/watch?gl=US&hl=...&v=RhY0RdDQdro Is it possible with the -F option to see what all of the formats are available for download and can the tablet even run those with slightly higher quality, even if you had to use Media Player instead? |
Re: Youtube download script
Using Firefox download helper on my computer, I've seen just the video's title name, medium, 240, 320, 480, 720, and 1080p options for download.
I'm wondering if the tablet can run something higher than the lowest encoding. I guess I could just find out myself later tonight. :) |
Re: Youtube download script
Quote:
Just setup a little server script on your desktop, have your tablet send a request to it to download a highest quality youtube video, encode for your tablet, scp it over and then send your tablet an email notification. Switch your desktop to Linux and I'll write it for you. ;) |
Re: Youtube download script
Yeah, I did some testing tonight and almost got 360p to play but it wasn't quite there though. :(
It's weird because I have some videos in mp4 format that are actually a much better quality and have perfect playback. I'll have to look into what the difference between these are on this. |
Re: Youtube download script
Well, from the video I posted above:
"360P" download was 640x260 Frame rate 48 "Medium" download was 640x260 Frame rate 24 If it were in .avi format with mp3 audio instead of mp4, "Medium" would probably play quite nicely. I never did understand why mp4 is used over avi with YouTube. Not even my Xbox can play that format very well. Oh well, I think maybe I should look into installing Linux, just for auouymous. :) |
Re: Youtube download script
Quote:
Quote:
Quote:
|
Re: Youtube download script
So I downloaded this video at 720P.
http://m.youtube.com/watch?v=hBYymaN...e_gdata_player I was able to transcode it to 640x368, at 44100 sample rate for audio. It looked and sounded good but really wasn't worth the time. Anyway, I also downloaded it using youtube-dl-x and noticed something. With the tablet's version, the audio was only at 22050. I'm not sure how all of the encoding for a video is stored at YouTube, but is it possible to grab the lowest video quality like it does now but also a better audio at the same time in your script? It seems like the audio should always be a stereo mp3 at a 44100 kHz sample rate, and 128 Kbps bit rate. Can this be done? Cheers. :) |
Re: Youtube download script
Okay, say for this YouTuber...
http://m.youtube.com/user/osirislightandsound Is it possible to just grab the audio at 44100 kHz, 128 Kbps and not even bother with the video? Looking through the youtube-dl-x options, it seems like it can only be done after downloading it in full and then doing some post-processing on it afterwards which isn't supported because we don't have ffmeg and ffprobe compiled. Is this correct? Thanks ahead as always. :) |
Re: Youtube download script
Quote:
Quote:
|
Re: Youtube download script
Yeah, that's what I thought.
Thanks chief! |
Re: Youtube download script
Well, you know me, always asking questions. *lol*
So for this... http://m.youtube.com/watch?gl=US&hl=...&v=BQu4PUJ5oA4 To get the quickest and best audio quality, would that be just to download it in 720P format and then play the .mp4 through XMMS? I tried this and it's showing that the audio is in Variable Bit Rate format so I'm not sure if that is the high, low or medium end for the sound. Thanks! |
Re: Youtube download script
Quote:
|
Re: Youtube download script
Hey chief.
Is yt clean working on your end? If I run it while a video is playing I get Code:
killall: cannot kill pid 15814: No such process Code:
You need to specify whom to kill |
Re: Youtube download script
Quote:
Version 1.3 is now available to fix that and also adds ability to specify URL on command line. |
Re: Youtube download script
Suweet! :D
|
Re: Youtube download script
I wanted to try this out, but I can't install xclip, I get an error that the package isn't the right size.
I've used myTube before, but the video doesn't start until the download is totally complete for me, and that takes quite a long time generally. It seems from reading some of the threads (including this one) that viewing should happen as the youtube video is downloading? |
Re: Youtube download script
Give me a minute to fire up my computer and I'll upload xclip for you. :)
|
Re: Youtube download script
Quote:
Quote:
|
Re: Youtube download script
^ Okay.
I think I also remember seeing it in the Application Catalog as well, maybe under Maemo Extras, I can't remember. Also, Shawn, yeah, it will begin playing the video 30 seconds after it begins downloading but you can change that time depending upon your internet speed. |
Re: Youtube download script
Quote:
-- BTW, anyone happen to know why the forum unsubscribes me after I post in a thread? |
Re: Youtube download script
Quote:
I've got about 30 subscriptions and not once have I lost any of them by posting in a thread. Very weird. |
Re: Youtube download script
When all else fails, RTFM! :) Got it working. Thanks for that!
I noticed on my system that running this under Busybox, mplayer doesn't launch properly. Running under bash works fine. |
Re: Youtube download script
Quote:
Quote:
Perhaps there are some new coding changes here at TMO. |
Re: Youtube download script
My notifications always had that, and it was even true until a few months ago (I think when the forum subscriptions went live). Now I get notifications for every post regardless of visiting here or not.
|
All times are GMT. The time now is 00:31. |
vBulletin® Version 3.8.8