-
Notifications
You must be signed in to change notification settings - Fork 2
/
daily.py
42 lines (33 loc) · 1.08 KB
/
daily.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
from multiprocessing import Pool
from lib.extractors import elegantmaturesnet, plumpstarscom
from lib.downloader import downloadGallery
#from lib.LargestImage import extractMostCommonGroup
#from lib.util.fs import *
#from lib.wget import *
#
#
#def downloadGallery(galleryLink):
# links = extractMostCommonGroup(galleryLink)
# for link in links:
# if not fileAlreadyDownloaded(link):
# try:
# data = wget(
# url=link,
# referer=galleryLink,
# useCache=True,
# numTries=3
# )
# saveDownloadedFile(link, data)
# except Exception, e:
# print 'ERROR: %s' % e
# else:
# print 'already downloaded %s' % link
def downloadAll():
pool = Pool(1)#5)
galleryLinks = plumpstarscom.getCurrentGalleries()
pool.map(downloadGallery, galleryLinks)
galleryLinks = elegantmaturesnet.getCurrentGalleries()
pool.map(downloadGallery, galleryLinks)
if __name__ == '__main__':
downloadAll()