]> code.delx.au - webdl/blobdiff - grabber.py
brightcove: seems to work well, no need to mark it experimental anymore
[webdl] / grabber.py
index 165d5ea855eb20a06bd6d28e3503fc6625e281c7..5c3c948293139e0ba1234243eb4638e63e82b140 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python2
 # vim:ts=4:sts=4:sw=4:noet
 
 from common import load_root_node, natural_sort
@@ -17,7 +17,7 @@ def choose(options, allow_multi):
                                continue
                        if 0 in values:
                                return
-                       values = [reverse_map[value] for value in values]
+                       values = [reverse_map[value] for value in values if value in reverse_map]
                        if allow_multi:
                                return values
                        else:
@@ -37,8 +37,7 @@ def main():
                        options.append((n.title, n))
                        if not n.can_download:
                                will_download = False
-               if node.sort_children:
-                       options = natural_sort(options, key=lambda x: x[0])
+               options = natural_sort(options, key=lambda x: x[0])
                result = choose(options, allow_multi=will_download)
                if result is None:
                        if node.parent is not None: