@@ -46,7 +46,7 @@ async def download_chunk(
46
46
47
47
async def download_file (
48
48
self , url : str , filename : str , max_files : int , chunk_size : int , headers : Optional [Dict [str , str ]] = None ,
49
- parallel_failures : int = 3 , max_retries : int = 5 , callback : Optional [Any ] = None , show_progress : bool = True
49
+ parallel_failures : int = 3 , max_retries : int = 5 , callback : Optional [Any ] = None , show_progress : bool = True , progress_desc : Optional [ str ] = None
50
50
):
51
51
headers = headers or {"User-Agent" : "Wget/1.21.2" , "Accept" : "*/*" , "Accept-Encoding" : "identity" , "Connection" : "Keep-Alive" }
52
52
try :
@@ -81,7 +81,7 @@ async def download_file(
81
81
))
82
82
83
83
if show_progress :
84
- progress_bar = tqdm (total = file_size , unit = "B" , unit_scale = True , desc = "Downloading on 🔥" )
84
+ progress_bar = tqdm (total = file_size , unit = "B" , unit_scale = True , desc = progress_desc )
85
85
86
86
for chunk_result in asyncio .as_completed (tasks ):
87
87
downloaded = await chunk_result
@@ -114,7 +114,7 @@ async def download_chunk_with_retries(
114
114
115
115
async def upload_file (
116
116
self , file_path : str , parts_urls : List [str ], chunk_size : int , max_files : int ,
117
- parallel_failures : int = 3 , max_retries : int = 5 , callback : Optional [Any ] = None , show_progress : bool = True
117
+ parallel_failures : int = 3 , max_retries : int = 5 , callback : Optional [Any ] = None , show_progress : bool = True , progress_desc : Optional [ str ] = None
118
118
):
119
119
file_size = os .path .getsize (file_path )
120
120
part_size = file_size // len (parts_urls )
@@ -137,7 +137,7 @@ async def upload_file(
137
137
))
138
138
139
139
if show_progress :
140
- progress_bar = tqdm (total = file_size , unit = "B" , unit_scale = True , desc = "Uploading on 🔥" )
140
+ progress_bar = tqdm (total = file_size , unit = "B" , unit_scale = True , desc = progress_desc )
141
141
142
142
for chunk_result in asyncio .as_completed (tasks ):
143
143
uploaded = await chunk_result
0 commit comments