One thing I enjoy doing with my Asus Eee Ultra Laptop is playing youtube files from a flash drive hooked up to it. That way I don’t need internet access, and I can play a bunch at a time, while in bed before going to sleep, or whenever.

The most common script for downloading YouTube videos is “youtube-dl”, written by Ricardo Garcia Gonzalez. This can be Googled and downloaded freely, and runs on all platforms without modification. Python is good that way.

Before I get to my small helper script, I’ll add that if you indeed want, “out of the box”, you can call this script with a bunch of youtube URL’s as parameters. Don’t know of a limit.

c:\python\python.exe youtube-dl http://youtube.com/watch?v=BqLvBUSJucg <anotherurl> <anotherurl2>

But if you’d like to just simply have a text file that you open up conveniently (name it youtubeurls.txt, cuz that’s what it refers to in the script below or change it of course), each line containing one url, and be able to call one script to take care of it, instead of having to paste a bunch of url’s in the command line, use the following script (maybe there’s a way to do in DOS, but I couldn’t figure it out.)

————————————–name this something.py—-

import os
urlfile = "youtubeurls.txt"

youtubefile = open(urlfile,'r')
for line in youtubefile:
    os.system("c:\python25\python youtube-dl.py " + line)

youtubefile.close()