aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/livestreamer/utils.py
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2011-12-19 15:45:12 +0100
committerGravatar Christopher Rosell <chrippa@tanuki.se>2011-12-19 15:45:12 +0100
commit89be5d3882d3849809a99693de4da167a638ec01 (patch)
treea23daef542ee7a1c16366451f3aa2ad91c527774 /src/livestreamer/utils.py
parent166c98fcce9548df9bdc8586570df6ed00ad71b7 (diff)
Add argument reading from ~/.livestreamerrc.
Diffstat (limited to 'src/livestreamer/utils.py')
-rw-r--r--src/livestreamer/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/livestreamer/utils.py b/src/livestreamer/utils.py
index bfb59cc..7eaec95 100644
--- a/src/livestreamer/utils.py
+++ b/src/livestreamer/utils.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from livestreamer.compat import urllib, bytes
-import hmac, hashlib, zlib
+import hmac, hashlib, zlib, argparse
SWF_KEY = b"Genuine Adobe Flash Player 001"
@@ -28,6 +28,10 @@ class CommandLine(object):
return cmdline
+class ArgumentParser(argparse.ArgumentParser):
+ def convert_arg_line_to_args(self, line):
+ arg = line.split("=")
+ yield "--%s=%s" % (arg[0].strip(), arg[1].strip())
def swfverify(url):
fd = urllib.urlopen(url)