Browse Source

Make the json for nightly have friendly URLs

Mikkel Hjortshoej 5 years ago
parent
commit
8f2b848698
2 changed files with 4 additions and 8 deletions
  1. 4 3
      ci/create_nightly_json.py
  2. 0 5
      ci/create_nightly_json.sh

+ 4 - 3
ci/create_nightly_json.py

@@ -1,7 +1,8 @@
 import subprocess
 import sys
 import json
-import datetime;
+import datetime
+import urllib.parse
 
 def main():
     files_by_date = {}
@@ -12,9 +13,9 @@ def main():
         if parts[0]:
             json_str = execute_cli(f"b2 get-file-info {parts[0]}")
             data = json.loads(json_str)
-            url = execute_cli(f"b2 make-url {data['fileId']}").strip()
-            sha1 = data['contentSha1']
             name = remove_prefix(data['fileName'], "nightly/")
+            url = f"https://f001.backblazeb2.com/file/odin-binaries/nightly/{urllib.parse.quote_plus(name)}"
+            sha1 = data['contentSha1']
             ts = int(data['fileInfo']['src_last_modified_millis'])
             date = datetime.datetime.fromtimestamp(ts/1000).strftime('%Y-%m-%d')
             

+ 0 - 5
ci/create_nightly_json.sh

@@ -1,5 +0,0 @@
-FILE_IDS=$(b2 ls --long odin-binaries nightly | cut -d ' ' -f 1)
-
-while IFS= read -r line; do
-    echo "... $line ..."
-done <<< "$list"