Ajout boucle try sur les dls
This commit is contained in:
@ -10,12 +10,23 @@ from os import mkdir, listdir
|
|||||||
from re import findall
|
from re import findall
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
'''
|
'''
|
||||||
############## 4chan thread scrapper ################
|
############## 4chan thread scrapper ################
|
||||||
here we look for particular threads on 4chan and dl their images
|
This script is deisgned to look for specific words on 4 chan boards, and download all images from relevant thread.
|
||||||
|
Usage of a VPN is recommended since 4chan is a shady place. Use at your own risk !
|
||||||
|
|
||||||
|
|
||||||
|
. \\
|
||||||
|
,` ( ` SquiP
|
||||||
|
( \' "
|
||||||
|
`-.__)_
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def getArgs():
|
def getArgs():
|
||||||
'''Gets all the arguments passed to the script and returns them in a parse_args()-type object.
|
'''Gets all the arguments passed to the script and returns them in a parse_args()-type object.
|
||||||
No args
|
No args
|
||||||
@ -133,6 +144,7 @@ def constant_dl(folder, url):
|
|||||||
- folder: folder to dl into
|
- folder: folder to dl into
|
||||||
- url : board to watch
|
- url : board to watch
|
||||||
'''
|
'''
|
||||||
|
try:
|
||||||
while True:
|
while True:
|
||||||
sleep(2)
|
sleep(2)
|
||||||
soup = html_get(url)
|
soup = html_get(url)
|
||||||
@ -149,7 +161,8 @@ def constant_dl(folder, url):
|
|||||||
subsources = scraper(subsoup)
|
subsources = scraper(subsoup)
|
||||||
print(subsources)
|
print(subsources)
|
||||||
item_dl(subsources, folder)
|
item_dl(subsources, folder)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Houston, we had a problem: \n{e}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user