From 8c18c14ab56541aeae9123ee3b558b70aeabfd09 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 11 Apr 2014 12:19:22 +0200 Subject: Use re.match for __pattern__ matches instead re.search Merges vuolter/pyload@9117005 --- module/plugins/hoster/BasePlugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/BasePlugin.py') diff --git a/module/plugins/hoster/BasePlugin.py b/module/plugins/hoster/BasePlugin.py index 62e800f49..80de9e9f2 100644 --- a/module/plugins/hoster/BasePlugin.py +++ b/module/plugins/hoster/BasePlugin.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- from urlparse import urlparse -from re import search +from re import match, search from urllib import unquote from module.network.HTTPRequest import BadHeader @@ -83,7 +83,7 @@ class BasePlugin(Hoster): if 'location' in header: self.logDebug("Location: " + header['location']) - base = search(r'https?://[^/]+', url).group(0) + base = match(r'https?://[^/]+', url).group(0) if header['location'].startswith("http"): url = unquote(header['location']) elif header['location'].startswith("/"): -- cgit v1.2.3