-
Notifications
You must be signed in to change notification settings - Fork 1
/
JackSearch.py
378 lines (338 loc) · 17.7 KB
/
JackSearch.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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DownloadWindow.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
import youtube_dl
from PyQt4 import QtCore, QtGui
from bs4 import BeautifulSoup
import requests
import urllib
import os
import urllib2
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
def GetOpenloadVideo(path,filename):
print path
print filename
ydl = youtube_dl.YoutubeDL({'outtmpl': filename})
with ydl:
youtube_dlresult = ydl.extract_info(
path,
download=True # !!We just want to extract the info
)
if 'entries' in youtube_dlresult:
# Can be a playlist or a list of videos
video = youtube_dlresult['entries'][0]
else:
# Just a video
video = youtube_dlresult
return video
def GetOpenloadVideoDownloadInfo(VedioNumber):
Result = {
"result": "FAIL",
"url": "",
"filename": "",
}
keyword = VedioNumber
# print keyword
if unicode(VedioNumber) == "":
return Result
#SDDPOAV
if Result['result'] == "FAIL":
#if Result['result'] == "FAILs":
res = requests.get('http://sddpoav.com/?s=' + keyword)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
data = soup.find('div', attrs={'class': 'video'})
if data is not None:
if data.find('a') is not None:
href = data.find('a').get('href')
res = requests.get(href)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
video_path = soup.find('div', attrs={'class': 'video_code'}).find('iframe').get('src')
# print video_path
ydl = youtube_dl.YoutubeDL({'quiet': True})
# ydl = youtube_dl.YoutubeDL()
with ydl:
youtube_dlresult = ydl.extract_info(
video_path,
download=False # !!We just want to extract the info
)
if 'entries' in youtube_dlresult:
# Can be a playlist or a list of videos
video = youtube_dlresult['entries'][0]
else:
# Just a video
video = youtube_dlresult
#print(video)
Result['result'] = "PASS"
Result['url'] = video['url']
Result['filename'] = video['title']
#print urllib2.build_opener().open(video['url']).info()
return Result
print "Cannot Find this AV Number in http://sddpoav.com/"
#D18X
if Result['result'] == "FAIL":
#if Result['result'] == "FAILs":
#print "Find the https://www.dl8x.com/"
res = requests.get('https://www.dl8x.com/search?query=' + keyword)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
for data in soup.find_all('div', attrs={'class': 'float-left dx-vertical-item dx-video-entry-frame'}):
if data.find('div', attrs={'class': 'dx-video-entry-title'}) is not None and data.find('div', attrs={'class': 'dx-video-entry-site dx-video-entry-label '}) is not None:
if data.find('div', attrs={'class': 'dx-video-entry-site dx-video-entry-label '}).find('span').text == "Openload":
#print data.find('a').get('href')
res = requests.get('https://www.dl8x.com'+data.find('a').get('href'))
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
video_path = soup.find('iframe', attrs={'allowfullscreen': ''}).get('src')
ydl = youtube_dl.YoutubeDL({'quiet': True})
# ydl = youtube_dl.YoutubeDL()
with ydl:
youtube_dlresult = ydl.extract_info(
video_path,
download=False # !!We just want to extract the info
)
if 'entries' in youtube_dlresult:
# Can be a playlist or a list of videos
video = youtube_dlresult['entries'][0]
else:
# Just a video
video = youtube_dlresult
#print(video)
Result['result'] = "PASS"
Result['url'] = video['url']
Result['filename'] = video['title']
return Result
print "Cannot Find this AV Number in https://www.dl8x.com/"
#PORN68
#if Result['result'] == "FAILs":
if Result['result'] == "FAIL":
res = requests.get('http://porn68jav.com/?s=' + keyword)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
if soup.find('a', attrs={'class': 'clip-link'}) is not None:
data = soup.find('a', attrs={'class': 'clip-link'}).get("href")
res = requests.get(data)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
video_path = soup.find('iframe', attrs={'id': 'mIframe'}).get("src")
ydl = youtube_dl.YoutubeDL({'quiet': True})
# ydl = youtube_dl.YoutubeDL()
with ydl:
youtube_dlresult = ydl.extract_info(
video_path,
download=False # !!We just want to extract the info
)
if 'entries' in youtube_dlresult:
# Can be a playlist or a list of videos
video = youtube_dlresult['entries'][0]
else:
# Just a video
video = youtube_dlresult
#print(video)
Result['result'] = "PASS"
Result['url'] = video['url']
Result['filename'] = video['title']
return Result
print "Cannot Find this AV Number in http://porn68jav.com"
#http://highporn.net
return Result
def Get7MMVedioInfo(VedioNumber):
Result = {
"result": "FAIL",
"title": "",
"number": "",
"date": "",
"avers": "",
"video_long": "",
"maker": "",
"seller": "",
"company": "",
"img": "",
"have": "",
}
if unicode(VedioNumber) == "":
return Result
res = requests.get('http://127.0.0.1/?sw='+unicode(VedioNumber)+'&info=0&mode=0&order=0&sort=num')
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
for line in soup.head.script:
if unicode(VedioNumber).upper() in line:
print "Almost has this video in av list"
Result['have'] = "YES"
if None:
search_key = unicode(VedioNumber)
search_key = u"shkd-545"
search_key = search_key.replace(u"-", u"%20")
res = requests.get(
'http://www.dmm.co.jp/search/=/searchstr=' + search_key + '/analyze=V1EBAVcHUQA_/limit=30/n1=FgRCTw9VBA4GAVhfWkIHWw__/sort=ranking/')
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
href = soup.find('p', attrs={'class': 'tmb'}).find('a').get("href")
#print href
res = requests.get(href)
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
img = soup.find('div', attrs={'id': 'sample-video'}).find('a').get("href")
print img
tr = soup.find('table', attrs={'class': 'mg-b20'}).find_all('tr')
for tds in tr:
for td in tds.find_all('td'):
if td.get("class") is None:
print '----'+td.text+'----'
return Result
res = requests.post('https://7mm.tv/zh/searchform_search/all/index.html',
data={'search_keyword': unicode(VedioNumber), 'search_type': 'censored',
'op': 'search'})
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
topic_area = soup.find('div', attrs={'class': 'topic_area'})
topic_box = topic_area.find('div', attrs={'class': 'topic_box'})
if topic_area is not None:
if topic_box is not None:
res = requests.get(topic_box.find('a').get('href'))
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
contents_title = soup.find('div', attrs={'id': 'contents_title'})
contents_title = contents_title.find('b').text
# print contents_title
# print '----------------'
for mvinfo_dmm_A in soup.find_all('div', attrs={'class': 'mvinfo_dmm_A'}):
if mvinfo_dmm_A.find('b').text == u"番號:":
# print mvinfo_dmm_A.text.lstrip(u"番號:")
Result["number"] = mvinfo_dmm_A.text.lstrip(u"番號:")
number = mvinfo_dmm_A.text.lstrip(u"番號:")
rm_string = "[" + mvinfo_dmm_A.text.lstrip(u"番號:") + "]"
contents_title = contents_title.replace(rm_string, "")
# print contents_title
if mvinfo_dmm_A.find('b').text == u"發行日期:":
# print mvinfo_dmm_A.text.lstrip(u"發行日期:")
date = mvinfo_dmm_A.text.lstrip(u"發行日期:")
Result["date"] = mvinfo_dmm_A.text.lstrip(u"發行日期:")
if mvinfo_dmm_A.find('b').text == u"影片時長:":
# print mvinfo_dmm_A.text.lstrip(u"影片時長:")
Result["video_long"] = mvinfo_dmm_A.text.lstrip(u"影片時長:")
Result["video_long"] = Result["video_long"].split(u"(")[0]
# Result["video_long"] = mvinfo_dmm_A.text.lstrip(u"影片時長:")
if mvinfo_dmm_A.find('b').text == u"導演:":
# print mvinfo_dmm_A.text.lstrip(u"導演:")
Result["maker"] = mvinfo_dmm_A.text.lstrip(u"導演:")
if mvinfo_dmm_A.find('b').text == u"製作商:":
# print mvinfo_dmm_A.text.lstrip(u"製作商:")
Result["seller"] = mvinfo_dmm_A.text.lstrip(u"製作商:")
if mvinfo_dmm_A.find('b').text == u"發行商:":
# print mvinfo_dmm_A.text.lstrip(u"發行商:")
Result["company"] = mvinfo_dmm_A.text.lstrip(u"發行商:")
mvinfo_introduction = soup.find('div', attrs={'class': 'mvinfo_introduction'}).text
avers = ""
for av_performer_name_box in soup.find_all('div', attrs={'class': 'av_performer_name_box'}):
contents_title = contents_title.replace(av_performer_name_box.text, "")
avers += av_performer_name_box.text + ","
# print avers.strip(",")
Result["avers"] = avers.strip(",")
contents_title = contents_title.lstrip(" ")
contents_title = contents_title.lstrip(u" ")
contents_title = contents_title.strip(" ")
contents_title = contents_title.strip(u" ")
Result["title"] = contents_title
img = soup.find('img').get('src')
# print "Download from ",img,".."
urllib.urlretrieve(img, 'tmp.jpg')
Result["img"] = img
# print "JackS: ", Result
Result['result'] = "PASS"
return Result
# print Result
res = requests.post('https://7mm.tv/zh/searchform_search/all/index.html',
data={'search_keyword': unicode(VedioNumber), 'search_type': 'amateurjav',
'op': 'search'})
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
topic_area = soup.find('div', attrs={'class': 'topic_area'})
topic_box = topic_area.find('div', attrs={'class': 'topic_box'})
if topic_area is not None:
if topic_box is not None:
res = requests.get(topic_box.find('a').get('href'))
if res.status_code == requests.codes.ok:
html = res.content
soup = BeautifulSoup(html, 'html.parser')
contents_title = soup.find('div', attrs={'id': 'contents_title'})
contents_title = contents_title.find('b').text
# print contents_title
# print '----------------'
for mvinfo_dmm_A in soup.find_all('div', attrs={'class': 'mvinfo_dmm_A'}):
if mvinfo_dmm_A.find('b').text == u"番號:":
# print mvinfo_dmm_A.text.lstrip(u"番號:")
Result["number"] = mvinfo_dmm_A.text.lstrip(u"番號:")
number = mvinfo_dmm_A.text.lstrip(u"番號:")
rm_string = "[" + mvinfo_dmm_A.text.lstrip(u"番號:") + "]"
contents_title = contents_title.replace(rm_string, "")
# print contents_title
if mvinfo_dmm_A.find('b').text == u"發行日期:":
# print mvinfo_dmm_A.text.lstrip(u"發行日期:")
date = mvinfo_dmm_A.text.lstrip(u"發行日期:")
Result["date"] = mvinfo_dmm_A.text.lstrip(u"發行日期:")
if mvinfo_dmm_A.find('b').text == u"影片時長:":
# print mvinfo_dmm_A.text.lstrip(u"影片時長:")
Result["video_long"] = mvinfo_dmm_A.text.lstrip(u"影片時長:")
Result["video_long"] = Result["video_long"].split(u"(")[0]
# Result["video_long"] = mvinfo_dmm_A.text.lstrip(u"影片時長:")
if mvinfo_dmm_A.find('b').text == u"導演:":
# print mvinfo_dmm_A.text.lstrip(u"導演:")
Result["maker"] = mvinfo_dmm_A.text.lstrip(u"導演:")
if mvinfo_dmm_A.find('b').text == u"製作商:":
# print mvinfo_dmm_A.text.lstrip(u"製作商:")
Result["seller"] = mvinfo_dmm_A.text.lstrip(u"製作商:")
if mvinfo_dmm_A.find('b').text == u"發行商:":
# print mvinfo_dmm_A.text.lstrip(u"發行商:")
Result["company"] = mvinfo_dmm_A.text.lstrip(u"發行商:")
mvinfo_introduction = soup.find('div', attrs={'class': 'mvinfo_introduction'}).text
avers = ""
for av_performer_name_box in soup.find_all('div', attrs={'class': 'av_performer_name_box'}):
contents_title = contents_title.replace(av_performer_name_box.text, "")
avers += av_performer_name_box.text + ","
# print avers.strip(",")
Result["avers"] = avers.strip(",")
contents_title = contents_title.lstrip(" ")
contents_title = contents_title.lstrip(u" ")
contents_title = contents_title.strip(" ")
contents_title = contents_title.strip(u" ")
Result["title"] = contents_title
img = soup.find('img').get('src')
# print "Download from ",img,".."
urllib.urlretrieve(img, 'tmp.jpg')
Result["img"] = img
# print "JackS: ", Result
Result['result'] = "PASS"
return Result
print "Cannot Find this AV Number in https://7mm.tv"
return Result
def OnExit():
if os.path.isfile('tmp.jpg'):
os.remove('tmp.jpg')