def resolve_url(self, url):
        """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

        """
        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

        # Attempt to handle a redirect URL
        try:
            res = self.http.head(url, allow_redirects=True, acceptable_status=[501])

            # Fall back to GET request if server doesn't handle HEAD.
            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
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

        
src/livestreamer/session.py