Update alist pass json format
This commit is contained in:
parent
f4a40e92b3
commit
b1f14f0d33
|
|
@ -20,7 +20,7 @@ public class Drive {
|
||||||
@SerializedName("drives")
|
@SerializedName("drives")
|
||||||
private List<Drive> drives;
|
private List<Drive> drives;
|
||||||
@SerializedName("params")
|
@SerializedName("params")
|
||||||
private Map<String, String> params;
|
private List<Param> params;
|
||||||
@SerializedName("login")
|
@SerializedName("login")
|
||||||
private Login login;
|
private Login login;
|
||||||
@SerializedName("vodPic")
|
@SerializedName("vodPic")
|
||||||
|
|
@ -44,8 +44,8 @@ public class Drive {
|
||||||
return drives == null ? new ArrayList<>() : drives;
|
return drives == null ? new ArrayList<>() : drives;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> getParams() {
|
public List<Param> getParams() {
|
||||||
return params == null ? new HashMap<>() : params;
|
return params == null ? new ArrayList<>() : params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Login getLogin() {
|
public Login getLogin() {
|
||||||
|
|
@ -153,6 +153,11 @@ public class Drive {
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String findPass(String path) {
|
||||||
|
for (Param param : getParams()) if (path.startsWith(param.getPath())) return param.getPass();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj) return true;
|
if (this == obj) return true;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.github.catvod.bean.alist;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
public class Param {
|
||||||
|
|
||||||
|
@SerializedName("path")
|
||||||
|
private String path;
|
||||||
|
@SerializedName("pass")
|
||||||
|
private String pass;
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return TextUtils.isEmpty(path) ? "" : path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPass() {
|
||||||
|
return TextUtils.isEmpty(pass) ? "" : pass;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -166,7 +166,7 @@ public class AList extends Spider {
|
||||||
path = path.startsWith(drive.getPath()) ? path : drive.getPath() + path;
|
path = path.startsWith(drive.getPath()) ? path : drive.getPath() + path;
|
||||||
JSONObject params = new JSONObject();
|
JSONObject params = new JSONObject();
|
||||||
params.put("path", path);
|
params.put("path", path);
|
||||||
params.put("password", drive.getParams().get(path));
|
params.put("password", drive.findPass(path));
|
||||||
String response = post(drive, drive.getApi(), params.toString());
|
String response = post(drive, drive.getApi(), params.toString());
|
||||||
return Item.objectFrom(getDetailJson(drive.isNew(), response));
|
return Item.objectFrom(getDetailJson(drive.isNew(), response));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -182,7 +182,7 @@ public class AList extends Spider {
|
||||||
path = path.startsWith(drive.getPath()) ? path : drive.getPath() + path;
|
path = path.startsWith(drive.getPath()) ? path : drive.getPath() + path;
|
||||||
JSONObject params = new JSONObject();
|
JSONObject params = new JSONObject();
|
||||||
params.put("path", path);
|
params.put("path", path);
|
||||||
params.put("password", drive.getParams().get(path));
|
params.put("password", drive.findPass(path));
|
||||||
String response = post(drive, drive.listApi(), params.toString());
|
String response = post(drive, drive.listApi(), params.toString());
|
||||||
List<Item> items = Item.arrayFrom(getListJson(drive.isNew(), response));
|
List<Item> items = Item.arrayFrom(getListJson(drive.isNew(), response));
|
||||||
Iterator<Item> iterator = items.iterator();
|
Iterator<Item> iterator = items.iterator();
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
9eeae00749e17517c5041546a98418cd
|
4556ab64060bfdf40d0e6dcc0145862e
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eeae00749e17517c5041546a98418cd",
|
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4556ab64060bfdf40d0e6dcc0145862e",
|
||||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,12 @@
|
||||||
"username": "fongmi",
|
"username": "fongmi",
|
||||||
"password": "fongmi"
|
"password": "fongmi"
|
||||||
},
|
},
|
||||||
"params": {
|
"params": [
|
||||||
"/18/安齋拉拉": "1234"
|
{
|
||||||
}
|
"path": "/安齋拉拉",
|
||||||
|
"pass": "18181818"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;9eeae00749e17517c5041546a98418cd",
|
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;4556ab64060bfdf40d0e6dcc0145862e",
|
||||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue