from lxml import etree from app.modules.subtitle import SubtitleModule def test_parse_subtitle_links_filters_detail_page_action_links(): html_text = """ 字幕
简体中文 [雪飘+白恋] 光之美少女 All Stars NewStage:未来的朋友
上传字幕
搜索射手网
搜索Opensubtitles
""" html = etree.HTML(html_text) links = SubtitleModule._parse_subtitle_links( html, "https://audiences.me/details.php?id=599860&hit=1" ) assert links == [ "https://audiences.me/downloadsubs.php?torrentid=621182&subid=2148" ]