Update gradle
This commit is contained in:
parent
b9ca8ddbd3
commit
715707d1ed
|
|
@ -4,12 +4,12 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk 32
|
compileSdk 33
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.github.catvod.demo"
|
applicationId "com.github.catvod.demo"
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 32
|
targetSdk 33
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ public class Result {
|
||||||
private String header;
|
private String header;
|
||||||
@SerializedName("url")
|
@SerializedName("url")
|
||||||
private String url;
|
private String url;
|
||||||
|
@SerializedName("sub")
|
||||||
|
private String sub;
|
||||||
@SerializedName("parse")
|
@SerializedName("parse")
|
||||||
private int parse;
|
private int parse;
|
||||||
@SerializedName("jx")
|
@SerializedName("jx")
|
||||||
|
|
@ -111,6 +113,11 @@ public class Result {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result sub(String sub) {
|
||||||
|
this.sub = sub;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Vod> getList() {
|
public List<Vod> getList() {
|
||||||
return list == null ? Collections.emptyList() : list;
|
return list == null ? Collections.emptyList() : list;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ public class OkHttpUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String stringNoRedirect(String url, Map<String, String> headerMap, Map<String, List<String>> respHeaderMap) {
|
||||||
|
return string(new OkHttpClient.Builder().dns(safeDns()).readTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS).writeTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS).connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS).followRedirects(false).followSslRedirects(false).retryOnConnectionFailure(true).sslSocketFactory(new SSLSocketFactoryCompat(SSLSocketFactoryCompat.trustAllCert), SSLSocketFactoryCompat.trustAllCert).build(), url, null, null, headerMap, respHeaderMap, OkHttpUtil.METHOD_GET);
|
||||||
|
}
|
||||||
|
|
||||||
public static String string(OkHttpClient client, String url, String tag, Map<String, String> paramsMap, Map<String, String> headerMap, Map<String, List<String>> respHeaderMap, String httpMethod) {
|
public static String string(OkHttpClient client, String url, String tag, Map<String, String> paramsMap, Map<String, String> headerMap, Map<String, List<String>> respHeaderMap, String httpMethod) {
|
||||||
OKCallBack.OKCallBackString callback = new OKCallBack.OKCallBackString() {
|
OKCallBack.OKCallBackString callback = new OKCallBack.OKCallBackString() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ public class Bili extends Spider {
|
||||||
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
String duration = extend.containsKey("duration") ? extend.get("duration") : "0";
|
||||||
String url = "https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=" + URLEncoder.encode(tid) + "&duration=" + duration + "&page=" + pg;
|
String url = "https://api.bilibili.com/x/web-interface/search/type?search_type=video&keyword=" + URLEncoder.encode(tid) + "&duration=" + duration + "&page=" + pg;
|
||||||
JSONObject resp = new JSONObject(OkHttpUtil.string(url, header));
|
JSONObject resp = new JSONObject(OkHttpUtil.string(url, header));
|
||||||
System.out.println(resp.toString());
|
|
||||||
JSONArray result = resp.getJSONObject("data").getJSONArray("result");
|
JSONArray result = resp.getJSONObject("data").getJSONArray("result");
|
||||||
List<Vod> list = new ArrayList<>();
|
List<Vod> list = new ArrayList<>();
|
||||||
for (int i = 0; i < result.length(); ++i) {
|
for (int i = 0; i < result.length(); ++i) {
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,18 @@ public class Misc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String substring(String text) {
|
||||||
|
return substring(text, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String substring(String text, int num) {
|
||||||
|
if (text != null && text.length() > num) {
|
||||||
|
return text.substring(0, text.length() - num);
|
||||||
|
} else {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String MD5(String src) {
|
public static String MD5(String src) {
|
||||||
return MD5(src, StandardCharsets.UTF_8);
|
return MD5(src, StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
plugins {
|
plugins {
|
||||||
id 'ru.cleverpumpkin.proguard-dictionaries-generator' version '1.0.8' apply false
|
id 'ru.cleverpumpkin.proguard-dictionaries-generator' version '1.0.8' apply false
|
||||||
id 'com.android.application' version '7.2.1' apply false
|
id 'com.android.application' version '7.3.0' apply false
|
||||||
id 'com.android.library' version '7.2.1' apply false
|
id 'com.android.library' version '7.3.0' apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#Mon Aug 22 15:05:50 CST 2022
|
#Mon Aug 22 15:05:50 CST 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
82496ffaa62feaa12a8318e606513308
|
cbcd16258af92a42a19ca6897b7af950
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue