File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,14 +263,21 @@ def website_downloader(self):
263263
264264 # Directory Setup
265265 if self .is_termux :
266- storage_path = "/sdcard/Download/Websites"
266+ primary_storage_path = "/storage/emulated/0/Download/Websites"
267+ fallback_storage_path = "/sdcard/Download/Websites"
268+ storage_path = primary_storage_path
269+ try :
270+ os .makedirs (storage_path , exist_ok = True )
271+ except Exception :
272+ storage_path = fallback_storage_path
273+ try :
274+ os .makedirs (storage_path , exist_ok = True )
275+ except Exception :
276+ storage_path = os .path .join (self .save_dir , "Websites" )
277+ os .makedirs (storage_path , exist_ok = True )
267278 else :
268279 storage_path = os .path .join (os .path .expanduser ("~" ), "Downloads" , "Websites" )
269-
270- if not os .path .exists (storage_path ):
271- try : os .makedirs (storage_path )
272- except : storage_path = os .path .join (self .save_dir , "Websites" )
273- if not os .path .exists (storage_path ): os .makedirs (storage_path )
280+ os .makedirs (storage_path , exist_ok = True )
274281
275282 url = input (f"{ Fore .WHITE } Target URL: { Style .RESET_ALL } " ).strip ()
276283 if not url .startswith ('http' ): url = 'http://' + url
You can’t perform that action at this time.
0 commit comments