Skip to content

Commit

Permalink
feat: alist
Browse files Browse the repository at this point in the history
  • Loading branch information
Greatwallcorner committed Jul 7, 2024
1 parent 1d42e49 commit c27acda
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 10 deletions.
Binary file modified jar/spider.jar
Binary file not shown.
49 changes: 49 additions & 0 deletions json/alist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"vodPic": "https://x.imgs.ovh/x/2023/09/05/64f680bb030b4.png",
"drives": [
{
"name": "小雅",
"server": "http://alist.xiaoya.pro"
},
{
"name": "觸光",
"server": "https://pan.ichuguang.com"
},
{
"name": "一只魚",
"server": "https://vtok.pp.ua/"
},
{
"name": "七米藍",
"server": "https://al.chirmyram.com"
},
{
"name": "神族九帝",
"server": "https://alist.shenzjd.com"
},
{
"name": "梓澪",
"server": "https://zi0.cc"
},
{
"name": "梓澪",
"server": "https://zi0.cc"
},
{
"name": "範本",
"server": "https://one.fongmi.com",
"search": true,
"hidden": false,
"login": {
"username": "fongmi",
"password": "fongmi"
},
"params": [
{
"path": "/安齋拉拉",
"pass": "18181818"
}
]
}
]
}
2 changes: 1 addition & 1 deletion json/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"searchable": "0",
"filterable": "1",
"changeable": 0,
"ext": "https://gh-proxy.com/https://raw.githubusercontent.com/FongMi/CatVodSpider/main/json/alist.json"
"ext": "./alist.json"
},
{
"key": "PanSou",
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/github/catvod/net/OkHttp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import okhttp3.*;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.time.Duration;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -112,9 +110,9 @@ public static String getLocation(Map<String, List<String>> headers) {
public static OkHttpClient.Builder getBuilder() {
return new OkHttpClient.Builder()
// .proxy(new java.net.Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost",8080)))
.addInterceptor(new OkhttpInterceptor()).dns(dns()).connectTimeout(30, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.writeTimeout(30, TimeUnit.SECONDS)
.addInterceptor(new OkhttpInterceptor()).dns(dns()).connectTimeout(3, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.writeTimeout(5, TimeUnit.SECONDS)
.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), SSLSocketClient.getX509TrustManager())
.hostnameVerifier((SSLSocketClient.getHostnameVerifier()));
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/com/github/catvod/spider/AList.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ private List<Filter> getFilter() {
}

private void fetchRule() {
SpiderDebug.log("fetch rule start");
if (drives != null && !drives.isEmpty()) return;
if (ext.startsWith("http")) {
SpiderDebug.log("request rule:" + ext);
ext = OkHttp.string(ext);
SpiderDebug.log("content: " + ext);
}
SpiderDebug.log("fetch rule resp:" + ext);
Drive drive = Drive.objectFrom(ext);
drives = drive.getDrives();
vodPic = drive.getVodPic();
Expand Down

0 comments on commit c27acda

Please sign in to comment.