def search_funimation(anime):
"""Checks if anime exists on Funimation 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(' ')
funi_url = None
while len(keywords) > 0:
show_slug = '-'.join(keywords).lower()
funi_url = f'https://www.funimation.com/shows/{show_slug}/'
funi_url = utilities.make_get_request(funi_url)
if funi_url is None:
keywords.pop()
continue
else:
break
except:
print('Funimation url couldn\'t be retrieved')
return
return funi_url.url if funi_url is not None else None
stream_search_methods.py 文件源码
python
阅读 34
收藏 0
点赞 0
评论 0
评论列表
文章目录