Update to latest release

epel9
Till Maas 14 years ago
parent 922ca5ac0d
commit 86328827ba

189
Home

@ -1,25 +1,39 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head> <head>
<title> <title>
rg3 / youtube-dl / wiki / Home &mdash; bitbucket.org rg3 / youtube-dl / wiki / Home &mdash; Bitbucket
</title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Mercurial hosting - we're here to serve." /> <meta name="description" content="" />
<meta name="keywords" content="mercurial,hg,hosting,bitbucket,rg3,youtube-dl,is,a,small,command-line,program,for,downloading,videos,from,YouTube.com.,wiki" /> <meta name="keywords" content="rg3,youtube-dl,is,a,small,command-line,program,for,downloading,videos,from,YouTube.com.,wiki" />
<link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/layout.css" />
<link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/screen.css" /> <link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/layout.css?10293858" />
<link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/print.css" media="print" /> <link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/screen.css?10293858" />
<link rel="stylesheet" href="http://bitbucket-assets.s3.amazonaws.com/css/reset.css?10293858" type="text/css" />
<link rel="stylesheet" href="http://bitbucket-assets.s3.amazonaws.com/css/main.css?10293858" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://bitbucket-assets.s3.amazonaws.com/css/print.css?10293858" media="print" />
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Bitbucket" /> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Bitbucket" />
<link rel="icon" href="http://bitbucket-assets.s3.amazonaws.com/img/logo_new.png" type="image/png"/> <link rel="icon" href="http://bitbucket-assets.s3.amazonaws.com/img/logo_new.png" type="image/png"/>
<script type="text/javascript">var MEDIA_URL = "http://bitbucket-assets.s3.amazonaws.com/"</script> <script type="text/javascript">var MEDIA_URL = "http://bitbucket-assets.s3.amazonaws.com/"</script>
<script type="text/javascript" src="http://bitbucket-assets.s3.amazonaws.com/js/lib/bundle.020510May.js"></script> <script type="text/javascript" src="http://bitbucket-assets.s3.amazonaws.com/js/lib/bundle.020510May.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
Dropdown.init(); $('.dropdown').hover(
$(".tooltip").tipsy({gravity:'s'}); function(){
$(this).addClass('open');
$(this).next('ul.dropdown-list').css('display', 'block');
},
function(){
$('.dropdown').removeClass('open');
$(this).next('ul.dropdown-list').css('display', 'none');
}
);
$.ajaxSetup ({ cache: false });
}); });
</script> </script>
<noscript> <noscript>
@ -30,29 +44,6 @@
</style> </style>
</noscript> </noscript>
<!--[if lt IE 7]>
<style type="text/css">
body {
behavior: url(http://bitbucket-assets.s3.amazonaws.com/css/csshover.htc);
}
#issues-issue pre {
white-space: normal !important;
}
.changeset-description {
white-space: normal !important;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$('#header-wrapper').pngFix();
$('#sourcelist').pngFix();
$('.promo-signup-screenshot').pngFix();
});
</script>
<![endif]-->
<link rel="stylesheet" href="http://bitbucket-assets.s3.amazonaws.com/css/highlight/default.css" type="text/css" /> <link rel="stylesheet" href="http://bitbucket-assets.s3.amazonaws.com/css/highlight/default.css" type="text/css" />
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
@ -64,29 +55,45 @@
<link href="/rg3/youtube-dl/rss" rel="alternate nofollow" type="application/rss+xml" title="RSS Feed for youtube-dl" /> <link href="/rg3/youtube-dl/rss" rel="alternate nofollow" type="application/rss+xml" title="RSS Feed for youtube-dl" />
<style type="text/css">
/* body { background: #fff url('/m/img/layout/bg_header_new.png') repeat-x left 24px !important; } */
</style>
</head> </head>
<body class=""> <body class="">
<div id="main-wrapper">
<div id="header-wrapper">
<div id="header"> <div id="header-wrap" class="clearfix">
<a href="/"><img src="http://bitbucket-assets.s3.amazonaws.com/img/logo_myriad.png" alt="Bitbucket" id="header-wrapper-logo" /></a> <div id="header" class="clearfix">
<ul id="global-nav">
<div id="header-nav"> <li id="global-nav-home"><a href="http://www.atlassian.com">Atlassian Home</a></li>
<ul class="right"> <li id="global-nav-documentation"><a href="http://confluence.atlassian.com/display/BITBUCKET">Documentation</a></li>
<li><a href="/">Home</a></li> <li id="global-nav-support"><a href="/support">Support</a></li>
<li><a href="/plans"><b>Plans &amp; Signup</b></a></li> <li id="global-nav-blogs"><a href="http://blog.bitbucket.org">Blog</a></li>
<li><a href="/repo/all">Repositories</a></li> <li id="global-nav-forums"><a href="http://groups.google.com/group/bitbucket-users">Forums</a></li>
<li><a href="/news">News</a></li>
<li><a href="/help">Help</a></li>
<li><a href="/account/signin/">Sign in</a></li>
</ul> </ul>
<div id="logo">
<a href="/">Bitbucket by Atlassian</a>
</div> </div>
<div id="main-nav" class="clearfix">
<ul class="clearfix">
<li><a href="/plans">Pricing &amp; Signup</a></li>
<li><a href="/repo/all">Explore Bitbucket</a></li>
<li><a href="/account/signin/">Log in</a></li>
<li class="search-box">
<form action="/repo/all/" method="get">
<input id="search" type="text" name="name" />
</form>
</li>
</ul>
</div> </div>
</div> </div>
<div id="content-wrapper">
</div>
@ -95,6 +102,17 @@
<div id="content-wrapper">
<div id="wrapper">
<div id="content-wrapper">
<div id="content">
@ -105,7 +123,7 @@
date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000)); date.setTime(date.getTime() + (365 * 24 * 60 * 60 * 1000));
var cookieoptions = { path: '/', expires: date }; var cookieoptions = { path: '/', expires: date };
window._shard = 'bfg02-gunicorn (ID 7)'; window._shard = 'bitbucket01 (ID 8)';
$(document).ready(function(){ $(document).ready(function(){
$('#toggle-repo-content').click(function(){ $('#toggle-repo-content').click(function(){
@ -177,7 +195,7 @@
<li class="ui-tabs-nav-issues"> <li class="ui-tabs-nav-issues">
<a href="/rg3/youtube-dl/issues?status=new&amp;status=open"><span>Issues (15) &raquo;</span></a> <a href="/rg3/youtube-dl/issues?status=new&amp;status=open"><span>Issues (17) &raquo;</span></a>
<ul> <ul>
<li><a href="/rg3/youtube-dl/issues?status=new">New issues</a></li> <li><a href="/rg3/youtube-dl/issues?status=new">New issues</a></li>
<li><a href="/rg3/youtube-dl/issues?status=new&amp;status=open">Open issues</a></li> <li><a href="/rg3/youtube-dl/issues?status=new&amp;status=open">Open issues</a></li>
@ -196,11 +214,11 @@
<li class="tabs-right tabs-far-right"> <li class="tabs-right tabs-far-right">
<a href="/rg3/youtube-dl/descendants"><span>Forks/Queues (12)</span></a> <a href="/rg3/youtube-dl/descendants"><span>Forks/Queues (17)</span></a>
</li> </li>
<li class="tabs-right"> <li class="tabs-right">
<a href="/rg3/youtube-dl/zealots"><span>Followers (85)</span></a> <a href="/rg3/youtube-dl/zealots"><span>Followers (97)</span></a>
</li> </li>
</ul> </ul>
</div> </div>
@ -235,9 +253,9 @@
<ul> <ul>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.zip" class="zip">zip</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.zip" class="zip">zip</a></li>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.gz" class="compressed">gz</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.gz" class="compressed">gz</a></li>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.bz2" class="compressed">bz2</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.bz2" class="compressed">bz2</a></li>
</ul> </ul>
@ -253,7 +271,7 @@
<ul> <ul>
<li><a href="/rg3/youtube-dl/src/2df34df5ff7d">default</a></li> <li><a href="/rg3/youtube-dl/src/190d2d0fd729">default</a></li>
</ul> </ul>
@ -263,7 +281,7 @@
<ul> <ul>
<li><a href="/rg3/youtube-dl/src/2df34df5ff7d">tip</a></li> <li><a href="/rg3/youtube-dl/src/190d2d0fd729">tip</a></li>
<li><a href="/rg3/youtube-dl/src/f8e09aa30813">2010.08.04</a></li> <li><a href="/rg3/youtube-dl/src/f8e09aa30813">2010.08.04</a></li>
@ -348,9 +366,9 @@
<ul> <ul>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.zip" class="zip">zip</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.zip" class="zip">zip</a></li>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.gz" class="compressed">gz</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.gz" class="compressed">gz</a></li>
<li><a rel="nofollow" href="/rg3/youtube-dl/get/2df34df5ff7d.bz2" class="compressed">bz2</a></li> <li><a rel="nofollow" href="/rg3/youtube-dl/get/190d2d0fd729.bz2" class="compressed">bz2</a></li>
</ul> </ul>
@ -371,7 +389,7 @@
<p class="repo-desc-description">youtube-dl is a small command-line program for downloading videos from <a href="http://YouTube.com" rel="nofollow">YouTube.com</a>.</p> <p class="repo-desc-description">youtube-dl is a small command-line program for downloading videos from <a href="http://YouTube.com" rel="nofollow">YouTube.com</a>.</p>
<div id="repo-desc-cloneinfo">Clone this repository (size: 313.2 KB): <a href="http://bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-ssh').hide();$('#clone-url-https').toggle();return(false);"><small>HTTPS</small></a> / <a href="ssh://hg@bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-https').hide();$('#clone-url-ssh').toggle();return(false);"><small>SSH</small></a><br/> <div id="repo-desc-cloneinfo">Clone this repository (size: 341.1 KB): <a href="http://bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-ssh').hide();$('#clone-url-https').toggle();return(false);"><small>HTTPS</small></a> / <a href="ssh://hg@bitbucket.org/rg3/youtube-dl" onclick="$('#clone-url-https').hide();$('#clone-url-ssh').toggle();return(false);"><small>SSH</small></a><br/>
<pre id="clone-url-https">$ hg clone <a href="http://bitbucket.org/rg3/youtube-dl">http://bitbucket.org/rg3/youtube-dl</a></pre> <pre id="clone-url-https">$ hg clone <a href="http://bitbucket.org/rg3/youtube-dl">http://bitbucket.org/rg3/youtube-dl</a></pre>
<pre id="clone-url-ssh" style="display:none;">$ hg clone <a href="ssh://hg@bitbucket.org/rg3/youtube-dl">ssh://hg@bitbucket.org/rg3/youtube-dl</a></pre></div> <pre id="clone-url-ssh" style="display:none;">$ hg clone <a href="ssh://hg@bitbucket.org/rg3/youtube-dl">ssh://hg@bitbucket.org/rg3/youtube-dl</a></pre></div>
@ -413,7 +431,7 @@
<h1 id="youtube-dl-download-videos-from-youtubecom">youtube-dl: Download videos from YouTube.com</h1> <h1 id="youtube-dl-download-videos-from-youtubecom">youtube-dl: Download videos from YouTube.com</h1>
<p>(and more...)</p> <p>(and more...)</p>
<h2 id="what-is-it">What is it?</h2> <h2 id="what-is-it">What is it?</h2>
<p><em>youtube-dl</em> is a small command-line program to download videos from YouTube.com and a few more sites. It requires the <a href="http://www.python.org/">Python interpreter</a>, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is <strong>2010.08.04</strong>. It's released to the public domain, which means you can modify it, redistribute it or use it however you like.</p> <p><em>youtube-dl</em> is a small command-line program to download videos from YouTube.com and a few more sites. It requires the <a href="http://www.python.org/">Python interpreter</a>, version 2.x (x being at least 4), and it's not platform specific. It should work in your Unix box, in Windows or in Mac OS X. The latest version is <strong>2010.10.03</strong>. It's released to the public domain, which means you can modify it, redistribute it or use it however you like.</p>
<p>I'll try to keep it updated if YouTube.com changes the way you access their videos. After all, it's a simple and short program. However, I can't guarantee anything. If you detect it stops working, check for new versions and/or inform me about the problem, indicating the program version you are using. If the program stops working and I can't solve the problem but you have a solution, I'd like to know it. If that happens and you feel you can maintain the program yourself, tell me. My contact information is at <a href="http://rg03.wordpress.com/contact-me/">rg03.wordpress.com</a>.</p> <p>I'll try to keep it updated if YouTube.com changes the way you access their videos. After all, it's a simple and short program. However, I can't guarantee anything. If you detect it stops working, check for new versions and/or inform me about the problem, indicating the program version you are using. If the program stops working and I can't solve the problem but you have a solution, I'd like to know it. If that happens and you feel you can maintain the program yourself, tell me. My contact information is at <a href="http://rg03.wordpress.com/contact-me/">rg03.wordpress.com</a>.</p>
<p>Thanks for all the feedback received so far. I'm glad people find my program useful.</p> <p>Thanks for all the feedback received so far. I'm glad people find my program useful.</p>
<h2 id="usage-instructions">Usage instructions</h2> <h2 id="usage-instructions">Usage instructions</h2>
@ -425,10 +443,10 @@
<p>The program is usually invoked as <em>youtube-dl</em> followed by options and the video URLs. Listing all the options here would make this text too long, so you can run <em>youtube-dl --help</em> and get a summary of them. From that point on you can start experimenting with the different options yourself. The most common ones are -t (or -l) to include the video title in the file name, and either -f or -b to download a high quality version of the video. Also, the -o option can specify the output file name and path. It allows special character sequences that can be used as templates to be replaced. See the "Output template" section for more details.</p> <p>The program is usually invoked as <em>youtube-dl</em> followed by options and the video URLs. Listing all the options here would make this text too long, so you can run <em>youtube-dl --help</em> and get a summary of them. From that point on you can start experimenting with the different options yourself. The most common ones are -t (or -l) to include the video title in the file name, and either -f or -b to download a high quality version of the video. Also, the -o option can specify the output file name and path. It allows special character sequences that can be used as templates to be replaced. See the "Output template" section for more details.</p>
<h2 id="download-it">Download it</h2> <h2 id="download-it">Download it</h2>
<p>Note that if you directly click on these hyperlinks, your web browser will most likely display the program contents. It's usually better to right-click on it and choose the appropriate option, normally called <em>Save Target As</em> or <em>Save Link As</em>, depending on the web browser you are using.</p> <p>Note that if you directly click on these hyperlinks, your web browser will most likely display the program contents. It's usually better to right-click on it and choose the appropriate option, normally called <em>Save Target As</em> or <em>Save Link As</em>, depending on the web browser you are using.</p>
<h3 id="httpbitbucketorgrg3youtube-dlraw20100804youtube-dl20100804"><a href="http://bitbucket.org/rg3/youtube-dl/raw/2010.08.04/youtube-dl">2010.08.04</a></h3> <h3 id="httpbitbucketorgrg3youtube-dlraw20101003youtube-dl20101003"><a href="http://bitbucket.org/rg3/youtube-dl/raw/2010.10.03/youtube-dl">2010.10.03</a></h3>
<ul><li><strong>MD5</strong>: 8b1b8b922b758aae28f6c158e9a1baba <ul><li><strong>MD5</strong>: c552c00881845689900b67525ac6f72b
</li><li><strong>SHA1</strong>: 1497bbaecc3a9b0f343021ab9a1d940315a1003e </li><li><strong>SHA1</strong>: 436006432018fca75298e63742bb2c13feb42f98
</li><li><strong>SHA256</strong>: 55044a3232a119b82bc8b8b521fba54059b26ec09577606e4a12ce7903732a56 </li><li><strong>SHA256</strong>: eb6a5deb494e8949918ca5a674d961439963fadd822df67dfa49ce47fa326d75
</li></ul> </li></ul>
<h2 id="faq">FAQ</h2> <h2 id="faq">FAQ</h2>
<p>The <a href="/rg3/youtube-dl/wiki/Frequently_Asked_Questions">Frequently Asked Questions</a> page contains answers to some common questions that pop up in my e-mail and in the issue tracker. Be sure to check it before reporting problems.</p> <p>The <a href="/rg3/youtube-dl/wiki/Frequently_Asked_Questions">Frequently Asked Questions</a> page contains answers to some common questions that pop up in my e-mail and in the issue tracker. Be sure to check it before reporting problems.</p>
@ -474,23 +492,42 @@
</div> </div>
<div class="cb"></div>
</div> </div>
<div class="cb footer-placeholder"></div>
<div id="footer" class="clearfix">
<ul class="footer-nav">
<li>Copyright &copy; 2010 <a href="http://atlassian.com">Atlassian</a><span class="pipe">|</span></li>
<li><a href="http://www.atlassian.com/hosted/terms.jsp">Terms of Service</a><span class="pipe">|</span></li>
<li><a href="http://www.atlassian.com/about/privacy.jsp">Privacy</a></li>
</ul>
<ul class="social-nav">
<li class="blog"><a href="http://blog.bitbucket.org">Bitbucket Blog</a></li>
<li class="twitter"><a href="http://www.twitter.com/bitbucket">Twitter</a></li>
</ul>
</div> </div>
<div id="footer-wrapper"> <div id="footer2" class="clearfix">
<div id="footer"> We run
<a href="/site/terms/">TOS</a> | <a href="/site/privacy/">Privacy Policy</a> | <a href="http://blog.bitbucket.org/">Blog</a> | <a href="http://bitbucket.org/jespern/bitbucket/issues/new/">Report Bug</a> | <a href="http://groups.google.com/group/bitbucket-users">Discuss</a> | <a href="http://avantlumiere.com/">&copy; 2008-2010</a> <a href="http://www.djangoproject.com/">Django 1.2.3</a> /
| We run <small><b>
<a href="http://www.djangoproject.com/">Django 1.2.1</a> /
<a href="http://bitbucket.org/jespern/django-piston/">Piston 0.2.3rc1</a> / <a href="http://bitbucket.org/jespern/django-piston/">Piston 0.2.3rc1</a> /
<a href="http://www.selenic.com/mercurial/">Hg 1.3.1</a> / <a href="http://www.selenic.com/mercurial/">Hg 1.6</a> /
<a href="http://www.python.org">Python 2.7.0</a> / <a href="http://www.python.org">Python 2.7.0</a> /
r3101| bfg02 r3577 | bitbucket01
</b></small>
</div>
</div> </div>
</div> </div>
<!-- <script type="text/javascript"> Cufon.now(); </script> -->
<script type="text/javascript"> <script type="text/javascript">
var _gaq = _gaq || []; var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2456069-3'], ['_trackPageview']); _gaq.push(['_setAccount', 'UA-2456069-3'], ['_trackPageview']);

@ -194,7 +194,7 @@ class FileDownloader(object):
ignoreerrors: Do not stop on download errors. ignoreerrors: Do not stop on download errors.
ratelimit: Download speed limit, in bytes/sec. ratelimit: Download speed limit, in bytes/sec.
nooverwrites: Prevent overwriting files. nooverwrites: Prevent overwriting files.
retries: Number of times to retry for HTTP error 503 retries: Number of times to retry for HTTP error 5xx
continuedl: Try to continue downloads if possible. continuedl: Try to continue downloads if possible.
noprogress: Do not print the progress bar. noprogress: Do not print the progress bar.
""" """
@ -353,12 +353,12 @@ class FileDownloader(object):
(percent_str, data_len_str, speed_str, eta_str), skip_eol=True) (percent_str, data_len_str, speed_str, eta_str), skip_eol=True)
def report_resuming_byte(self, resume_len): def report_resuming_byte(self, resume_len):
"""Report attemtp to resume at given byte.""" """Report attempt to resume at given byte."""
self.to_stdout(u'[download] Resuming download at byte %s' % resume_len) self.to_stdout(u'[download] Resuming download at byte %s' % resume_len)
def report_retry(self, count, retries): def report_retry(self, count, retries):
"""Report retry in case of HTTP error 503""" """Report retry in case of HTTP error 5xx"""
self.to_stdout(u'[download] Got HTTP error 503. Retrying (attempt %d of %d)...' % (count, retries)) self.to_stdout(u'[download] Got server HTTP error. Retrying (attempt %d of %d)...' % (count, retries))
def report_file_already_downloaded(self, file_name): def report_file_already_downloaded(self, file_name):
"""Report file has already been fully downloaded.""" """Report file has already been fully downloaded."""
@ -404,15 +404,16 @@ class FileDownloader(object):
template_dict['ord'] = unicode('%05d' % self._num_downloads) template_dict['ord'] = unicode('%05d' % self._num_downloads)
filename = self.params['outtmpl'] % template_dict filename = self.params['outtmpl'] % template_dict
except (ValueError, KeyError), err: except (ValueError, KeyError), err:
self.trouble('ERROR: invalid output template or system charset: %s' % str(err)) self.trouble(u'ERROR: invalid system charset or erroneous output template')
return
if self.params.get('nooverwrites', False) and os.path.exists(filename): if self.params.get('nooverwrites', False) and os.path.exists(filename):
self.to_stderr(u'WARNING: file exists: %s; skipping' % filename) self.to_stderr(u'WARNING: file exists and will be skipped')
return return
try: try:
self.pmkdir(filename) self.pmkdir(filename)
except (OSError, IOError), err: except (OSError, IOError), err:
self.trouble('ERROR: unable to create directories: %s' % str(err)) self.trouble(u'ERROR: unable to create directories: %s' % str(err))
return return
try: try:
@ -420,17 +421,17 @@ class FileDownloader(object):
except (OSError, IOError), err: except (OSError, IOError), err:
raise UnavailableVideoError raise UnavailableVideoError
except (urllib2.URLError, httplib.HTTPException, socket.error), err: except (urllib2.URLError, httplib.HTTPException, socket.error), err:
self.trouble('ERROR: unable to download video data: %s' % str(err)) self.trouble(u'ERROR: unable to download video data: %s' % str(err))
return return
except (ContentTooShortError, ), err: except (ContentTooShortError, ), err:
self.trouble('ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded)) self.trouble(u'ERROR: content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))
return return
if success: if success:
try: try:
self.post_process(filename, info_dict) self.post_process(filename, info_dict)
except (PostProcessingError), err: except (PostProcessingError), err:
self.trouble('ERROR: postprocessing: %s' % str(err)) self.trouble(u'ERROR: postprocessing: %s' % str(err))
return return
def download(self, url_list): def download(self, url_list):
@ -455,7 +456,7 @@ class FileDownloader(object):
break break
if not suitable_found: if not suitable_found:
self.trouble('ERROR: no suitable InfoExtractor: %s' % url) self.trouble(u'ERROR: no suitable InfoExtractor: %s' % url)
return self._download_retcode return self._download_retcode
@ -495,7 +496,7 @@ class FileDownloader(object):
self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename)) self.to_stdout(u'\r[rtmpdump] %s bytes' % os.path.getsize(filename))
return True return True
else: else:
self.trouble('\nERROR: rtmpdump exited with code %d' % retval) self.trouble(u'\nERROR: rtmpdump exited with code %d' % retval)
return False return False
def _do_download(self, filename, url, player_url): def _do_download(self, filename, url, player_url):
@ -528,7 +529,7 @@ class FileDownloader(object):
data = urllib2.urlopen(request) data = urllib2.urlopen(request)
break break
except (urllib2.HTTPError, ), err: except (urllib2.HTTPError, ), err:
if err.code != 503 and err.code != 416: if (err.code < 500 or err.code >= 600) and err.code != 416:
# Unexpected HTTP error # Unexpected HTTP error
raise raise
elif err.code == 416: elif err.code == 416:
@ -538,7 +539,7 @@ class FileDownloader(object):
data = urllib2.urlopen(basic_request) data = urllib2.urlopen(basic_request)
content_length = data.info()['Content-Length'] content_length = data.info()['Content-Length']
except (urllib2.HTTPError, ), err: except (urllib2.HTTPError, ), err:
if err.code != 503: if err.code < 500 or err.code >= 600:
raise raise
else: else:
# Examine the reported length # Examine the reported length
@ -588,12 +589,13 @@ class FileDownloader(object):
(stream, filename) = sanitize_open(filename, open_mode) (stream, filename) = sanitize_open(filename, open_mode)
self.report_destination(filename) self.report_destination(filename)
except (OSError, IOError), err: except (OSError, IOError), err:
self.trouble('ERROR: unable to open for writing: %s' % str(err)) self.trouble(u'ERROR: unable to open for writing: %s' % str(err))
return False return False
try: try:
stream.write(data_block) stream.write(data_block)
except (IOError, OSError), err: except (IOError, OSError), err:
self.trouble('\nERROR: unable to write data: %s' % str(err)) self.trouble(u'\nERROR: unable to write data: %s' % str(err))
return False
block_size = self.best_block_size(after - before, data_block_len) block_size = self.best_block_size(after - before, data_block_len)
# Progress message # Progress message
@ -684,7 +686,7 @@ class InfoExtractor(object):
class YoutubeIE(InfoExtractor): class YoutubeIE(InfoExtractor):
"""Information extractor for youtube.com.""" """Information extractor for youtube.com."""
_VALID_URL = r'^((?:http://)?(?:youtu\.be/|(?:\w+\.)?youtube\.com/(?:(?:v/)|(?:(?:watch(?:_popup)?(?:\.php)?)?[\?#](?:.+&)?v=))))?([0-9A-Za-z_-]+)(?(1).+)?$' _VALID_URL = r'^((?:http://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/(?:(?:v/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=))))?([0-9A-Za-z_-]+)(?(1).+)?$'
_LANG_URL = r'http://www.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1' _LANG_URL = r'http://www.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1'
_LOGIN_URL = 'http://www.youtube.com/signup?next=/&gl=US&hl=en' _LOGIN_URL = 'http://www.youtube.com/signup?next=/&gl=US&hl=en'
_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en' _AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'
@ -847,7 +849,7 @@ class YoutubeIE(InfoExtractor):
return return
if 'token' not in video_info: if 'token' not in video_info:
if 'reason' in video_info: if 'reason' in video_info:
self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0]) self._downloader.trouble(u'ERROR: YouTube said: %s' % video_info['reason'][0].decode('utf-8'))
else: else:
self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason') self._downloader.trouble(u'ERROR: "token" parameter not in video info for unknown reason')
return return
@ -1020,7 +1022,6 @@ class MetacafeIE(InfoExtractor):
self._downloader.increment_downloads() self._downloader.increment_downloads()
simple_title = mobj.group(2).decode('utf-8') simple_title = mobj.group(2).decode('utf-8')
video_extension = 'flv'
# Retrieve video webpage to extract further information # Retrieve video webpage to extract further information
request = urllib2.Request('http://www.metacafe.com/watch/%s/' % video_id) request = urllib2.Request('http://www.metacafe.com/watch/%s/' % video_id)
@ -1034,20 +1035,33 @@ class MetacafeIE(InfoExtractor):
# Extract URL, uploader and title from webpage # Extract URL, uploader and title from webpage
self.report_extraction(video_id) self.report_extraction(video_id)
mobj = re.search(r'(?m)&mediaURL=([^&]+)', webpage) mobj = re.search(r'(?m)&mediaURL=([^&]+)', webpage)
if mobj is None: if mobj is not None:
self._downloader.trouble(u'ERROR: unable to extract media URL')
return
mediaURL = urllib.unquote(mobj.group(1)) mediaURL = urllib.unquote(mobj.group(1))
video_extension = mediaURL[-3:]
# Extract gdaKey if available # Extract gdaKey if available
mobj = re.search(r'(?m)&gdaKey=(.*?)&', webpage) mobj = re.search(r'(?m)&gdaKey=(.*?)&', webpage)
if mobj is None: if mobj is None:
video_url = mediaURL video_url = mediaURL
#self._downloader.trouble(u'ERROR: unable to extract gdaKey')
#return
else: else:
gdaKey = mobj.group(1) gdaKey = mobj.group(1)
video_url = '%s?__gda__=%s' % (mediaURL, gdaKey) video_url = '%s?__gda__=%s' % (mediaURL, gdaKey)
else:
mobj = re.search(r' name="flashvars" value="(.*?)"', webpage)
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract media URL')
return
vardict = parse_qs(mobj.group(1))
if 'mediaData' not in vardict:
self._downloader.trouble(u'ERROR: unable to extract media URL')
return
mobj = re.search(r'"mediaURL":"(http.*?)","key":"(.*?)"', vardict['mediaData'][0])
if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract media URL')
return
mediaURL = mobj.group(1).replace('\\/', '/')
video_extension = mediaURL[-3:]
video_url = '%s?__gda__=%s' % (mediaURL, mobj.group(2))
mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage) mobj = re.search(r'(?im)<title>(.*) - Video</title>', webpage)
if mobj is None: if mobj is None:
@ -1144,7 +1158,7 @@ class DailymotionIE(InfoExtractor):
video_title = mobj.group(1).decode('utf-8') video_title = mobj.group(1).decode('utf-8')
video_title = sanitize_title(video_title) video_title = sanitize_title(video_title)
mobj = re.search(r'(?im)<div class="dmco_html owner">.*?<a class="name" href="/.+?">(.+?)</a></div>', webpage) mobj = re.search(r'(?im)<div class="dmco_html owner">.*?<a class="name" href="/.+?">(.+?)</a>', webpage)
if mobj is None: if mobj is None:
self._downloader.trouble(u'ERROR: unable to extract uploader nickname') self._downloader.trouble(u'ERROR: unable to extract uploader nickname')
return return
@ -2087,7 +2101,7 @@ if __name__ == '__main__':
# Parse command line # Parse command line
parser = optparse.OptionParser( parser = optparse.OptionParser(
usage='Usage: %prog [options] url...', usage='Usage: %prog [options] url...',
version='2010.08.04', version='2010.10.03',
conflict_handler='resolve', conflict_handler='resolve',
) )

@ -1,5 +1,5 @@
Name: youtube-dl Name: youtube-dl
Version: 2010.08.04 Version: 2010.10.03
Release: 1%{?dist} Release: 1%{?dist}
Summary: Small command-line program to download videos from YouTube Summary: Small command-line program to download videos from YouTube
Summary(pl): Tekstowy program do pobierania filmów z youtube.com Summary(pl): Tekstowy program do pobierania filmów z youtube.com
@ -39,6 +39,9 @@ rm -rf $RPM_BUILD_ROOT
%doc index.html %doc index.html
%changelog %changelog
* Thu Oct 07 2010 Till Maas <opensource@till.name> - 2010.10.03-1
- Update to latest release
* Thu Aug 05 2010 Till Maas <opensource@till.name> - 2010.08.04-1 * Thu Aug 05 2010 Till Maas <opensource@till.name> - 2010.08.04-1
- Update to latest release - Update to latest release

Loading…
Cancel
Save