mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-10-23 16:48:37 +09:00
Compare commits
3 Commits
2011.09.27
...
2011.09.30
Author | SHA1 | Date | |
---|---|---|---|
![]() |
54d47874f7 | ||
![]() |
2761012f69 | ||
![]() |
3de2a1e635 |
@@ -1 +1 @@
|
|||||||
2011.09.27
|
2011.09.30
|
||||||
|
@@ -68,6 +68,7 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
-f, --format FORMAT video format code
|
-f, --format FORMAT video format code
|
||||||
--all-formats download all available video formats
|
--all-formats download all available video formats
|
||||||
--max-quality FORMAT highest quality format to download
|
--max-quality FORMAT highest quality format to download
|
||||||
|
-F, --list-formats list all available formats (currently youtube only)
|
||||||
|
|
||||||
### Authentication Options:
|
### Authentication Options:
|
||||||
-u, --username USERNAME account username
|
-u, --username USERNAME account username
|
||||||
|
28
youtube-dl
28
youtube-dl
@@ -15,7 +15,7 @@ __author__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
__license__ = 'Public Domain'
|
__license__ = 'Public Domain'
|
||||||
__version__ = '2011.09.27'
|
__version__ = '2011.09.30'
|
||||||
|
|
||||||
UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
|
UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
|
||||||
|
|
||||||
@@ -1103,6 +1103,21 @@ class YoutubeIE(InfoExtractor):
|
|||||||
'44': 'webm',
|
'44': 'webm',
|
||||||
'45': 'webm',
|
'45': 'webm',
|
||||||
}
|
}
|
||||||
|
_video_dimensions = {
|
||||||
|
'5': '240x400',
|
||||||
|
'6': '???',
|
||||||
|
'13': '???',
|
||||||
|
'17': '144x176',
|
||||||
|
'18': '360x640',
|
||||||
|
'22': '720x1280',
|
||||||
|
'34': '360x640',
|
||||||
|
'35': '480x854',
|
||||||
|
'37': '1080x1920',
|
||||||
|
'38': '3072x4096',
|
||||||
|
'43': '360x640',
|
||||||
|
'44': '480x854',
|
||||||
|
'45': '720x1280',
|
||||||
|
}
|
||||||
IE_NAME = u'youtube'
|
IE_NAME = u'youtube'
|
||||||
|
|
||||||
def report_lang(self):
|
def report_lang(self):
|
||||||
@@ -1137,6 +1152,11 @@ class YoutubeIE(InfoExtractor):
|
|||||||
"""Indicate the download will use the RTMP protocol."""
|
"""Indicate the download will use the RTMP protocol."""
|
||||||
self._downloader.to_screen(u'[youtube] RTMP download detected')
|
self._downloader.to_screen(u'[youtube] RTMP download detected')
|
||||||
|
|
||||||
|
def _print_formats(self, formats):
|
||||||
|
print 'Available formats:'
|
||||||
|
for x in formats:
|
||||||
|
print '%s\t:\t%s\t[%s]' %(x, self._video_extensions.get(x, 'flv'), self._video_dimensions.get(x, '???'))
|
||||||
|
|
||||||
def _real_initialize(self):
|
def _real_initialize(self):
|
||||||
if self._downloader is None:
|
if self._downloader is None:
|
||||||
return
|
return
|
||||||
@@ -1330,6 +1350,9 @@ class YoutubeIE(InfoExtractor):
|
|||||||
if len(existing_formats) == 0:
|
if len(existing_formats) == 0:
|
||||||
self._downloader.trouble(u'ERROR: no known formats available for video')
|
self._downloader.trouble(u'ERROR: no known formats available for video')
|
||||||
return
|
return
|
||||||
|
if self._downloader.params.get('listformats', None):
|
||||||
|
self._print_formats(existing_formats)
|
||||||
|
return
|
||||||
if req_format is None or req_format == 'best':
|
if req_format is None or req_format == 'best':
|
||||||
video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
|
video_url_list = [(existing_formats[0], url_map[existing_formats[0]])] # Best quality
|
||||||
elif req_format == 'worst':
|
elif req_format == 'worst':
|
||||||
@@ -3564,6 +3587,8 @@ def parseOpts():
|
|||||||
action='store_const', dest='format', help='download all available video formats', const='all')
|
action='store_const', dest='format', help='download all available video formats', const='all')
|
||||||
video_format.add_option('--max-quality',
|
video_format.add_option('--max-quality',
|
||||||
action='store', dest='format_limit', metavar='FORMAT', help='highest quality format to download')
|
action='store', dest='format_limit', metavar='FORMAT', help='highest quality format to download')
|
||||||
|
video_format.add_option('-F', '--list-formats',
|
||||||
|
action='store_true', dest='listformats', help='list all available formats (currently youtube only)')
|
||||||
|
|
||||||
|
|
||||||
verbosity.add_option('-q', '--quiet',
|
verbosity.add_option('-q', '--quiet',
|
||||||
@@ -3784,6 +3809,7 @@ def main():
|
|||||||
'skip_download': (opts.skip_download or opts.simulate or opts.geturl or opts.gettitle or opts.getthumbnail or opts.getdescription or opts.getfilename or opts.getformat),
|
'skip_download': (opts.skip_download or opts.simulate or opts.geturl or opts.gettitle or opts.getthumbnail or opts.getdescription or opts.getfilename or opts.getformat),
|
||||||
'format': opts.format,
|
'format': opts.format,
|
||||||
'format_limit': opts.format_limit,
|
'format_limit': opts.format_limit,
|
||||||
|
'listformats': opts.listformats,
|
||||||
'outtmpl': ((opts.outtmpl is not None and opts.outtmpl.decode(preferredencoding()))
|
'outtmpl': ((opts.outtmpl is not None and opts.outtmpl.decode(preferredencoding()))
|
||||||
or (opts.format == '-1' and opts.usetitle and u'%(stitle)s-%(id)s-%(format)s.%(ext)s')
|
or (opts.format == '-1' and opts.usetitle and u'%(stitle)s-%(id)s-%(format)s.%(ext)s')
|
||||||
or (opts.format == '-1' and opts.useliteral and u'%(title)s-%(id)s-%(format)s.%(ext)s')
|
or (opts.format == '-1' and opts.useliteral and u'%(title)s-%(id)s-%(format)s.%(ext)s')
|
||||||
|
Reference in New Issue
Block a user