Comments for youtube-dl
13 Mar 2010 19:56
Thank you!! This is a great piece of software! It works like a sharm!!!!!!!!!!!
14 May 2009 07:36
youtube-dl is a very handy program to download videos from YouTube. It's proven very useful for me, and I'm using it often. Highly recommended.
12 May 2009 08:43
Thank you for 2009.05.11 and the return of the -b option! -f was slightly annoying.
02 Apr 2009 16:39
Sorry to bother you. I have been using Youtube-dl for a project but can't see to find a way to get it to do an exact phrase search. youtube-dl.py "ytsearchall:Dog eat Cat" --get-url --format=18. I would like to generate the same search query as if going to YouTube and typing in "Dog eat Cat" including the speech marks to make it an exact phrase match. I have tried numerous ways but don't end up with the right results. Could you possible post the solution. Love the program by the way!
18 Feb 2008 06:41
Target download directory and multiple download URLs
I've written a couple of patches - one adds -d and --directory options to specify a target directory for the the download(s). The other patch allows multiple youtube links to be given as arguments to the script
Target directory patch: arienh.homeip.net/misc... (arienh.homeip.net/misc...)
Multiple link patch: arienh.homeip.net/misc... (arienh.homeip.net/misc...)
Combination patch (as they'll probably conflict due to the large amount of indentation in the multi-link patch): arienh.homeip.net/misc... (arienh/misc/youtube-dl...)
Patches were made against the 2008.01.24 release
29 Jan 2008 17:36
patch to encode flv to mpeg
This textarea entry seems to break the patch. I've emailed
you through fm, and that textarea is the same. Contact me
for proper patch. My freshmeat email needs updating. Don't
use it. I left my current email in other message.
--- youtube-dl 2008-01-29
19:14:00.000000000 -0600
+++ youtube-dl.new 2008-01-29
19:15:00.000000000 -0600
@@ -37,6 +37,7 @@
import sys
import time
import urllib2
+import subprocess
# Global constants
const_1k = 1024
@@ -210,6 +211,8 @@
cmdl_parser.add_option('-n', '--netrc',
action='store_true', dest='use_netrc',
help='use .netrc authentication data')
cmdl_parser.add_option('-g', '--get-url',
action='store_true', dest='get_url', help='print final
video URL only')
cmdl_parser.add_option('-2', '--title-too',
action='store_true', dest='get_title', help='used
with -g, print title too')
+cmdl_parser.add_option('-e', '--encode',
action='store_true', dest='encode', help='encode
video to mpeg')
+cmdl_parser.add_option('-k', '--keep-flv',
action='store_true', dest='keep_flv', help='keep
original flv when encoding mpeg')
(cmdl_opts, cmdl_args) = cmdl_parser.parse_args()
# Set socket timeout
@@ -383,5 +386,30 @@
except KeyboardInterrupt:
sys.exit('\n')
+# encode with ffmpeg
+if cmdl_opts.encode:
+ cond_print("encoding video to mpeg")
+ # this if statement needs to be fixed for
windows
+ if subprocess.call(('which','ffmpeg'),
stdout=file(os.devnull, 'w')):
+ sys.exit('Error: ffmpeg is needed to
encode to mpeg')
+ video_filename_root = video_filename
+ # chop .flv extension, if there
+ if video_filename.endswith('.flv'):
+ video_filename_root =
video_filename[:-4]
+ cmd = ('ffmpeg', '-i',
video_filename, '%s.mpg' % video_filename_root)
+ stdout = None
+ if cmdl_opts.quiet:
+ stdout = file(os.devnull, 'w')
+ err = subprocess.call(cmd, stdout=stdout,
stderr=stdout)
+ if not err:
+ cond_print("video %s encoded
successfully!\n" % video_filename)
+ if not cmdl_opts.keep_flv:
+ os.remove(video_filename)
+ else:
+ cond_print("keeping original
file %s\n" % video_filename)
+ else:
+ os.remove('%s.mpg' %
video_filename_root)
+ sys.exit("Error: This file won't encode to
mpeg, ffmpeg returned %d" % err)
+
# Finish
sys.exit()
Current version 2010.12.09 does not work with Python 3.1.
It does though work great with Python 2.6.
Great job. I've been using for years and love it. Thanks!