Compare commits
12 Commits
2011.09.17
...
2011.09.18
Author | SHA1 | Date | |
---|---|---|---|
daa982bc01 | |||
767414a292 | |||
7b417b388a | |||
44424ceee9 | |||
08a5b7f800 | |||
1cde6f1d52 | |||
2d8acd8039 | |||
67035ede49 | |||
eb6c37da43 | |||
2736595628 | |||
7b1a2bbe17 | |||
c25303c3d5 |
@ -1 +1 @@
|
|||||||
2011.09.17
|
2011.09.18c
|
||||||
|
29
youtube-dl
29
youtube-dl
@ -15,7 +15,7 @@ __author__ = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
__license__ = 'Public Domain'
|
__license__ = 'Public Domain'
|
||||||
__version__ = '2011.09.17'
|
__version__ = '2011.09.18c'
|
||||||
|
|
||||||
UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
|
UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
|
||||||
|
|
||||||
@ -982,9 +982,12 @@ class FileDownloader(object):
|
|||||||
block_size = self.best_block_size(after - before, len(data_block))
|
block_size = self.best_block_size(after - before, len(data_block))
|
||||||
|
|
||||||
# Progress message
|
# Progress message
|
||||||
|
speed_str = self.calc_speed(start, time.time(), byte_counter - resume_len)
|
||||||
|
if data_len is None:
|
||||||
|
self.report_progress('Unknown %', data_len_str, speed_str, 'Unknown ETA')
|
||||||
|
else:
|
||||||
percent_str = self.calc_percent(byte_counter, data_len)
|
percent_str = self.calc_percent(byte_counter, data_len)
|
||||||
eta_str = self.calc_eta(start, time.time(), data_len - resume_len, byte_counter - resume_len)
|
eta_str = self.calc_eta(start, time.time(), data_len - resume_len, byte_counter - resume_len)
|
||||||
speed_str = self.calc_speed(start, time.time(), byte_counter - resume_len)
|
|
||||||
self.report_progress(percent_str, data_len_str, speed_str, eta_str)
|
self.report_progress(percent_str, data_len_str, speed_str, eta_str)
|
||||||
|
|
||||||
# Apply rate limit
|
# Apply rate limit
|
||||||
@ -1079,13 +1082,13 @@ class InfoExtractor(object):
|
|||||||
class YoutubeIE(InfoExtractor):
|
class YoutubeIE(InfoExtractor):
|
||||||
"""Information extractor for youtube.com."""
|
"""Information extractor for youtube.com."""
|
||||||
|
|
||||||
_VALID_URL = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/)(?:(?:(?:v|embed|e)/)|(?:(?:watch(?:_popup)?(?:\.php)?)?(?:\?|#!?)(?:.+&)?v=))?)?([0-9A-Za-z_-]+)(?(1).+)?$'
|
_VALID_URL = r'^((?:https?://)?(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/)(?!view_play_list|my_playlists|artist|playlist)(?:(?:(?:v|embed|e)/)|(?:(?: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 = 'https://www.youtube.com/signup?next=/&gl=US&hl=en'
|
_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'
|
_AGE_URL = 'http://www.youtube.com/verify_age?next_url=/&gl=US&hl=en'
|
||||||
_NETRC_MACHINE = 'youtube'
|
_NETRC_MACHINE = 'youtube'
|
||||||
# Listed in order of quality
|
# Listed in order of quality
|
||||||
_available_formats = ['38', '37', '45', '22', '43', '35', '34', '18', '6', '5', '17', '13']
|
_available_formats = ['38', '37', '22', '45', '35', '44', '34', '18', '43', '6', '5', '17', '13']
|
||||||
_video_extensions = {
|
_video_extensions = {
|
||||||
'13': '3gp',
|
'13': '3gp',
|
||||||
'17': 'mp4',
|
'17': 'mp4',
|
||||||
@ -1094,6 +1097,7 @@ class YoutubeIE(InfoExtractor):
|
|||||||
'37': 'mp4',
|
'37': 'mp4',
|
||||||
'38': 'video', # You actually don't know if this will be MOV, AVI or whatever
|
'38': 'video', # You actually don't know if this will be MOV, AVI or whatever
|
||||||
'43': 'webm',
|
'43': 'webm',
|
||||||
|
'44': 'webm',
|
||||||
'45': 'webm',
|
'45': 'webm',
|
||||||
}
|
}
|
||||||
IE_NAME = u'youtube'
|
IE_NAME = u'youtube'
|
||||||
@ -3172,7 +3176,7 @@ class ComedyCentralIE(InfoExtractor):
|
|||||||
class EscapistIE(InfoExtractor):
|
class EscapistIE(InfoExtractor):
|
||||||
"""Information extractor for The Escapist """
|
"""Information extractor for The Escapist """
|
||||||
|
|
||||||
_VALID_URL = r'^(https?://)?(www\.)escapistmagazine.com/videos/view/(?P<showname>[^/]+)/(?P<episode>[^/?]+)[/?].*$'
|
_VALID_URL = r'^(https?://)?(www\.)?escapistmagazine.com/videos/view/(?P<showname>[^/]+)/(?P<episode>[^/?]+)[/?]?.*$'
|
||||||
IE_NAME = u'escapist'
|
IE_NAME = u'escapist'
|
||||||
|
|
||||||
def report_extraction(self, showName):
|
def report_extraction(self, showName):
|
||||||
@ -3409,6 +3413,11 @@ def updateSelf(downloader, filename):
|
|||||||
try:
|
try:
|
||||||
urlh = urllib.urlopen(UPDATE_URL)
|
urlh = urllib.urlopen(UPDATE_URL)
|
||||||
newcontent = urlh.read()
|
newcontent = urlh.read()
|
||||||
|
|
||||||
|
vmatch = re.search("__version__ = '([^']+)'", newcontent)
|
||||||
|
if vmatch is not None and vmatch.group(1) == __version__:
|
||||||
|
downloader.to_screen('youtube-dl is up-to-date (' + __version__ + ')')
|
||||||
|
return
|
||||||
finally:
|
finally:
|
||||||
urlh.close()
|
urlh.close()
|
||||||
except (IOError, OSError), err:
|
except (IOError, OSError), err:
|
||||||
@ -3423,7 +3432,7 @@ def updateSelf(downloader, filename):
|
|||||||
except (IOError, OSError), err:
|
except (IOError, OSError), err:
|
||||||
sys.exit('ERROR: unable to overwrite current version')
|
sys.exit('ERROR: unable to overwrite current version')
|
||||||
|
|
||||||
downloader.to_screen('Updated youtube-dl. Restart to use the new version.')
|
downloader.to_screen('Updated youtube-dl. Restart youtube-dl to use the new version.')
|
||||||
|
|
||||||
def parseOpts():
|
def parseOpts():
|
||||||
# Deferred imports
|
# Deferred imports
|
||||||
@ -3569,7 +3578,7 @@ def parseOpts():
|
|||||||
filesystem.add_option('-w', '--no-overwrites',
|
filesystem.add_option('-w', '--no-overwrites',
|
||||||
action='store_true', dest='nooverwrites', help='do not overwrite files', default=False)
|
action='store_true', dest='nooverwrites', help='do not overwrite files', default=False)
|
||||||
filesystem.add_option('-c', '--continue',
|
filesystem.add_option('-c', '--continue',
|
||||||
action='store_true', dest='continue_dl', help='resume partially downloaded files', default=True)
|
action='store_true', dest='continue_dl', help='resume partially downloaded files', default=False)
|
||||||
filesystem.add_option('--no-continue',
|
filesystem.add_option('--no-continue',
|
||||||
action='store_false', dest='continue_dl',
|
action='store_false', dest='continue_dl',
|
||||||
help='do not resume partially downloaded files (restart from beginning)')
|
help='do not resume partially downloaded files (restart from beginning)')
|
||||||
@ -3618,12 +3627,12 @@ def gen_extractors():
|
|||||||
google_ie = GoogleIE()
|
google_ie = GoogleIE()
|
||||||
yahoo_ie = YahooIE()
|
yahoo_ie = YahooIE()
|
||||||
return [
|
return [
|
||||||
youtube_ie,
|
|
||||||
MetacafeIE(youtube_ie),
|
|
||||||
DailymotionIE(),
|
|
||||||
YoutubePlaylistIE(youtube_ie),
|
YoutubePlaylistIE(youtube_ie),
|
||||||
YoutubeUserIE(youtube_ie),
|
YoutubeUserIE(youtube_ie),
|
||||||
YoutubeSearchIE(youtube_ie),
|
YoutubeSearchIE(youtube_ie),
|
||||||
|
youtube_ie,
|
||||||
|
MetacafeIE(youtube_ie),
|
||||||
|
DailymotionIE(),
|
||||||
google_ie,
|
google_ie,
|
||||||
GoogleSearchIE(google_ie),
|
GoogleSearchIE(google_ie),
|
||||||
PhotobucketIE(),
|
PhotobucketIE(),
|
||||||
|
Reference in New Issue
Block a user