Created
April 23, 2013 20:32
-
-
Save stephenmac7/5447127 to your computer and use it in GitHub Desktop.
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 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