youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 961c5cbf172da49b26c09f806b0871719578e0e5
parent b65e5bb72f48c57316ac0166141810bd1e7b2de8
Author: Sergey M․ <dstftw@gmail.com>
Date:   Sat, 26 Sep 2015 20:38:11 +0600

[qqmusic] Eliminate _filter_lrc and use single quotes

Diffstat:
Myoutube_dl/extractor/qqmusic.py | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/youtube_dl/extractor/qqmusic.py b/youtube_dl/extractor/qqmusic.py @@ -58,11 +58,6 @@ class QQMusicIE(InfoExtractor): curMs = int(time.time() * 1000) % 1000 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): mid = self._match_id(url) @@ -117,7 +112,9 @@ class QQMusicIE(InfoExtractor): self._check_formats(formats, mid) 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 = { 'id': mid,