diff --git a/pym/euscan/handlers/__init__.py b/pym/euscan/handlers/__init__.py index bdae6f8..8ee02b3 100644 --- a/pym/euscan/handlers/__init__.py +++ b/pym/euscan/handlers/__init__.py @@ -158,7 +158,7 @@ def scan_url(pkg, urls, options, on_progress=None): except Exception as e: output.ewarn( "Handler failed: [%s] %s" % - (e.__class__.__name__, e.message) + (e.__class__.__name__, str(e)) ) if versions and CONFIG['oneshot']: diff --git a/pym/euscan/handlers/freecode.py b/pym/euscan/handlers/freecode.py index b6f5a70..94ec649 100644 --- a/pym/euscan/handlers/freecode.py +++ b/pym/euscan/handlers/freecode.py @@ -22,7 +22,7 @@ def scan_pkg(pkg, options): output.einfo("Using FreeCode handler: " + package) fp = urllib.request.urlopen("http://freecode.com/projects/%s/releases" % package) - content = fp.read() + content = str(fp.read()) result = re.findall( r'([^<]+)' % package, @@ -36,10 +36,10 @@ def scan_pkg(pkg, options): continue fp = urllib.request.urlopen("http://freecode.com/projects/%s/releases/%s" % (package, release_id)) - content = fp.read() + content = str(fp.read()) download_page = re.findall(r']*href", data, re.I): + if re.search(b"<\s*a\s+[^>]*href", data, re.I): results.extend(scan_html(data, url, pattern)) elif url.startswith('ftp://'): results.extend(scan_ftp(data, url, pattern))