diff options
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index ed5ee222f..8fa4cb67f 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1172,6 +1172,10 @@ class PagedList(object): self._pagefunc = pagefunc self._pagesize = pagesize + def __len__(self): + # This is only useful for tests + return len(self.getslice()) + def getslice(self, start=0, end=None): res = [] for pagenum in itertools.count(start // self._pagesize): |