humble_api.py 文件源码

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

项目:hb-downloader 作者: talonius 项目源码 文件源码
def __init__(self, cookie_location="cookie.txt"):
        """
            Base constructor.  Responsible for setting up the requests object and cookie jar.
            All configuration values should be set prior to constructing an object of this
            type; changes to configuration will not take effect on variables which already
            exist.
        """
        self.session = requests.Session()
        self.session.cookies = cookielib.LWPCookieJar(cookie_location)

        try:
            self.session.cookies.load()
        except IOError:
            # Cookie file doesn't exist.
            pass

        self.session.headers.update(self.default_headers)
        self.session.params.update(self.default_params)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号