smooth-dl.py: support using a local path for the Manifest file
authorAntonio Ospite <ao2@ao2.it>
Fri, 15 Jan 2016 19:15:40 +0000 (20:15 +0100)
committerAntonio Ospite <ao2@ao2.it>
Fri, 15 Jan 2016 19:15:40 +0000 (20:15 +0100)
smooth-dl.py

index 44ef722..39785a4 100755 (executable)
@@ -118,11 +118,11 @@ def get_manifest(url, dest_dir):
     if not manifest_url.lower().endswith(('/manifest', '.ismc', '.csm')):
         manifest_url += '/Manifest'
 
     if not manifest_url.lower().endswith(('/manifest', '.ismc', '.csm')):
         manifest_url += '/Manifest'
 
-    if manifest_url.startswith('http://'):
+    if os.path.exists(url):
+        local_manifest_path = url
+    else:
         local_manifest_path = os.path.join(dest_dir, 'Manifest')
         download_file(manifest_url, local_manifest_path, "w")
         local_manifest_path = os.path.join(dest_dir, 'Manifest')
         download_file(manifest_url, local_manifest_path, "w")
-    else:
-        local_manifest_path = url
 
     manifest = etree.parse(local_manifest_path)
 
 
     manifest = etree.parse(local_manifest_path)