format change according by flake8

This commit is contained in:
scil 2017-11-06 23:56:21 +08:00
parent a30b01348f
commit 513ec05236

View File

@ -11,9 +11,11 @@ from ..compat import (
from .common import InfoExtractor from .common import InfoExtractor
class XimalayaBaseIE(InfoExtractor): class XimalayaBaseIE(InfoExtractor):
_GEO_COUNTRIES = ['CN'] _GEO_COUNTRIES = ['CN']
class XimalayaIE(XimalayaBaseIE): class XimalayaIE(XimalayaBaseIE):
IE_NAME = 'ximalaya' IE_NAME = 'ximalaya'
IE_DESC = 'ximalaya.com' IE_DESC = 'ximalaya.com'
@ -53,7 +55,7 @@ class XimalayaIE(XimalayaBaseIE):
audio_id = self._match_id(url) audio_id = self._match_id(url)
webpage = self._download_webpage(url, audio_id, webpage = self._download_webpage(url, audio_id,
note='Download sound page for %s'% audio_id , note='Download sound page for %s' % audio_id,
errnote='Unable to get sound page') errnote='Unable to get sound page')
audio_info_file = 'http://m.ximalaya.com/tracks/%s.json' % audio_id audio_info_file = 'http://m.ximalaya.com/tracks/%s.json' % audio_id
@ -76,11 +78,9 @@ class XimalayaIE(XimalayaBaseIE):
audio_uploader_id = audio_info.get('uid') audio_uploader_id = audio_info.get('uid')
if is_m: if is_m:
intro = re.search(r'(?s)<section class=["\']content[^>]+>(.+)</section>' intro = re.search(r'(?s)<section class=["\']content[^>]+>(.+)</section>', webpage)
, webpage)
else: else:
intro = re.search(r'(?s)<div class="rich_intro"[^>]*>(.+?</article>)', intro = re.search(r'(?s)<div class="rich_intro"[^>]*>(.+?</article>)', webpage)
webpage)
if intro: if intro:
audio_description = intro.group(1).strip() audio_description = intro.group(1).strip()
@ -155,8 +155,8 @@ class XimalayaAlbumIE(XimalayaBaseIE):
if not mobj: if not mobj:
break break
next_url = self._BASE_URL_TEMPL % mobj['more'] next_url = self._BASE_URL_TEMPL % mobj.group('more')
self.report_download_webpage(next_url) self.report_download_webpage('%d %s' % (page_num, next_url))
html = self._download_webpage(next_url, playlist_id) html = self._download_webpage(next_url, playlist_id)
if not html.strip(): if not html.strip():
# Some webpages show a "Load more" button but they don't # Some webpages show a "Load more" button but they don't