Add format sample
This commit is contained in:
parent
28937c6957
commit
cec0140c96
|
|
@ -392,7 +392,7 @@ public class API {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String playerContent(String[] ids) {
|
public String playerContent(String[] ids) {
|
||||||
return Result.get().url(getDownloadUrl(ids[0])).subs(getSubs(ids)).header(getHeader()).string();
|
return Result.get().url(getDownloadUrl(ids[0])).octet().subs(getSubs(ids)).header(getHeader()).string();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String playerContent(String[] ids, String flag) {
|
public String playerContent(String[] ids, String flag) {
|
||||||
|
|
@ -401,7 +401,7 @@ public class API {
|
||||||
String url = getPreviewUrl(playInfo, flag);
|
String url = getPreviewUrl(playInfo, flag);
|
||||||
List<Sub> subs = getSubs(ids);
|
List<Sub> subs = getSubs(ids);
|
||||||
subs.addAll(getSubs(playInfo));
|
subs.addAll(getSubs(playInfo));
|
||||||
return Result.get().url(url).subs(subs).header(getHeader()).string();
|
return Result.get().url(url).m3u8().subs(subs).header(getHeader()).string();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return Result.get().url("").string();
|
return Result.get().url("").string();
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,8 @@ public class Result {
|
||||||
private LinkedHashMap<String, List<Filter>> filters;
|
private LinkedHashMap<String, List<Filter>> filters;
|
||||||
@SerializedName("header")
|
@SerializedName("header")
|
||||||
private String header;
|
private String header;
|
||||||
|
@SerializedName("format")
|
||||||
|
private String format;
|
||||||
@SerializedName("url")
|
@SerializedName("url")
|
||||||
private String url;
|
private String url;
|
||||||
@SerializedName("subs")
|
@SerializedName("subs")
|
||||||
|
|
@ -129,11 +131,36 @@ public class Result {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result format(String format) {
|
||||||
|
this.format = format;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Result subs(List<Sub> subs) {
|
public Result subs(List<Sub> subs) {
|
||||||
this.subs = subs;
|
this.subs = subs;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Result dash() {
|
||||||
|
this.format = "application/dash+xml";
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result m3u8() {
|
||||||
|
this.format = "application/x-mpegURL";
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result rtsp() {
|
||||||
|
this.format = "application/x-rtsp";
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Result octet() {
|
||||||
|
this.format = "application/octet-stream";
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Result page() {
|
public Result page() {
|
||||||
return page(1, 1, 0, 1);
|
return page(1, 1, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
5293550a292d61fd7318571385c4fc11
|
f7dbc2384bc488cf422fb91bbb2e56ec
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue