diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-07-20 03:25:14 +0200 |
commit | 05d258d98dd8c2faf0b769840fa1e3c4acccdce8 (patch) | |
tree | 20d379639d14a2b69deaa9e0376e33312b5bb994 /module/plugins/hoster/SoundcloudCom.py | |
parent | [ShareRapidCom] Fix https://github.com/pyload/pyload/issues/694 (diff) | |
download | pyload-05d258d98dd8c2faf0b769840fa1e3c4acccdce8.tar.xz |
Fix and improve 5060e4c6374a5116d0d8b02528f910f8c5f8bcf9
Diffstat (limited to 'module/plugins/hoster/SoundcloudCom.py')
-rw-r--r-- | module/plugins/hoster/SoundcloudCom.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/module/plugins/hoster/SoundcloudCom.py b/module/plugins/hoster/SoundcloudCom.py index a1ec1378a..f4a81059b 100644 --- a/module/plugins/hoster/SoundcloudCom.py +++ b/module/plugins/hoster/SoundcloudCom.py @@ -19,24 +19,24 @@ class SoundcloudCom(Hoster): # default UserAgent of HTTPRequest fails for this hoster so we use this one self.req.http.c.setopt(pycurl.USERAGENT, 'Mozilla/5.0') page = self.load(pyfile.url) - match = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>[0-9]*)"', page) + found = re.search(r'<div class="haudio.*?large.*?" data-sc-track="(?P<ID>[0-9]*)"', page) songId = clientId = "" - if match: - songId = match.group("ID") + if found: + songId = found.group("ID") if len(songId) <= 0: self.logError("Could not find song id") self.offline() else: - match = re.search(r'"clientID":"(?P<CID>.*?)"', page) - if match: - clientId = match.group("CID") + found = re.search(r'"clientID":"(?P<CID>.*?)"', page) + if found: + clientId = found.group("CID") if len(clientId) <= 0: clientId = "b45b1aa10f1ac2941910a7f0d10f8e28" - match = re.search(r'<em itemprop="name">\s(?P<TITLE>.*?)\s</em>', page) - if match: - pyfile.name = match.group("TITLE") + ".mp3" + found = re.search(r'<em itemprop="name">\s(?P<TITLE>.*?)\s</em>', page) + if found: + pyfile.name = found.group("TITLE") + ".mp3" else: pyfile.name = re.match(self.__pattern__, pyfile.url).group("SID") + ".mp3" |