How to use the ykdl.common.alias.keys 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 / embedextractor.py View on Github external
def _parser(self, video_info):
        if 'info' in video_info:
            return video_info['info']

        elif 'site' in video_info:
            site = video_info['site']
            vid = video_info['vid']
            if site in alias.keys():
                site = alias[site]
            s = import_module('.'.join(['ykdl','extractors',site])).site
            info = s.parser(vid)
 
        elif 'url' in video_info:
            url = video_info['url']
            s, u = url_to_module(url)
            info = s.parser(u)

        if 'title' in video_info:
            info.title = video_info['title']
        if 'artist' in video_info:
            info.artist = video_info['artist']
        if 'extra' in video_info and video_info['extra']:
            info.extra.update(video_info['extra'])