tpb.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:autotorrent 作者: anthonyheddings 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号