stream: Add scheme and blacklist check to translate_uri

We don't bother with this inside the unwrap code as if something redirects us
so be it.
This commit is contained in:
Thomas Adamcik 2016-02-15 00:00:30 +01:00
parent 9aa2a8a370
commit ce81b362dc
2 changed files with 8 additions and 1 deletions

View File

@ -74,6 +74,13 @@ class StreamLibraryProvider(backend.LibraryProvider):
class StreamPlaybackProvider(backend.PlaybackProvider):
def translate_uri(self, uri):
if urllib.parse.urlsplit(uri).scheme not in self.backend.uri_schemes:
return None
if self.backend._blacklist_re.match(uri):
logger.debug('URI matched metadata lookup blacklist: %s', uri)
return uri
return _unwrap_stream(
uri,
timeout=self.backend._timeout,

View File

@ -30,7 +30,7 @@ def config():
'stream': {
'timeout': TIMEOUT,
'metadata_blacklist': [],
'protocols': ['file'],
'protocols': ['http'],
},
'file': {
'enabled': False