Преглед на файлове

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(',')