mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 03:23:02 +00:00
parent
c5e3f84972
commit
c07a39ae8e
2 changed files with 6 additions and 2 deletions
|
@ -1328,7 +1328,7 @@ def wrapper(self, *args, **kwargs):
|
||||||
self.to_stderr('\r')
|
self.to_stderr('\r')
|
||||||
self.report_warning(f'{e}; Re-extracting data')
|
self.report_warning(f'{e}; Re-extracting data')
|
||||||
return wrapper(self, *args, **kwargs)
|
return wrapper(self, *args, **kwargs)
|
||||||
except (DownloadCancelled, LazyList.IndexError):
|
except (DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
|
||||||
raise
|
raise
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if self.params.get('ignoreerrors'):
|
if self.params.get('ignoreerrors'):
|
||||||
|
|
|
@ -4168,6 +4168,10 @@ def __str__(self):
|
||||||
|
|
||||||
|
|
||||||
class PagedList:
|
class PagedList:
|
||||||
|
|
||||||
|
class IndexError(IndexError):
|
||||||
|
pass
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
# This is only useful for tests
|
# This is only useful for tests
|
||||||
return len(self.getslice())
|
return len(self.getslice())
|
||||||
|
@ -4198,7 +4202,7 @@ def __getitem__(self, idx):
|
||||||
raise TypeError('indices must be non-negative integers')
|
raise TypeError('indices must be non-negative integers')
|
||||||
entries = self.getslice(idx, idx + 1)
|
entries = self.getslice(idx, idx + 1)
|
||||||
if not entries:
|
if not entries:
|
||||||
raise IndexError()
|
raise self.IndexError()
|
||||||
return entries[0]
|
return entries[0]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue