Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
axel batch bulk download python script
#!/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
You can’t perform that action at this time.