def search_crunchyroll(anime):
"""Searches if anime exists on Crunchyroll and returns a link"""
try:
exclude = set(string.punctuation)
anime = ''.join(ch for ch in anime if ch not in exclude)
keywords = anime.split(' ')
crunchy_api = MetaApi()
crunchyroll_listing = []
while len(keywords) > 0:
crunchyroll_listing = list(crunchy_api.search_anime_series(' '.join(keywords)))
if len(crunchyroll_listing) <= 0:
print('No crunchyroll listings found')
keywords.pop()
continue
else:
break
except:
print('Crunchyroll url couldn\'t be retrieved')
return
return crunchyroll_listing[0].url if len(crunchyroll_listing) > 0 else None
stream_search_methods.py 文件源码
python
阅读 36
收藏 0
点赞 0
评论 0
评论列表
文章目录