From 7a8eebdabb69051e56f23d3fe7888a3fefd896f6 Mon Sep 17 00:00:00 2001 From: Ache Date: Fri, 19 Aug 2016 06:25:25 +0200 Subject: First script bot4chan.py A script to dl a lot of img on 4chan. Must be tested. --- bot4chan.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bot4chan.py (limited to 'bot4chan.py') diff --git a/bot4chan.py b/bot4chan.py new file mode 100755 index 0000000..5186697 --- /dev/null +++ b/bot4chan.py @@ -0,0 +1,23 @@ +#!/usr/bin/python +# -*-coding:utf-8 -* + +import re, os, sys + +sujet = [] +sujetT = [] + +#os.system("wget " + sys.argv[1] + " -O index.html -N -q") +regex = '(File : |File)(.*?)' +regex = '' +os.system("mkdir -p dump") +with open("index.html",'r') as f: + for line in f: + yes = re.search(regex, line) + if yes : + print(yes.group(1)) + 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") + + -- cgit v1.2.3