mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-07 07:17:21 +08:00
Merged remote branch 'upstream/master'
This commit is contained in:
commit
38b90958e8
38
youtube-dl
Executable file → Normal file
38
youtube-dl
Executable file → Normal file
@ -1967,11 +1967,10 @@ class YoutubePlaylistIE(InfoExtractor):
|
||||
break
|
||||
pagenum = pagenum + 1
|
||||
|
||||
playliststart = self._downloader.params.get('playliststart', 1)
|
||||
playliststart -= 1 #our arrays are zero-based but the playlist is 1-based
|
||||
playlistend = self._downloader.params.get('playlistend', -1) #last item of video_ids is not used
|
||||
video_ids = video_ids[playliststart:playlistend] #always use slice as options have default values
|
||||
|
||||
playliststart = self._downloader.params.get('playliststart', 1) - 1
|
||||
playlistend = self._downloader.params.get('playlistend', -1)
|
||||
video_ids = video_ids[playliststart:playlistend]
|
||||
|
||||
for id in video_ids:
|
||||
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
|
||||
return
|
||||
@ -2027,10 +2026,9 @@ class YoutubeUserIE(InfoExtractor):
|
||||
ids_in_page.append(mobj.group(1))
|
||||
video_ids.extend(ids_in_page)
|
||||
|
||||
playliststart = self._downloader.params.get('playliststart', 1)
|
||||
playliststart -= 1 #our arrays are zero-based but the playlist is 1-based
|
||||
playlistend = self._downloader.params.get('playlistend', -1) #last item of video_ids is not used
|
||||
video_ids = video_ids[playliststart:playlistend] #always use slice as options have default values
|
||||
playliststart = self._downloader.params.get('playliststart', 1) - 1
|
||||
playlistend = self._downloader.params.get('playlistend', -1)
|
||||
video_ids = video_ids[playliststart:playlistend]
|
||||
|
||||
for id in video_ids:
|
||||
self._youtube_ie.extract('http://www.youtube.com/watch?v=%s' % id)
|
||||
@ -2242,16 +2240,18 @@ if __name__ == '__main__':
|
||||
opts.retries = long(opts.retries)
|
||||
except (TypeError, ValueError), err:
|
||||
parser.error(u'invalid retry count specified')
|
||||
if opts.playliststart is not None:
|
||||
try:
|
||||
opts.playliststart = long(opts.playliststart)
|
||||
except (TypeError, ValueError), err:
|
||||
parser.error(u'invalid playlist-start page specified')
|
||||
if opts.playlistend is not None:
|
||||
try:
|
||||
opts.playlistend = long(opts.playlistend)
|
||||
except (TypeError, ValueError), err:
|
||||
parser.error(u'invalid playlist-end page specified')
|
||||
try:
|
||||
opts.playliststart = long(opts.playliststart)
|
||||
if opts.playliststart <= 0:
|
||||
raise ValueError
|
||||
except (TypeError, ValueError), err:
|
||||
parser.error(u'invalid playlist start number specified')
|
||||
try:
|
||||
opts.playlistend = long(opts.playlistend)
|
||||
if opts.playlistend != -1 and (opts.playlistend <= 0 or opts.playlistend < opts.playliststart):
|
||||
raise ValueError
|
||||
except (TypeError, ValueError), err:
|
||||
parser.error(u'invalid playlist end number specified')
|
||||
|
||||
# Information extractors
|
||||
youtube_ie = YoutubeIE()
|
||||
|
Loading…
x
Reference in New Issue
Block a user