-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmods.py
48 lines (43 loc) · 1.06 KB
/
mods.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
42
43
44
45
46
47
48
import requests
def CheckType(url):
try:
s = requests.get(url)
ext = s.headers.get('content-type')
return ext
except:
return "bool"
def ImgrCheck(domain, ext, url1):
if 'imgur' in domain and 'text' in ext and AlbumCheck(url1) == False:
return True
else:
return False
def AlbumCheck(url1):
if url1[17] == 'a':
print "This is part of an album"
return True
else:
return False
def DrawResults(saved, not_saved):
print "\n"
print "Images Saved"
print "---------------------"
print "| |"
print "| %d |" % saved
print "| |"
print "---------------------"
if not_saved < 9:
print "\n"
print "Images NOT saved"
print "---------------------"
print "| |"
print "| %d |" % not_saved
print "| |"
print "---------------------"
else:
print "\n"
print "Images NOT saved"
print "---------------------"
print "| |"
print "| %d |" % not_saved
print "| |"
print "---------------------"