projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[sockshare] Fix title extraction (Fixes #3592)
[youtube-dl]
/
youtube_dl
/
extractor
/
crunchyroll.py
diff --git
a/youtube_dl/extractor/crunchyroll.py
b/youtube_dl/extractor/crunchyroll.py
index 5587ade1256fd090f046c1a6deed4ece8b47b6d9..026a9177e754de7d606961e6e4793af86da49fe2 100644
(file)
--- a/
youtube_dl/extractor/crunchyroll.py
+++ b/
youtube_dl/extractor/crunchyroll.py
@@
-86,9
+86,8
@@
class CrunchyrollIE(InfoExtractor):
return zlib.decompress(decrypted_data)
def _convert_subtitles_to_srt(self, subtitles):
return zlib.decompress(decrypted_data)
def _convert_subtitles_to_srt(self, subtitles):
- i = 1
output = ''
output = ''
- for
start, end, text in re.findall(r'<event [^>]*?start="([^"]+)" [^>]*?end="([^"]+)" [^>]*?text="([^"]+)"[^>]*?>', subtitles
):
+ for
i, (start, end, text) in enumerate(re.findall(r'<event [^>]*?start="([^"]+)" [^>]*?end="([^"]+)" [^>]*?text="([^"]+)"[^>]*?>', subtitles), 1
):
start = start.replace('.', ',')
end = end.replace('.', ',')
text = clean_html(text)
start = start.replace('.', ',')
end = end.replace('.', ',')
text = clean_html(text)
@@
-96,7
+95,6
@@
class CrunchyrollIE(InfoExtractor):
if not text:
continue
output += '%d\n%s --> %s\n%s\n\n' % (i, start, end, text)
if not text:
continue
output += '%d\n%s --> %s\n%s\n\n' % (i, start, end, text)
- i += 1
return output
def _real_extract(self,url):
return output
def _real_extract(self,url):
@@
-187,4
+185,4
@@
class CrunchyrollIE(InfoExtractor):
'upload_date': video_upload_date,
'subtitles': subtitles,
'formats': formats,
'upload_date': video_upload_date,
'subtitles': subtitles,
'formats': formats,
- }
\ No newline at end of file
+ }