Spaces:
Paused
Paused
Commit
·
cb31836
1
Parent(s):
e661755
fix
Browse files- Instance.py +4 -6
Instance.py
CHANGED
|
@@ -123,8 +123,7 @@ class Instance:
|
|
| 123 |
print(f"Error getting system proxies: {e}")
|
| 124 |
return {}
|
| 125 |
|
| 126 |
-
|
| 127 |
-
def download_film(file_url, token, cache_path, proxies, film_id, title, chunk_size=100 * 1024 * 1024):
|
| 128 |
"""
|
| 129 |
Downloads a file from the specified URL and saves it to the cache path.
|
| 130 |
Tracks the download progress.
|
|
@@ -155,7 +154,7 @@ class Instance:
|
|
| 155 |
download_progress[film_id]["downloaded"] += len(data)
|
| 156 |
|
| 157 |
print(f'File cached to {cache_path} successfully.')
|
| 158 |
-
|
| 159 |
download_progress[film_id]["status"] = "Completed"
|
| 160 |
except RequestException as e:
|
| 161 |
print(f"Error downloading file: {e}")
|
|
@@ -214,8 +213,7 @@ class Instance:
|
|
| 214 |
json.dump(film_store_data, json_file, indent=2)
|
| 215 |
print(f'Film store updated with {title}.')
|
| 216 |
|
| 217 |
-
|
| 218 |
-
def download_episode(file_url, token, cache_path, proxies, episode_id, title, chunk_size=100 * 1024 * 1024):
|
| 219 |
"""
|
| 220 |
Downloads a file from the specified URL and saves it to the cache path.
|
| 221 |
Tracks the download progress.
|
|
@@ -246,7 +244,7 @@ class Instance:
|
|
| 246 |
download_progress[episode_id]["downloaded"] += len(data)
|
| 247 |
|
| 248 |
print(f'File cached to {cache_path} successfully.')
|
| 249 |
-
|
| 250 |
download_progress[episode_id]["status"] = "Completed"
|
| 251 |
except RequestException as e:
|
| 252 |
print(f"Error downloading file: {e}")
|
|
|
|
| 123 |
print(f"Error getting system proxies: {e}")
|
| 124 |
return {}
|
| 125 |
|
| 126 |
+
def download_film(self, file_url, token, cache_path, proxies, film_id, title, chunk_size=100 * 1024 * 1024):
|
|
|
|
| 127 |
"""
|
| 128 |
Downloads a file from the specified URL and saves it to the cache path.
|
| 129 |
Tracks the download progress.
|
|
|
|
| 154 |
download_progress[film_id]["downloaded"] += len(data)
|
| 155 |
|
| 156 |
print(f'File cached to {cache_path} successfully.')
|
| 157 |
+
self.update_film_store_json(title, cache_path)
|
| 158 |
download_progress[film_id]["status"] = "Completed"
|
| 159 |
except RequestException as e:
|
| 160 |
print(f"Error downloading file: {e}")
|
|
|
|
| 213 |
json.dump(film_store_data, json_file, indent=2)
|
| 214 |
print(f'Film store updated with {title}.')
|
| 215 |
|
| 216 |
+
def download_episode(self, file_url, token, cache_path, proxies, episode_id, title, chunk_size=100 * 1024 * 1024):
|
|
|
|
| 217 |
"""
|
| 218 |
Downloads a file from the specified URL and saves it to the cache path.
|
| 219 |
Tracks the download progress.
|
|
|
|
| 244 |
download_progress[episode_id]["downloaded"] += len(data)
|
| 245 |
|
| 246 |
print(f'File cached to {cache_path} successfully.')
|
| 247 |
+
self.update_tv_store_json(title, cache_path)
|
| 248 |
download_progress[episode_id]["status"] = "Completed"
|
| 249 |
except RequestException as e:
|
| 250 |
print(f"Error downloading file: {e}")
|