mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 05:25:02 +03:00
youtube --first AND --last
This commit is contained in:
parent
1c841f7e8c
commit
7900239662
@ -171,7 +171,14 @@ class YouTube(VideoExtractor):
|
||||
|
||||
self.title = re.search(r'<meta name="title" content="([^"]+)"', video_page).group(1)
|
||||
self.p_playlist()
|
||||
firstIndex= kwargs['args'].first
|
||||
lastIndex = kwargs['args'].last
|
||||
for index, video in enumerate(videos, 1):
|
||||
if firstIndex and index < int(firstIndex):
|
||||
index = int(firstIndex)
|
||||
video = videos[index-1]
|
||||
if lastIndex and index > int(lastIndex):
|
||||
break
|
||||
vid = video['playlistVideoRenderer']['videoId']
|
||||
try:
|
||||
self.__class__().download_by_url(self.__class__.get_url_from_vid(vid), index=index, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user