-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrip.py
More file actions
executable file
·162 lines (153 loc) · 4.56 KB
/
rip.py
File metadata and controls
executable file
·162 lines (153 loc) · 4.56 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/usr/bin/python
from sys import argv, exit
import os
import platform
from sites.site_deviantart import deviantart
from sites.site_flickr import flickr
from sites.site_imagearn import imagearn
from sites.site_imagebam import imagebam
from sites.site_imagefap import imagefap
from sites.site_imgur import imgur
#from sites.site_webstagram import instagram
from sites.site_statigram import instagram
from sites.site_photobucket import photobucket
from sites.site_tumblr import tumblr
from sites.site_twitter import twitter
from sites.site_xhamster import xhamster
from sites.site_getgonewild import getgonewild
from sites.site_anonib import anonib
from sites.site_motherless import motherless
from sites.site_4chan import fourchan
from sites.site_minus import minus
from sites.site_gifyo import gifyo
from sites.site_five00px import five00px
from sites.site_cghub import cghub
from sites.site_chickupload import chickupload
from sites.site_teenplanet import teenplanet
from sites.site_chansluts import chansluts
from sites.site_buttoucher import buttoucher
from sites.site_pichunter import pichunter
from sites.site_soupio import soupio
from sites.site_imgbox import imgbox
from sites.site_reddit import reddit
from sites.site_gallerydump import gallerydump
from sites.site_fapdu import fapdu
from sites.site_fuskator import fuskator
from sites.site_kodiefiles import kodiefiles
from sites.site_pbase import pbase
from sites.site_8muses import eightmuses
from sites.site_setsdb import setsdb
from sites.site_nfsfw import nfsfw
from sites.site_shareimage import shareimage
from sites.site_seenive import seenive
from sites.site_vinebox import vinebox
from sites.site_imgchili import imgchili
from sites.site_fapproved import fapproved
from sites.site_gonewild import gonewild
from sites.site_vidble import vidble
from sites.site_soundcloud import soundcloud
# No longer supported
from sites.site_occ import occ
from sites.site_gonearch import gonearch
sites = [ \
deviantart, \
flickr, \
imagearn, \
imagebam, \
imagefap, \
imgur, \
instagram, \
photobucket, \
tumblr, \
twitter, \
xhamster, \
getgonewild, \
anonib, \
motherless, \
fourchan, \
minus, \
gifyo, \
five00px, \
chickupload, \
cghub, \
teenplanet, \
chansluts, \
buttoucher, \
pichunter, \
soupio, \
imgbox, \
reddit, \
gallerydump, \
fapdu, \
fuskator, \
kodiefiles, \
pbase, \
eightmuses, \
setsdb, \
nfsfw, \
shareimage, \
seenive, \
vinebox, \
imgchili, \
fapproved, \
gonewild, \
vidble, \
soundcloud]
def main():
print '\nrarchives\' album ripper\n'
if len(argv) == 0 or argv[-1].endswith('rip.py'):
usage()
exit(1)
url = argv[-1]
ripper = get_ripper(url)
ripper.download()
print ''
print ' images ripped: %d' % ripper.image_count
print ' ripped to: %s' % ripper.working_dir
print ''
open_dir(ripper.working_dir)
def open_dir(path):
plat = platform.system()
if plat == 'Windows':
os.startfile(path)
elif plat == 'Darwin':
os.system('open "%s"' % path)
else:
os.system('xdg-open "%s"' % path)
def usage():
print ' usage:'
print ' python rip.py URL'
print ''
print ' supported sites:',
for i, site in enumerate(sites):
if i % 5 == 0:
print '\n ',
print site.__name__.ljust(12),
print '\n'
""" Returns an appropriate ripper for a URL, or throws exception """
def get_ripper(url):
for site in sites:
try:
ripper = site(url, debugging=False)
return ripper
except Exception, e:
# Rippers that aren't made for the URL throw blank Exception
error = str(e)
if error == '': continue
# If Exception isn't blank, then it's the right ripper but an error occurred
raise e
raise Exception('cannot rip given URL: "%s"' % url)
if __name__ == '__main__':
try:
main()
except Exception, e:
usage()
if type(e) == OSError and 'Permission denied' in str(e):
print '[!] ERROR'
print ' ensure you have write access to the these directories:'
print ' %s' % os.getcwd()
print ' or execute as root/admin\n'
elif type(e) == KeyboardInterrupt:
print '\n[!] ^C keyboard interrupt, exiting\n'
else:
print '[!] rip.py ended with error message:\n %s\n' % str(e)