Check file size when creating webseed torrent creator

This commit is contained in:
mhdzumair
2025-01-14 08:42:20 +05:30
parent 99b2f3ea29
commit 277bc7f390
+4
View File
@@ -2863,6 +2863,10 @@
" if not os.path.exists(local_file_path):\n",
" raise Exception(f\"Downloaded file not found: {local_file_path}\")\n",
"\n",
" file_size = os.path.getsize(local_file_path) # Size in bytes\n",
" if file_size < 10 * 1024 * 1024: # 10 MB in bytes\n",
" raise Exception(f\"Downloaded file size is less than 10MB (size: {file_size / (1024 * 1024):.2f} MB)\")\n",
"\n",
" # Create torrent file\n",
" output_path = os.path.join(self.base_path, \"torrents\", f\"{torrent_name}.torrent\")\n",
"\n",