aegis-framework 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aegis/core/window.py +17 -3
- package/package.json +1 -1
package/aegis/core/window.py
CHANGED
|
@@ -686,9 +686,23 @@ class AegisWindow(Gtk.Window):
|
|
|
686
686
|
# Ensure destination directory exists
|
|
687
687
|
os.makedirs(os.path.dirname(dest) or '.', exist_ok=True)
|
|
688
688
|
|
|
689
|
-
# Check if aria2c is available
|
|
690
|
-
|
|
691
|
-
|
|
689
|
+
# Check if aria2c is available
|
|
690
|
+
aria2c_path = shutil.which('aria2c')
|
|
691
|
+
|
|
692
|
+
if aria2c_path:
|
|
693
|
+
# Check if aria2c is from snap (has sandbox restrictions on hidden dirs)
|
|
694
|
+
is_snap = '/snap/' in aria2c_path
|
|
695
|
+
|
|
696
|
+
# Check if destination is in a hidden directory
|
|
697
|
+
dest_has_hidden = any(part.startswith('.') for part in dest.split('/') if part)
|
|
698
|
+
|
|
699
|
+
# Use aria2c only if: not snap, OR dest is not hidden
|
|
700
|
+
if not is_snap or not dest_has_hidden:
|
|
701
|
+
self._download_with_aria2(url, dest, connections, callback_id)
|
|
702
|
+
else:
|
|
703
|
+
# Snap aria2c can't access hidden dirs - use urllib
|
|
704
|
+
print(f"[Aegis] Snap aria2c can't access hidden dirs, using urllib")
|
|
705
|
+
self._download_with_urllib(url, dest, callback_id)
|
|
692
706
|
else:
|
|
693
707
|
self._download_with_urllib(url, dest, callback_id)
|
|
694
708
|
|
package/package.json
CHANGED