From 7bef3c1c7840a5f38a5452294a64361dcb80d049 Mon Sep 17 00:00:00 2001 From: huangtiande Date: Mon, 11 Jan 2016 17:24:48 +0800 Subject: [PATCH] add comment and correct string interpolation operator --- youtube_dl/extractor/qqvideo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/qqvideo.py b/youtube_dl/extractor/qqvideo.py index 76eeeb519..ae3d0a6cc 100644 --- a/youtube_dl/extractor/qqvideo.py +++ b/youtube_dl/extractor/qqvideo.py @@ -7,6 +7,7 @@ from .common import InfoExtractor class QqVideoIE(InfoExtractor): + """ qq viedo extractor """ IE_NAME = 'qq' IE_DESC = '腾讯' # http://v.qq.com/page/9/n/6/9jWRYWGYvn6.html @@ -31,19 +32,20 @@ class QqVideoIE(InfoExtractor): ] def _real_extract(self, url): + """ extract qq video url """ mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') if (video_id is None): video_id = mobj.group('vid') info_doc = self._download_xml( - 'http://vv.video.qq.com/getinfo?vid=%s&otype=xml&platform=1' % video_id, + 'http://vv.video.qq.com/getinfo?vid={0}&otype=xml&platform=1'.format(video_id), video_id, 'fetch video metadata') title = info_doc.find('./vl/vi/ti').text url_doc = self._download_xml( - 'http://vv.video.qq.com/geturl?vid=%s&otype=xml&platform=1' % video_id, + 'http://vv.video.qq.com/geturl?vid={0}&otype=xml&platform=1'.format(video_id), video_id, 'fetch video url') url = url_doc.find('./vd/vi/url').text