|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
|
package com.github.catvod.spider; |
|
|
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
|
import android.os.Build; |
|
|
|
|
import android.os.SystemClock; |
|
|
|
|
import android.webkit.WebView; |
|
|
|
|
import android.webkit.WebViewClient; |
|
|
|
|
@ -38,10 +39,11 @@ public class YiSo extends Spider { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String searchContent(String key, boolean quick) { |
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return ""; |
|
|
|
|
String url = "https://yiso.fun/api/search?name=" + URLEncoder.encode(key) + "&from=ali"; |
|
|
|
|
Map<String, String> result = new HashMap<>(); |
|
|
|
|
Misc.loadWebView(url, getWebViewClient(result)); |
|
|
|
|
while (!result.containsKey("json")) SystemClock.sleep(250); |
|
|
|
|
while (!result.containsKey("json")) SystemClock.sleep(50); |
|
|
|
|
String json = JsonParser.parseString(Objects.requireNonNull(result.get("json"))).getAsJsonPrimitive().getAsString(); |
|
|
|
|
return Result.string(Item.objectFrom(json).getData().getList()); |
|
|
|
|
} |
|
|
|
|
@ -50,6 +52,7 @@ public class YiSo extends Spider { |
|
|
|
|
return new WebViewClient() { |
|
|
|
|
@Override |
|
|
|
|
public void onPageFinished(WebView view, String url) { |
|
|
|
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return; |
|
|
|
|
view.evaluateJavascript("document.getElementsByTagName('pre')[0].textContent", value -> { |
|
|
|
|
if (!value.equals("null")) result.put("json", value); |
|
|
|
|
}); |
|
|
|
|
|