Repository: pyload/pyload

Issue:
'NoneType' object has no attribute 'group'
Got this errors on http://filecrypt.cc/ and http://share-links.biz.
The Realdebrid rename error on the rar-file-names i have aswell.

> 1651  14.08.2015 02:03:22 INFO    Debug Report written to debug_FilecryptCc_14-08-2015_02-03-22.zip
> 1650    14.08.2015 02:03:22 ERROR   Decrypting failed: http://filecrypt.cc/Container/2A467695AE.html | 'NoneType' object has no attribute 'group'
> 1649    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL https://www.google.com/recaptcha/api2/anchor | cookies=True | get={'parent': u'http:///filecrypt.cc', 'hl': u'de', 'v': u'r20150804120649', 'rpctoken': 19761449, 'k': u'6LcrmP8SAAAAAKa2tsM9xcOAuKaUKRrkBamt_c6q', 'usegapi': '1', 'jsh': u'm;/_/scs/apps-static/_/js/k=oz.gapi.de.3kbIs0gRBGM.O/m=**features**/am=AQ/rt=j/d=1/t=zcms/rs=AGLTcCOzmPkTppBx3aRymSCOM6cnNBpSGA#id=IO_1439510601875', 'pfname': ''} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1648    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Rpc-token: 19761449
> 1647    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Time: 1439510601875
> 1646    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://www.google.com/recaptcha/api2/demo | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1645    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API jsh-string: m;/_/scs/apps-static/_/js/k=oz.gapi.de.3kbIs0gRBGM.O/m=**features**/am=AQ/rt=j/d=1/t=zcms/rs=AGLTcCOzmPkTppBx3aRymSCOM6cnNBpSGA
> 1644    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL https://apis.google.com/js/api.js | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1643    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API language: de
> 1642    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API version: r20150804120649
> 1641    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://www.google.com/recaptcha/api.js | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1640    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Key: 6LcrmP8SAAAAAKa2tsM9xcOAuKaUKRrkBamt_c6q
> 1639    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://filecrypt.cc/Container/2A467695AE.html | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1638    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: PROCESS URL http://filecrypt.cc/Container/2A467695AE.html | PLUGIN VERSION 0.18
> 1637    14.08.2015 02:03:21 DEBUG   HOOK UserAgentSwitcher: Use custom user-agent string: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
> 1636    14.08.2015 02:03:21 INFO    Decrypting starts: http://filecrypt.cc/Container/2A467695AE.html

'NoneType' object has no attribute 'group'
Got this errors on http://filecrypt.cc/ and http://share-links.biz.
The Realdebrid rename error on the rar-file-names i have aswell.

> 1651  14.08.2015 02:03:22 INFO    Debug Report written to debug_FilecryptCc_14-08-2015_02-03-22.zip
> 1650    14.08.2015 02:03:22 ERROR   Decrypting failed: http://filecrypt.cc/Container/2A467695AE.html | 'NoneType' object has no attribute 'group'
> 1649    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL https://www.google.com/recaptcha/api2/anchor | cookies=True | get={'parent': u'http:///filecrypt.cc', 'hl': u'de', 'v': u'r20150804120649', 'rpctoken': 19761449, 'k': u'6LcrmP8SAAAAAKa2tsM9xcOAuKaUKRrkBamt_c6q', 'usegapi': '1', 'jsh': u'm;/_/scs/apps-static/_/js/k=oz.gapi.de.3kbIs0gRBGM.O/m=**features**/am=AQ/rt=j/d=1/t=zcms/rs=AGLTcCOzmPkTppBx3aRymSCOM6cnNBpSGA#id=IO_1439510601875', 'pfname': ''} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1648    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Rpc-token: 19761449
> 1647    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Time: 1439510601875
> 1646    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://www.google.com/recaptcha/api2/demo | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1645    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API jsh-string: m;/_/scs/apps-static/_/js/k=oz.gapi.de.3kbIs0gRBGM.O/m=**features**/am=AQ/rt=j/d=1/t=zcms/rs=AGLTcCOzmPkTppBx3aRymSCOM6cnNBpSGA
> 1644    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL https://apis.google.com/js/api.js | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1643    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API language: de
> 1642    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | API version: r20150804120649
> 1641    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://www.google.com/recaptcha/api.js | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1640    14.08.2015 02:03:21 DEBUG   CAPTCHA FilecryptCc[1586]: ReCaptcha | Key: 6LcrmP8SAAAAAKa2tsM9xcOAuKaUKRrkBamt_c6q
> 1639    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: LOAD URL http://filecrypt.cc/Container/2A467695AE.html | cookies=True | get={} | req=None | decode=True | multipart=False | post={} | ref=True | just_header=False
> 1638    14.08.2015 02:03:21 DEBUG   CRYPTER FilecryptCc[1586]: PROCESS URL http://filecrypt.cc/Container/2A467695AE.html | PLUGIN VERSION 0.18
> 1637    14.08.2015 02:03:21 DEBUG   HOOK UserAgentSwitcher: Use custom user-agent string: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
> 1636    14.08.2015 02:03:21 INFO    Decrypting starts: http://filecrypt.cc/Container/2A467695AE.html



Discussion:

Resolving patch:
diff --git a/module/plugins/crypter/FilecryptCc.py b/module/plugins/crypter/FilecryptCc.py
--- a/module/plugins/crypter/FilecryptCc.py
+++ b/module/plugins/crypter/FilecryptCc.py
@@ -16,7 +16,7 @@
 class FilecryptCc(Crypter):
     __name__    = "FilecryptCc"
     __type__    = "crypter"
-    __version__ = "0.18"
+    __version__ = "0.19"
     __status__  = "testing"
 
     __pattern__ = r'https?://(?:www\.)?filecrypt\.cc/Container/\w+'
@@ -140,8 +140,9 @@ def handle_weblinks(self):
             for link in weblinks:
                 res   = self.load("%s/Link/%s.html" % (self.base_url, link))
                 link2 = re.search('<iframe noresize src="(.*)"></iframe>', res)
-                res2  = self.load(link2.group(1), just_header=True)
-                self.links.append(res2['location'])
+                if link2:
+                    res2  = self.load(link2.group(1), just_header=True)
+                    self.links.append(res2['location'])
 
         except Exception, e:
             self.log_debug("Error decrypting weblinks: %s" % e)
diff --git a/module/plugins/crypter/ShareLinksBiz.py b/module/plugins/crypter/ShareLinksBiz.py
--- a/module/plugins/crypter/ShareLinksBiz.py
+++ b/module/plugins/crypter/ShareLinksBiz.py
@@ -10,7 +10,7 @@
 class ShareLinksBiz(Crypter):
     __name__    = "ShareLinksBiz"
     __type__    = "crypter"
-    __version__ = "1.16"
+    __version__ = "1.17"
     __status__  = "testing"
 
     __pattern__ = r'http://(?:www\.)?(share-links|s2l)\.biz/(?P<ID>_?\w+)'
@@ -68,8 +68,12 @@ def init_file(self, pyfile):
         url = pyfile.url
         if 's2l.biz' in url:
             url = self.load(url, just_header=True)['location']
-        self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1)
-        self.file_id = re.match(self.__pattern__, url).group('ID')
+        if re.match(self.__pattern__, url):
+            self.base_url = "http://www.%s.biz" % re.match(self.__pattern__, url).group(1)
+            self.file_id = re.match(self.__pattern__, url).group('ID')
+        else:
+            self.log_debug("Could not initialize, URL [%s] does not match pattern [%s]" % (url, self.__pattern__))
+            self.fail("Unsupported download link")
         self.package = pyfile.package()
 
 
@@ -114,7 +118,10 @@ def unlock_captcha_protection(self):
         self.log_debug("Captcha map with [%d] positions" % len(captchaMap.keys()))
 
         #: Request user for captcha coords
-        m = re.search(r'<img src="/captcha.gif\?d=(.*?)&amp;PHPSESSID=(.*?)&amp;legend=1"', self.html)
+        m = re.search(r'<img src="/captcha.gif\?d=(.+?)&PHPSESSID=(.+?)&legend=1"', self.html)
+        if not m:
+            self.log_debug("Captcha url data not found, maybe plugin out of date?")
+            self.fail("Captcha url data not found")
         captchaUrl = self.base_url + '/captcha.gif?d=%s&PHPSESSID=%s' % (m.group(1), m.group(2))
         self.log_debug("Waiting user for correct position")
         coords = self.captcha.decrypt(captchaUrl, input_type="gif", output_type='positional')


Test patch: