stream_search_methods.py 文件源码

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

项目:tsubasa-reddit-bot 作者: ArmandSyah 项目源码 文件源码
def search_animelab(anime):
    """Checks if anime title exists on AnimeLab website and returns a link"""
    try:
        exclude = set(string.punctuation)
        anime = ''.join(ch for ch in anime if ch not in exclude)
        keywords = anime.split(' ')
        animelab_url = None
        while len(keywords) > 0:
            show_slug = '-'.join(keywords).lower()
            animelab_url = f'https://www.animelab.com/shows/{show_slug}'
            animelab_url = utilities.make_get_request(animelab_url)
            if animelab_url is None:
                keywords.pop()
                return
            else:
                break
    except:
        print('Animelab url couldn\'t be retrieved')
        return
    return animelab_url.url
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号