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
stream_search_methods.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录