Skip to content

Instantly share code, notes, and snippets.

@stephenmac7
Created April 23, 2013 20:32
Show Gist options
  • Save stephenmac7/5447127 to your computer and use it in GitHub Desktop.
Save stephenmac7/5447127 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import os
import sys
import re
try:
from urllib.parse import unquote
except ImportError:
from urllib import unquote
adfly_url = sys.argv[1]
adfly_part = re.search("http://adf.ly/[0-9]*/", adfly_url).group()
adfly_no = unquote(adfly_url).split(adfly_part)[1]
if adfly_no[0:4] != "http":
adfly_no = "http://" + adfly_no
os.system("aria2c -x2 '" + adfly_no + "'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment