mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[crunchyroll] Improve subtitle regex (Closes #7262)
This commit is contained in:
parent
a65402ef42
commit
7690787553
1 changed files with 1 additions and 1 deletions
|
@ -245,7 +245,7 @@ def _extract_subtitles(self, subtitle):
|
||||||
|
|
||||||
def _get_subtitles(self, video_id, webpage):
|
def _get_subtitles(self, video_id, webpage):
|
||||||
subtitles = {}
|
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(
|
sub_page = self._download_webpage(
|
||||||
'http://www.crunchyroll.com/xml/?req=RpcApiSubtitle_GetXml&subtitle_script_id=' + sub_id,
|
'http://www.crunchyroll.com/xml/?req=RpcApiSubtitle_GetXml&subtitle_script_id=' + sub_id,
|
||||||
video_id, note='Downloading subtitles for ' + sub_name)
|
video_id, note='Downloading subtitles for ' + sub_name)
|
||||||
|
|
Loading…
Reference in a new issue