mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 00:25:15 +00:00 
			
		
		
		
	[crunchyroll] Use enumerate
				
					
				
			This commit is contained in:
		@@ -86,9 +86,8 @@ class CrunchyrollIE(InfoExtractor):
 | 
				
			|||||||
        return zlib.decompress(decrypted_data)
 | 
					        return zlib.decompress(decrypted_data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _convert_subtitles_to_srt(self, subtitles):
 | 
					    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('.', ',')
 | 
					            start = start.replace('.', ',')
 | 
				
			||||||
            end = end.replace('.', ',')
 | 
					            end = end.replace('.', ',')
 | 
				
			||||||
            text = clean_html(text)
 | 
					            text = clean_html(text)
 | 
				
			||||||
@@ -96,7 +95,6 @@ class CrunchyrollIE(InfoExtractor):
 | 
				
			|||||||
            if not text:
 | 
					            if not text:
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
            output += '%d\n%s --> %s\n%s\n\n' % (i, start, end, text)
 | 
					            output += '%d\n%s --> %s\n%s\n\n' % (i, start, end, text)
 | 
				
			||||||
            i += 1
 | 
					 | 
				
			||||||
        return output
 | 
					        return output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _real_extract(self,url):
 | 
					    def _real_extract(self,url):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user