From 68c82393d6a2a7addf2cb630e0317b7781fc4dc5 Mon Sep 17 00:00:00 2001 From: raphael60650 Date: Thu, 24 Jun 2021 11:26:15 +0200 Subject: [PATCH] added check_track_sha1 to avoid download issue --- source/get_github_file.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/get_github_file.py b/source/get_github_file.py index 65ba350..2f4be56 100644 --- a/source/get_github_file.py +++ b/source/get_github_file.py @@ -1,4 +1,5 @@ import requests +import subprocess import os from .definition import * @@ -27,3 +28,9 @@ def get_github_file(self, file): except: self.log_error() return -1 + + +def check_track_sha1(file, excepted_sha1): + sha1 = subprocess.run(["./tools/szs/wszst", "SHA1", file]).stdout.decode().split(" ")[0] + if excepted_sha1 == sha1: return 0 + else: return -1