def test_download_episode_subtitle(episodes): languages = [Language('zho', None, 'Hant'), Language('zho', None, 'Hans')] video = episodes['bbt_s07e05'] with AssrtProvider(TOKEN) as provider: subtitles = provider.list_subtitles(video, languages) provider.download_subtitle(subtitles[0]) assert subtitles[0].content is not None assert subtitles[0].language == Language('zho', None, 'Hans')
def test_download_subtitle_zh(movies): languages = [Language('zho')] video = movies['man_of_steel'] with AssrtProvider(TOKEN) as provider: subtitles = provider.list_subtitles(video, languages) provider.download_subtitle(subtitles[0]) assert subtitles[0].content is not None assert subtitles[0].language == Language('zho')
def test_query_movie_zh_Hans(movies): languages = [Language('zho', None, 'Hant')] video = movies['man_of_steel'] with AssrtProvider(TOKEN) as provider: subtitles = provider.query(languages, video) assert len(subtitles) == 8
def test_query_list_subtitles(movies): languages = [Language('zho', None, 'Hant'), Language('zho', None, 'Hans')] video = movies['man_of_steel'] with AssrtProvider(TOKEN) as provider: subtitles = provider.list_subtitles(video, languages) assert len(subtitles) == 16
def test_query_episode(episodes): video = episodes['bbt_s07e05'] languages = [Language('zho', None, 'Hant'), Language('zho', None, 'Hans')] with AssrtProvider(TOKEN) as provider: subtitles = provider.query(languages, video) assert len(subtitles) == 11