A feature-rich command-line audio/video downloader
transplant ceba827e9aab563ae7c7190fc236ec1aa358ee59, d891ff9fd9952b2829a47b508acf40d951546123, 69d3b2d8249e677c40d529e017cb765f50ba3fa0, 071940680fc19be26e068c4c72d508ca252c1031
Filippo Valsorda74a5ff5f43fc
diff --git a/youtube-dl b/youtube-dlindex c7a116d9df..595cce497c 100755--- a/youtube-dl+++ b/youtube-dl@@ -15,6 +15,7 @@ __authors__ = ('Kevin Ngo','Ori Avtalion','shizeeg',+ 'Filippo Valsorda',)__license__ = 'Public Domain'diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.pyindex 5f874b72f4..595cce497c 100755--- a/youtube_dl/__init__.py+++ b/youtube_dl/__init__.py@@ -1176,6 +1176,7 @@ class YoutubeIE(InfoExtractor):_LANG_URL = r'http://www.youtube.com/?hl=en&persist_hl=1&gl=US&persist_gl=1&opt_out_ackd=1'_LOGIN_URL = 'https://www.youtube.com/signup?next=/&gl=US&hl=en'_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'+ _NEXT_URL_RE = r'[\?&]next_url=([^&]+)'_NETRC_MACHINE = 'youtube'# Listed in order of quality_available_formats = ['38', '37', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13']@@ -1336,6 +1337,11 @@ class YoutubeIE(InfoExtractor):returndef _real_extract(self, url):+ # Extract original video URL from URL with redirection, like age verification, using next_url parameter+ mobj = re.search(self._NEXT_URL_RE, url)+ if mobj:+ url = 'http://www.youtube.com/' + urllib.unquote(mobj.group(1)).lstrip('/')+# Extract video id from URLmobj = re.match(self._VALID_URL, url)if mobj is None:@@ -4564,6 +4570,7 @@ def _real_main():except IOError:sys.exit(u'ERROR: batch file could not be read')all_urls = batchurls + args+ all_urls = map(lambda url: url.strip(), all_urls)# General configurationcookie_processor = urllib2.HTTPCookieProcessor(jar)