-
-
Save github-userx/7429b6a52f4699ca05f446527dff0ed0 to your computer and use it in GitHub Desktop.
axel batch bulk download python script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import os | |
| import base64 | |
| import time | |
| # Axel is an awesome lightweight linux command line download accelerator, | |
| # this script reads links from a given text file and executes axel | |
| # automating batch/bulk downloads at high speeds | |
| # | |
| # I plan to add more options to this script when i find time | |
| # enjoy and feel free to fix or use this code | |
| # Coded by CodeFalasi | |
| # Twitter @CodeFalasi | |
| print '[i] Axel batch downloader v 1.0' | |
| time.sleep(0.9) | |
| userinputfile = raw_input("[?] Text file holding links: ") | |
| print '[!] Answer y for yes or n for no, Case sensative!' | |
| usrchk = raw_input("[?] Does this site require authentication? [y/n] ") | |
| if usrchk == 'y': | |
| username = raw_input('[?] Username: ') | |
| password = raw_input('[?] Password: ') | |
| base64AuthCode = base64.b64encode(username + ':' + password) | |
| print '[i] Running axel with http auth: ' | |
| time.sleep(1.9) | |
| f = open(userinputfile, "r") | |
| for line in f.read().split('\n'): | |
| cmd = "axel -a -n 20 -H 'Authorization: Basic %s " %base64AuthCode + "' " + line | |
| os.system(cmd) | |
| f.close() | |
| print '[i] Done...' | |
| else: | |
| print '[i] Running axel ' | |
| time.sleep(1.9) | |
| f = open(userinputfile, "r") | |
| for line in f.read().split('\n'): | |
| os.system('axel -a -n 20 ' + line ) | |
| print '[i] Done...' | |
| f.close() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment