Merge branch 'main' of https://github.com/FongMi/CatVodSpider
This commit is contained in:
commit
ff7b6f8ea6
|
|
@ -2,6 +2,7 @@ package com.github.catvod.net;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.github.catvod.crawler.SpiderDebug;
|
||||||
import com.github.catvod.utils.Utils;
|
import com.github.catvod.utils.Utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -76,8 +77,12 @@ class OkRequest {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
if (respHeader != null) respHeader.clear();
|
if (respHeader != null) respHeader.clear();
|
||||||
if (respHeader != null) respHeader.putAll(response.headers().toMultimap());
|
if (respHeader != null) respHeader.putAll(response.headers().toMultimap());
|
||||||
return new OkResult(response.code(), response.body().string());
|
int code = response.code();
|
||||||
|
String body = response.body().string();
|
||||||
|
SpiderDebug.log(code + "," + body);
|
||||||
|
return new OkResult(code, body);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
SpiderDebug.log(e);
|
||||||
return new OkResult();
|
return new OkResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ public class Dm84 extends Spider {
|
||||||
private HashMap<String, String> getHeaders() {
|
private HashMap<String, String> getHeaders() {
|
||||||
HashMap<String, String> headers = new HashMap<>();
|
HashMap<String, String> headers = new HashMap<>();
|
||||||
headers.put("User-Agent", Utils.CHROME);
|
headers.put("User-Agent", Utils.CHROME);
|
||||||
|
headers.put("Accept", Utils.ACCEPT);
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
|
|
||||||
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36";
|
public static final String CHROME = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36";
|
||||||
|
public static final String ACCEPT = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7";
|
||||||
public static final List<String> MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "mp3", "aac", "flac", "m4a", "ape", "ogg");
|
public static final List<String> MEDIA = Arrays.asList("mp4", "mkv", "wmv", "flv", "avi", "mp3", "aac", "flac", "m4a", "ape", "ogg");
|
||||||
public static final Pattern RULE = Pattern.compile(
|
public static final Pattern RULE = Pattern.compile(
|
||||||
"http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|" +
|
"http((?!http).){12,}?\\.(m3u8|mp4|flv|avi|mkv|rm|wmv|mpg|m4a|mp3)\\?.*|" +
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
8f735b6bf0cda5984e8ec2c184fa9cd0
|
9a8ad560e957f4016cf6553605039491
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8f735b6bf0cda5984e8ec2c184fa9cd0",
|
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9a8ad560e957f4016cf6553605039491",
|
||||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;8f735b6bf0cda5984e8ec2c184fa9cd0",
|
"spider": "https://fongmi.cachefly.net/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9a8ad560e957f4016cf6553605039491",
|
||||||
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
"wallpaper": "http://饭太硬.top/深色壁纸/api.php",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue