diff options
-rwxr-xr-x | bot4chan.py | 23 |
1 files changed, 23 insertions, 0 deletions
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 = '<span class="filesize">(File : |File)<a href="(.*?)" target="_blank">(.*?)</a>' +regex = '<a class="fileThumb" href="(.*?)" target="_blank">' +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") + + |