mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[qqmusic] Eliminate _filter_lrc and use single quotes
This commit is contained in:
		@@ -58,11 +58,6 @@ class QQMusicIE(InfoExtractor):
 | 
				
			|||||||
        curMs = int(time.time() * 1000) % 1000
 | 
					        curMs = int(time.time() * 1000) % 1000
 | 
				
			||||||
        return int(round(random.random() * 2147483647) * curMs % 1E10)
 | 
					        return int(round(random.random() * 2147483647) * curMs % 1E10)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _filter_lrc(self, data):
 | 
					 | 
				
			||||||
        lyrics_expr = r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\][^\n]*|\[[^\]]*\])'
 | 
					 | 
				
			||||||
        texts = re.findall(lyrics_expr, data)
 | 
					 | 
				
			||||||
        return ''.join(i + "\n" for i in texts)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def _real_extract(self, url):
 | 
					    def _real_extract(self, url):
 | 
				
			||||||
        mid = self._match_id(url)
 | 
					        mid = self._match_id(url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -117,7 +112,9 @@ class QQMusicIE(InfoExtractor):
 | 
				
			|||||||
        self._check_formats(formats, mid)
 | 
					        self._check_formats(formats, mid)
 | 
				
			||||||
        self._sort_formats(formats)
 | 
					        self._sort_formats(formats)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        actual_lrc_lyrics = self._filter_lrc(lrc_content)
 | 
					        actual_lrc_lyrics = ''.join(
 | 
				
			||||||
 | 
					            line + '\n' for line in re.findall(
 | 
				
			||||||
 | 
					                r'(\[[0-9]{2}:[0-9]{2}\.[0-9]{2,}\][^\n]*|\[[^\]]*\])', lrc_content))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        info_dict = {
 | 
					        info_dict = {
 | 
				
			||||||
            'id': mid,
 | 
					            'id': mid,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user