Fix bug
This commit is contained in:
parent
44eb250566
commit
8072401731
|
|
@ -58,7 +58,7 @@ public class OkHttp {
|
|||
}
|
||||
|
||||
public static String string(OkHttpClient client, String url, Map<String, String> params, Map<String, String> header) {
|
||||
return new OkRequest(GET, url, params, header).execute(client).getBody();
|
||||
return url.startsWith("http") ? new OkRequest(GET, url, params, header).execute(client).getBody() : "";
|
||||
}
|
||||
|
||||
public static String post(String url, Map<String, String> params) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@ package com.github.catvod.utils;
|
|||
|
||||
import com.github.catvod.spider.Init;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class FileUtil {
|
||||
|
||||
|
|
@ -56,13 +55,12 @@ public class FileUtil {
|
|||
|
||||
public static String read(InputStream is) {
|
||||
try {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(is));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String text;
|
||||
while ((text = br.readLine()) != null) sb.append(text).append("\n");
|
||||
br.close();
|
||||
return Utils.substring(sb.toString());
|
||||
} catch (Exception e) {
|
||||
byte[] data = new byte[is.available()];
|
||||
is.read(data);
|
||||
is.close();
|
||||
return new String(data, "UTF-8");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
f4bb4cabaaac07b29a5b1a705a76ce33
|
||||
6aa99ddfd99dd2e5b68615edd29ddb43
|
||||
|
|
|
|||
Loading…
Reference in New Issue