1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-20 17:52:51 +08:00

[crunchyroll] Improve subtitle regex (Closes #7262)

This commit is contained in:
Sergey M․ 2015-10-22 20:34:11 +06:00
parent a65402ef42
commit 7690787553

View File

@ -245,7 +245,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
def _get_subtitles(self, video_id, webpage):
subtitles = {}
for sub_id, sub_name in re.findall(r'\?ssid=([0-9]+)" title="([^"]+)', webpage):
for sub_id, sub_name in re.findall(r'\bssid=([0-9]+)"[^>]+?\btitle="([^"]+)', webpage):
sub_page = self._download_webpage(
'http://www.crunchyroll.com/xml/?req=RpcApiSubtitle_GetXml&subtitle_script_id=' + sub_id,
video_id, note='Downloading subtitles for ' + sub_name)