package pic;
import tool.*;
public class pro {
int s,datanumber;
String[] data=new String[60000];
String[] web=new String[60000];
String pic;
public static void main(String[] args) {
pro r=new pro();
}
pro(){
web[1]="https://e-hentai.org/s/ec511a863a/1248910-1";
int tr;
for(tr=1;tr<133;tr++){
getssl sub=new getssl();
sub.makedata(web[tr],"UTF-8");
data=sub.data;
datanumber=sub.datanumber;
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
String[] x=str.split(">");
String nn="<a id=\"next";
String link="";
for(s=0;s<x.length;s++){
if(x[s].indexOf(nn)>-1)link=x[s];
}
int p1=link.indexOf("http");
int p2=link.indexOf("\"",p1);
if(p1>-1)link=link.substring(p1,p2);
web[tr+1]=link;
}
for(tr=1;tr<134;tr++){
String m=""+tr;
if(tr<100)m="0"+tr;
if(tr<10)m="00"+tr;
getssl sub2=new getssl();
sub2.makedata(web[tr],"UTF-8");
data=sub2.data;
datanumber=sub2.datanumber;
pic("data/"+m+".jpg");
}
}
void pic(String pin){
String str="";
for(s=1;s<datanumber+1;s++){
str=str+data[s];
}
String[] x=str.split(">");
pic="";
for(s=0;s<x.length;s++){
if(x[s].indexOf("/keystamp=")>-1)pic=x[s];
}
int p1=pic.indexOf("http");
int p2=pic.indexOf("\"",p1);
if(p1>-1)pic=pic.substring(p1,p2);
dl sub2=new dl();
sub2.makedata(pic,pin);
}
}
package pic;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
public class getssl {
int s,datanumber;
String[] data=new String[5000];
void makedata(String urlx,String code){
try {
TrustManager[] tm = { new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
@Override
public void checkServerTrusted(X509Certificate[] chain,
String authType) throws CertificateException {
}
} };
SSLContext sslcontext = SSLContext.getInstance("SSL");
sslcontext.init(null, tm, null);
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname,
SSLSession session) {
return true;
}
});
URL connectUrl = new URL(urlx);
HttpsURLConnection urlconn = (HttpsURLConnection) connectUrl
.openConnection();
urlconn.setRequestMethod("GET");
urlconn.setSSLSocketFactory(sslcontext.getSocketFactory());
urlconn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5");
urlconn.connect();
BufferedReader reader = new BufferedReader(new InputStreamReader(
urlconn.getInputStream(), code));
s=0;
String line;
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) {
s=s+1;
data[s]=line;
}
datanumber=s;
reader.close();
urlconn.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
package pic;
import java.io.*;
import java.io.File;
import java.net.URL;
import java.net.URLConnection;
import java.io.File;
import java.io.*;
public class dl {
void makedata(String urlx,String filex){
try {
URL url = new URL(urlx);
URLConnection conn = url.openConnection();
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5");
InputStream in = conn.getInputStream();
File file = new File(filex);
FileOutputStream out = new FileOutputStream(file, false);
int b;
while((b = in.read()) != -1){
out.write(b);
}
out.close();
in.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
最終更新:2018年07月17日 04:19