SubbedAnime.py 文件源码

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

项目:AnimeWatch 作者: kanishka-linux 项目源码 文件源码
def ccurlPost(url,value):
    hdr = "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:45.0) Gecko/20100101 Firefox/45.0"

    c = pycurl.Curl()
    if value == "no_redir":
        print("no redirect")
    else:
        c.setopt(c.FOLLOWLOCATION, True)
    c.setopt(c.USERAGENT, hdr)
    if value != "" and value != "no_redir":
        post_data = {'id': value}
        post_d = urllib.parse.urlencode(post_data)
        c.setopt(c.POSTFIELDS,post_d)
    #if rfr != "":
     # c.setopt(pycurl.REFERER, rfr)
    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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号