Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aria2 support (patch included) #25

Open
vx-toxic opened this issue Feb 22, 2025 · 0 comments
Open

Aria2 support (patch included) #25

vx-toxic opened this issue Feb 22, 2025 · 0 comments

Comments

@vx-toxic
Copy link

vx-toxic commented Feb 22, 2025

aria2c is much better downloader than wget, as can utilize multiple threads which make download process much faster

I am not fluent in Python, so please add aria2c utility availably by yourself or rollback to wget if aria2 is not installed

Here is working code when aria2c is already installed

diff --git a/snapshot-finder.py b/snapshot-finder.py
index d15e226..9cf4752 100644
--- a/snapshot-finder.py
+++ b/snapshot-finder.py
@@ -324,15 +324,15 @@ def download(url: str):

     try:
         # dirty trick with wget. Details here - https://github.com/c29r3/solana-snapshot-finder/issues/11
-        if MAX_DOWNLOAD_SPEED_MB is not None:
-            process = subprocess.run([wget_path, '--progress=dot:giga', f'--limit-rate={MAX_DOWNLOAD_SPEED_MB}M',
-                                      '--trust-server-names', url, f'-O{temp_fname}'],
-              stdout=subprocess.PIPE,
-              universal_newlines=True)
-        else:
-            process = subprocess.run([wget_path, '--progress=dot:giga', '--trust-server-names', url, f'-O{temp_fname}'],
-              stdout=subprocess.PIPE,
-              universal_newlines=True)
+#        if MAX_DOWNLOAD_SPEED_MB is not None:
+#            process = subprocess.run([wget_path, '--progress=dot:giga', f'--limit-rate={MAX_DOWNLOAD_SPEED_MB}M',
+#                                      '--trust-server-names', url, f'-O{temp_fname}'],
+#              stdout=subprocess.PIPE,
+#              universal_newlines=True)
+#        else:
+        process = subprocess.run(['aria2c', '-c', '-j 10', '-s 10', f'--dir={SNAPSHOT_PATH}', f'--out=tmp-{fname}', url],
+          stdout=subprocess.PIPE,
+          universal_newlines=True)

wbr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant