def ccurl_setcookie(url):
hdr = "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0"
c = pycurl.Curl()
c.setopt(c.FOLLOWLOCATION, True)
c.setopt(c.USERAGENT, hdr)
c.setopt(c.COOKIEJAR, '/tmp/AnimeWatch/cookie.txt')
url = str(url)
c.setopt(c.URL, url)
storage = BytesIO()
c.setopt(c.WRITEDATA, storage)
c.perform()
c.close()
content = storage.getvalue()
content = getContentUnicode(content)
return (content)
评论列表
文章目录