电影天堂-源代码

释放双眼,带上耳机,听听看~!
电影天堂--源码#encoding:utf-8fromlxmlinportetreeimportrequestsBASE_DOMAIN='HEADERS={    'User-Agent':'Mozilla/5.0(WindowsNT10.0;Win64;x64)

目录

    电影天堂-源代码

    #encoding: utf-8

    from lxml inport etree

    import requests

    BASE_DOMAIN = ‘http://dytt8.net’

    HEADERS ={

        ‘User-Agent’ : ‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36’S

    }

    def get_detail_urls(url):

        response = requests.get(url, headers = HEADERS)

        text = requests.text

        html = etree.HTML(text)

        detail_urls = html.xpath(“https://table[@class=’tbspan’]//a/href”)

      detail_urls = map(lambda url:BASE_DOMAIN url,detail_urls)

        return detail_urls

    def parse_detail_page(url):

        movie ={}

        response = requests.get(url, headers = HEADERS)

        text = response.content.decode(‘gbk’)

        html = etree.HTML(text)

        title = html.xpath(“https://font[@color = ‘#07519a’]//font[@color = ‘#07519a’]/text()”)[0]

        movie[‘title’]= title

        

        zoomE = html.xpath(“https://div[@id = ‘Zoom’]”)[0]

        imgs = zoomE.xpath(‘http://mp.weixin.qq.com//img/@src’)

        cover = imgs[0]

        screenshot = imgs[1]

        movie[‘cover’]= cover    movie[‘screenshot’]= screenshot

        

        def parse_info(info, rule):

            return info.replace(rule,””).strip()

        infos = zoomE.xpath(“http://mp.weixin.qq.com//text()”)

        for index,info in enumerate(infos):

            if info.startswith(“◎年 代”):

                info = parse_info(info,”◎年 代”)

                movie[‘year’] = info

            elif info.startswith(“◎产 地”):

          info = parse_info(info,”◎产 地”)

                movie[‘country’] = info

            elif info.startswith(“◎类 别”):

           info = parse_info(info,”◎类 别”)

                movie[‘category’] = info

            elif info.startswith(“◎豆瓣评分”):

           info = parse_info(info,”◎豆瓣评分”)

                movie[‘douban_rating’] = info

            elif info.startswith(“◎片 长”):

           info = parse_info(info,”◎片 长”)

                movie[‘duration’] = info

            elif info.startswith(“◎导 演”):

           info = parse_info(info,”◎导 演”)

                movie[‘direction’] = info

            elif info.startswith(“◎主 演”):

           info = parse_info(info,”◎主 演”)

                actors ={info}

                for x in range(index 1,len(infos)):

                    actor = infox[x].strip()

                    if actor.startswith(“◎”):

                        break

                    actors.append(actor)

      &nbsp

    给TA打赏
    共{{data.count}}人
    人已打赏
    SEO

    比电影天堂还牛逼!这里有你想看的所有视频

    2022-9-16 19:41:47

    SEO

    免费在线观看电影天堂电影资源(高清)

    2022-9-16 19:56:32

    0 条回复 A文章作者 M管理员
      暂无讨论,说说你的看法吧
    个人中心
    购物车
    优惠劵
    今日签到
    有新私信 私信列表
    搜索