Skip unavailable videos when downloading from Playlist
This commit is contained in:
parent
7c5e7c5108
commit
78a3f13f92
|
|
@ -111,7 +111,7 @@ class YoutubeDLHelper(DownloadHelper):
|
|||
if 'entries' in result:
|
||||
video = result['entries'][0]
|
||||
for v in result['entries']:
|
||||
if v.get('filesize'):
|
||||
if v and v.get('filesize'):
|
||||
self.size += float(v['filesize'])
|
||||
# For playlists, ydl.prepare-filename returns the following format: <Playlist Name>-<Id of playlist>.NA
|
||||
self.name = name.split(f"-{result['id']}")[0]
|
||||
|
|
@ -139,6 +139,9 @@ class YoutubeDLHelper(DownloadHelper):
|
|||
self.onDownloadError("Download Cancelled by User!")
|
||||
|
||||
def add_download(self, link, path):
|
||||
pattern = '^.*(youtu\.be\/|youtube.com\/)(playlist?)'
|
||||
if re.match(pattern, link):
|
||||
self.opts['ignoreerrors'] = True
|
||||
self.__onDownloadStart()
|
||||
self.extractMetaData(link)
|
||||
LOGGER.info(f"Downloading with YT-DL: {link}")
|
||||
|
|
|
|||
Loading…
Reference in New Issue