How to use the ykdl.util.match.matchall function in ykdl

To help you get started, we’ve selected a few ykdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ForgQi / bilibiliupload / ykdl / extractors / bilibili / bangumi.py View on Github external
def prepare_list(self):
        html = get_content(self.url)
        eplist = matchall(html, ['"epList":(\[.*?\])'])
        if eplist:
            eplist = sum(map(matchall, eplist, [['"(?:ep_)?id":(\d+),']] * len(eplist)), [])
            return ['https://www.bilibili.com/bangumi/play/ep{}'.format(eid) for eid in eplist]
github ForgQi / bilibiliupload / ykdl / extractors / acfun / bangumi.py View on Github external
def get_path_list(self):
        html = get_content(self.url)
        videos = matchall(html, ['href=[\'"](/bangumi/aa\d+_\d+_\d+)[\'"] data-title=[\'"]'])
        return videos
github ForgQi / bilibiliupload / ykdl / extractors / bilibili / video.py View on Github external
def prepare_list(self):
        av_id = match1(self.url, '/av(\d+)')
        html = get_content(self.url)
        video_list = matchall(html, ['"page":(\d+),'])
        if video_list:
            return ['https://www.bilibili.com/av{}/?p={}'.format(av_id, p) for p in video_list]
github ForgQi / bilibiliupload / ykdl / extractors / acfun / video.py View on Github external
def get_path_list(self):
        html = get_content(self.url)
        videos = matchall(html, ['href=[\'"](/v/[a-zA-Z0-9_]+)[\'"] title=[\'"]'])
        return videos
github ForgQi / bilibiliupload / ykdl / extractors / mgtv.py View on Github external
def prepare_list(self):

        html = get_content(self.url, headers={})

        return matchall(html, ['"a-pic-play" href="([^"]+)"'])
github ForgQi / bilibiliupload / ykdl / extractors / iqiyi / video.py View on Github external
def prepare_list(self):
        html = get_content(self.url)

        return matchall(html, ['data-tvid=\"([^\"]+)\" data-vid=\"([^\"]+)\"'])
github ForgQi / bilibiliupload / ykdl / extractors / iqiyi / video.py View on Github external
def prepare(self):
        info = VideoInfo(self.name)

        if self.url and not self.vid:
            vid = matchall(self.url, ['curid=([^_]+)_([\w]+)'])
            if vid:
                self.vid = vid[0]
                info_u = 'http://pcw-api.iqiyi.com/video/video/playervideoinfo?tvid=' + self.vid[0]
                try:
                    info_json = json.loads(get_content(info_u))
                    info.title = info_json['data']['vn']
                except:
                    self.vid = None

        def get_vid():
            html = get_content(self.url)
            video_info = match1(html, ":video-info='(.+?)'")

            if video_info:
                video_info = json.loads(video_info)
                self.vid = str(video_info['tvId']), str(video_info['vid'])
github ForgQi / bilibiliupload / ykdl / extractors / bilibili / bangumi.py View on Github external
def prepare_list(self):
        html = get_content(self.url)
        eplist = matchall(html, ['"epList":(\[.*?\])'])
        if eplist:
            eplist = sum(map(matchall, eplist, [['"(?:ep_)?id":(\d+),']] * len(eplist)), [])
            return ['https://www.bilibili.com/bangumi/play/ep{}'.format(eid) for eid in eplist]
github ForgQi / bilibiliupload / ykdl / extractors / douyu / live.py View on Github external
def prepare_list(self):

        html = get_content(self.url)
        return matchall(html, douyu_match_pattern)