Clean code
This commit is contained in:
parent
bbdb61bc5b
commit
54a97f8c68
|
|
@ -11,7 +11,6 @@ android {
|
||||||
minSdk 17
|
minSdk 17
|
||||||
targetSdk 28
|
targetSdk 28
|
||||||
buildConfigField("String", "CLIENT_ID", "\"${clientId}\"")
|
buildConfigField("String", "CLIENT_ID", "\"${clientId}\"")
|
||||||
multiDexEnabled true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
@ -31,11 +30,17 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations.configureEach {
|
||||||
|
resolutionStrategy {
|
||||||
|
force 'com.squareup.okhttp3:okhttp:3.12.13'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation('com.github.thegrizzlylabs:sardine-android:0.8') { exclude group: 'com.squareup.okhttp3', module: 'okhttp' }
|
|
||||||
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
|
implementation 'com.googlecode.juniversalchardet:juniversalchardet:1.0.3'
|
||||||
|
implementation 'com.github.thegrizzlylabs:sardine-android:0.8'
|
||||||
implementation 'wang.harlon.quickjs:wrapper-android:0.21.1'
|
implementation 'wang.harlon.quickjs:wrapper-android:0.21.1'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
|
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,9 @@
|
||||||
-keep class okio.** { *; }
|
-keep class okio.** { *; }
|
||||||
-keep class okhttp3.** { *; }
|
-keep class okhttp3.** { *; }
|
||||||
|
|
||||||
|
# QuickJS
|
||||||
|
-keep class com.whl.quickjs.** { *; }
|
||||||
|
|
||||||
# Sardine
|
# Sardine
|
||||||
-keep class com.thegrizzlylabs.sardineandroid.** { *; }
|
-keep class com.thegrizzlylabs.sardineandroid.** { *; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,7 @@ public class Duanju extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) throws Exception {
|
public void init(Context context, String extend) throws Exception {
|
||||||
super.init(context, extend);
|
if (!extend.isEmpty()) siteUrl = extend;
|
||||||
if (!extend.isEmpty()) {
|
|
||||||
siteUrl = extend;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -85,7 +82,7 @@ public class Duanju extends Spider {
|
||||||
public String detailContent(List<String> ids) throws Exception {
|
public String detailContent(List<String> ids) throws Exception {
|
||||||
Document doc = Jsoup.parse(OkHttp.string(ids.get(0), getHeader()));
|
Document doc = Jsoup.parse(OkHttp.string(ids.get(0), getHeader()));
|
||||||
Elements circuits = doc.select(".module-tab-item.tab-item");
|
Elements circuits = doc.select(".module-tab-item.tab-item");
|
||||||
Elements sources = doc.select("[class=scroll-content]");
|
Elements sources = doc.select("[class=scroll-content]");
|
||||||
StringBuilder vod_play_url = new StringBuilder();
|
StringBuilder vod_play_url = new StringBuilder();
|
||||||
StringBuilder vod_play_from = new StringBuilder();
|
StringBuilder vod_play_from = new StringBuilder();
|
||||||
for (int i = 0; i < sources.size(); i++) {
|
for (int i = 0; i < sources.size(); i++) {
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,7 @@ public class Kanqiu extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) throws Exception {
|
public void init(Context context, String extend) throws Exception {
|
||||||
super.init(context, extend);
|
if (!extend.isEmpty()) siteUrl = extend;
|
||||||
if (!extend.isEmpty()) {
|
|
||||||
siteUrl = extend;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public class Wogg extends Ali {
|
||||||
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
private final Pattern regexCategory = Pattern.compile("/vodtype/(\\w+).html");
|
||||||
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
private final Pattern regexPageTotal = Pattern.compile("\\$\\(\"\\.mac_total\"\\)\\.text\\('(\\d+)'\\);");
|
||||||
|
|
||||||
private JsonObject extend;
|
private JsonObject ext;
|
||||||
|
|
||||||
private Map<String, String> getHeader() {
|
private Map<String, String> getHeader() {
|
||||||
Map<String, String> header = new HashMap<>();
|
Map<String, String> header = new HashMap<>();
|
||||||
|
|
@ -42,14 +42,14 @@ public class Wogg extends Ali {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context, String extend) {
|
public void init(Context context, String extend) {
|
||||||
this.extend = JsonParser.parseString(extend).getAsJsonObject();
|
ext = JsonParser.parseString(extend).getAsJsonObject();
|
||||||
super.init(context, this.extend.get("token").getAsString());
|
super.init(context, ext.has("token") ? ext.get("token").getAsString() : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String homeContent(boolean filter) {
|
public String homeContent(boolean filter) {
|
||||||
List<Class> classes = new ArrayList<>();
|
List<Class> classes = new ArrayList<>();
|
||||||
String url = extend.has("filter") ? extend.get("filter").getAsString() : "";
|
String url = ext.has("filter") ? ext.get("filter").getAsString() : "";
|
||||||
Document doc = Jsoup.parse(OkHttp.string(client(), siteUrl, getHeader()));
|
Document doc = Jsoup.parse(OkHttp.string(client(), siteUrl, getHeader()));
|
||||||
Elements elements = doc.select(".nav-link");
|
Elements elements = doc.select(".nav-link");
|
||||||
for (Element e : elements) {
|
for (Element e : elements) {
|
||||||
|
|
@ -105,8 +105,8 @@ public class Wogg extends Ali {
|
||||||
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
List<String> shareLinks = doc.select(".module-row-text").eachAttr("data-clipboard-text");
|
||||||
for (int i = 0; i < shareLinks.size(); i++) shareLinks.set(i, shareLinks.get(i).trim());
|
for (int i = 0; i < shareLinks.size(); i++) shareLinks.set(i, shareLinks.get(i).trim());
|
||||||
|
|
||||||
item.setVodPlayFrom(super.detailContentVodPlayFrom(shareLinks));
|
item.setVodPlayFrom(detailContentVodPlayFrom(shareLinks));
|
||||||
item.setVodPlayUrl(super.detailContentVodPlayUrl(shareLinks));
|
item.setVodPlayUrl(detailContentVodPlayUrl(shareLinks));
|
||||||
|
|
||||||
Elements elements = doc.select(".video-info-item");
|
Elements elements = doc.select(".video-info-item");
|
||||||
for (Element e : elements) {
|
for (Element e : elements) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
a1 64 e2 fb 55 14 55 1f 7a bb f2 0e 0f 02 f4 92
|
104fe5b844fc2bf63f2082c5a9b8b4aa
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue