]> code.delx.au - webdl/blobdiff - common.py
Added license
[webdl] / common.py
index c2badff307d177f75cc8fa74398eb158a51b03ff..3370b36e82f86867e0a4eb2b4fb7316b092cd2db 100644 (file)
--- a/common.py
+++ b/common.py
@@ -57,9 +57,6 @@ def load_root_node():
     import sbs
     sbs.fill_nodes(root_node)
 
-###    import plus7
-###    plus7.fill_nodes(root_node)
-
     import brightcove
     brightcove.fill_nodes(root_node)
 
@@ -234,12 +231,18 @@ def convert_to_mp4(filename):
 
 def download_hds(filename, video_url, pvswf=None):
     filename = sanify_filename(filename)
-    video_url = video_url.replace("http://", "hds://")
     print "Downloading: %s" % filename
+
+    video_url = video_url.replace("http://", "hds://")
+    if pvswf:
+        param = "%s pvswf=%s" % (video_url, pvswf)
+    else:
+        param = video_url
+
     cmd = [
         "livestreamer",
         "-o", filename,
-        "%s pvswf=%s" % (video_url, pvswf),
+        param,
         "best",
     ]
     if exec_subprocess(cmd):
@@ -262,24 +265,6 @@ def download_hls(filename, video_url):
     else:
         return False
 
-def download_rtmp(filename, vbase, vpath, hash_url=None):
-    filename = sanify_filename(filename)
-    print "Downloading: %s" % filename
-    if vpath.endswith(".flv"):
-        vpath = vpath[:-4]
-    cmd = [
-        "rtmpdump",
-        "-o", filename,
-        "-r", vbase,
-        "-y", vpath,
-    ]
-    if hash_url is not None:
-        cmd += ["--swfVfy", hash_url]
-    if exec_subprocess(cmd):
-        return convert_to_mp4(filename)
-    else:
-        return False
-
 def natural_sort(l, key=None):
     ignore_list = ["a", "the"]
     def key_func(k):