aboutsummaryrefslogtreecommitdiff
path: root/bot4chan.py
diff options
context:
space:
mode:
authorAche <ache@ache.one>2016-08-19 06:25:25 +0200
committerAche <ache@ache.one>2016-08-19 06:25:25 +0200
commit7a8eebdabb69051e56f23d3fe7888a3fefd896f6 (patch)
tree03dd9a759589d36d033e33dd162f6e92f155ea97 /bot4chan.py
First script
bot4chan.py A script to dl a lot of img on 4chan. Must be tested.
Diffstat (limited to 'bot4chan.py')
-rwxr-xr-xbot4chan.py23
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")
+
+