Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
ac06eaf09c
|
|
@ -2,6 +2,6 @@
|
||||||
.idea
|
.idea
|
||||||
*build
|
*build
|
||||||
*.jks
|
*.jks
|
||||||
*i.java
|
*ni.java
|
||||||
*r.java
|
*ar.java
|
||||||
/local.properties
|
/local.properties
|
||||||
|
|
@ -40,6 +40,7 @@ dependencies {
|
||||||
implementation('com.github.thegrizzlylabs:sardine-android:0.8') { exclude group: 'com.squareup.okhttp3', module: 'okhttp' }
|
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.squareup.okhttp3:okhttp:3.12.13') { force = true }
|
implementation('com.squareup.okhttp3:okhttp:3.12.13') { force = true }
|
||||||
|
implementation 'wang.harlon.quickjs:wrapper-android:0.20.2'
|
||||||
implementation 'com.google.net.cronet:cronet-okhttp:0.1.0'
|
implementation 'com.google.net.cronet:cronet-okhttp:0.1.0'
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
implementation 'cn.wanghaomiao:JsoupXpath:2.5.1'
|
implementation 'cn.wanghaomiao:JsoupXpath:2.5.1'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.github.catvod">
|
package="com.github.catvod">
|
||||||
|
|
||||||
|
<uses-sdk tools:overrideLibrary="com.whl.quickjs.android" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|
@ -10,8 +13,9 @@
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:usesCleartextTraffic="true">
|
android:usesCleartextTraffic="true">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".demo.MainActivity"
|
android:name=".debug.MainActivity"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
|
||||||
|
|
@ -34,15 +34,22 @@ public abstract class Spider {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String searchContent(String key, boolean quick, String pg) throws Exception {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
public String playerContent(String flag, String id, List<String> vipFlags) throws Exception {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean manualVideoCheck() {
|
public boolean manualVideoCheck() throws Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVideoFormat(String url) {
|
public boolean isVideoFormat(String url) throws Exception {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void destroy() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.catvod.demo;
|
package com.github.catvod.debug;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.github.catvod.js;
|
||||||
|
|
||||||
|
import com.whl.quickjs.android.QuickJSLoader;
|
||||||
|
|
||||||
|
public class JSLoader {
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
try {
|
||||||
|
QuickJSLoader.init();
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.github.catvod.js;
|
||||||
|
|
||||||
|
public class Method {
|
||||||
|
}
|
||||||
|
|
@ -210,7 +210,7 @@ public class Bili extends Spider {
|
||||||
|
|
||||||
String mpd = getMpd(dash, videoList.toString(), audioList.toString());
|
String mpd = getMpd(dash, videoList.toString(), audioList.toString());
|
||||||
String url = "data:application/dash+xml;base64," + Base64.encodeToString(mpd.getBytes(), 0);
|
String url = "data:application/dash+xml;base64," + Base64.encodeToString(mpd.getBytes(), 0);
|
||||||
return Result.get().url(url).header(getMember()).string();
|
return Result.get().url(url).dash().header(getMember()).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getMedia(Media media) {
|
private String getMedia(Media media) {
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
||||||
import com.github.catvod.crawler.SpiderDebug;
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
|
import com.github.catvod.js.JSLoader;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -39,6 +40,7 @@ public class Init {
|
||||||
public static void init(Context context) {
|
public static void init(Context context) {
|
||||||
get().app = ((Application) context);
|
get().app = ((Application) context);
|
||||||
SpiderDebug.log("自定義爬蟲代碼載入成功!");
|
SpiderDebug.log("自定義爬蟲代碼載入成功!");
|
||||||
|
JSLoader.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void execute(Runnable runnable) {
|
public static void execute(Runnable runnable) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.github.catvod.crawler.Spider;
|
||||||
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
|
import com.whl.quickjs.wrapper.QuickJSContext;
|
||||||
|
|
||||||
|
public class JSDemo extends Spider {
|
||||||
|
|
||||||
|
private QuickJSContext jsContext;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(Context context, String extend) {
|
||||||
|
jsContext = QuickJSContext.create();
|
||||||
|
jsContext.evaluate("var text = 'Hello QuickJS';");
|
||||||
|
String text = jsContext.getGlobalObject().getString("text");
|
||||||
|
SpiderDebug.log(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void destroy() {
|
||||||
|
super.destroy();
|
||||||
|
jsContext.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -32,12 +32,7 @@ public class XPath extends Spider {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Context context) {
|
|
||||||
super.init(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(Context context, String extend) {
|
public void init(Context context, String extend) {
|
||||||
super.init(context, extend);
|
|
||||||
this.ext = extend;
|
this.ext = extend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
d4dab21a9595058b00f4ad2ce977baf4
|
bdaba6bfae7ce2c142343af8e9731c4d
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d4dab21a9595058b00f4ad2ce977baf4",
|
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
|
||||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d4dab21a9595058b00f4ad2ce977baf4",
|
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;bdaba6bfae7ce2c142343af8e9731c4d",
|
||||||
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue