summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/webvicli/webvicli/client.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webvicli/webvicli/client.py b/src/webvicli/webvicli/client.py
index 737125a..0af470d 100644
--- a/src/webvicli/webvicli/client.py
+++ b/src/webvicli/webvicli/client.py
@@ -39,6 +39,7 @@ from StringIO import StringIO
from . import menu
VERSION = '0.5.0'
+WEBVI_STREAM_USER_AGENT = "Mozilla/5.0"
# Default options
DEFAULT_PLAYERS = ['mplayer -cache-min 10 "%s"',
@@ -105,6 +106,12 @@ def next_available_file_name(basename, ext):
i += 1
return '%s-%d%s' % (basename, i, ext)
+
+class WebviURLopener(urllib.FancyURLopener):
+ version = WEBVI_STREAM_USER_AGENT
+urllib._urlopener = WebviURLopener()
+
+
class StringIOCallback(StringIO):
def write_and_return_length(self, buf):
self.write(buf)