浏览代码

Descargar el audio solo cuando no existe

Hugo 3 年之前
父节点
当前提交
4c2ceef167
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ondemand/service.py

+ 1 - 1
ondemand/service.py

@@ -492,11 +492,11 @@ def cloud_download(ad_key=None):
     filename = os.path.basename(ad['path'])
     out_file = os.path.join(AUDIOS_PATH, filename)
     url = '{}/{}'.format(cloud_base_url, ad['path'])
-    response = requests.get(url)
 
     if(os.path.isfile(out_file)):
         return out_file, md5_checksum(out_file)
 
+    response = requests.get(url)
     if response.status_code == 200:
         hashes = response.headers['x-goog-hash']
         hashes = hashes.split(',')