diff options
Diffstat (limited to 'bot4chan.py')
-rwxr-xr-x | bot4chan.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bot4chan.py b/bot4chan.py index 736ad6e..ecdab75 100755 --- a/bot4chan.py +++ b/bot4chan.py @@ -11,7 +11,13 @@ os.system("sed -i 's/<\\/a>/<\\/a>\\n/g' index.html") regex = '<span class="filesize">(File : |File)<a href="(.*?)" target="_blank">(.*?)</a>' regex = '<a class="fileThumb" href="(.*?)" target="_blank">' -os.system("mkdir -p dump") + +dumpDir = "dump" + +if len(sys.argv) >= 3 : + dumpDir = sys.argv[2] + +os.system("mkdir -p " + dumpDir) with open("index.html",'r') as f: for line in f: yes = re.search(regex, line) @@ -20,6 +26,6 @@ with open("index.html",'r') as f: sujetT.append( [yes.group(1)] ) print( "Téléchargement de : " + yes.group(1) ) os.system("wget " + 'http:' + yes.group(1) + " -N -q") - os.system("mv " + yes.group(1)[yes.group(1).rfind('/')+1:] + " dump") + os.system("mv " + yes.group(1)[yes.group(1).rfind('/')+1:] + " " + dumpDir) |