'Attempts to find a plugin that can use this URL.
The default protocol (http) will be prefixed to the URL if
not specified.
Raises :exc:`NoPluginError` on failure.
:param url: a URL to match against loaded plugins'

def resolve_url(self, url):

    parsed = urlparse(url)
    if (len(parsed.scheme) == 0):
        url = ('http://' + url)
    for (name, plugin) in self.plugins.items():
        if plugin.can_handle_url(url):
            obj = plugin(url)
            return obj
    try:
        res = self.http.head(url, allow_redirects=True, acceptable_status=[501])
        if (res.status_code == 501):
            res = self.http.get(url, stream=True)
        if (res.url != url):
            return self.resolve_url(res.url)
    except PluginError:
        pass
    raise NoPluginError
