Fixed private videos breaking the script
This commit is contained in:
parent
3c522c6459
commit
668e497ae0
@ -22,6 +22,10 @@ class YouTubeAPI(object):
|
||||
def getVideoInfo(self, id):
|
||||
snippet = self.getVideo('snippet', id)
|
||||
status = self.getVideo('status', id)
|
||||
|
||||
# Check for private videos
|
||||
if len(snippet['items']) == 0:
|
||||
return '', '', '', '', '', '', 'private', id
|
||||
snippet = snippet['items'][0]['snippet']
|
||||
status = status['items'][0]['status']
|
||||
title = snippet['title']
|
||||
|
@ -66,6 +66,7 @@ filteredVideos = [video for video in videoInfo if getPrivacy(video) == 'unlisted
|
||||
ydl_opts = {
|
||||
'outtmpl': '{}/%(uploader)s-%(title)s-%(id)s.%(ext)s'.format(playlistDir)
|
||||
}
|
||||
|
||||
for v in filteredVideos:
|
||||
|
||||
# Save metadata to file
|
||||
|
Loading…
x
Reference in New Issue
Block a user