def items(self):
"""
Request URL and parse response. Yield a ``Torrent`` for every torrent
on page. If in multipage mode, Torrents from next pages are
automatically chained.
"""
if self._multipage:
while True:
# Pool for more torrents
items = super(Paginated, self).items()
# Stop if no more torrents
first = next(items, None)
if first is None:
raise StopIteration()
# Yield them if not
else:
yield first
for item in items:
yield item
# Go to the next page
self.next()
else:
for item in super(Paginated, self).items():
yield item
评论列表
文章目录