Fix bug
This commit is contained in:
parent
1d6e4aca63
commit
0ea8f7ca75
|
|
@ -1,6 +1,7 @@
|
||||||
package com.github.catvod.spider;
|
package com.github.catvod.spider;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
import com.github.catvod.bean.Class;
|
import com.github.catvod.bean.Class;
|
||||||
|
|
@ -63,20 +64,34 @@ public class Local extends Spider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String detailContent(List<String> ids) {
|
public String detailContent(List<String> ids) {
|
||||||
File file = new File(ids.get(0));
|
String url = ids.get(0);
|
||||||
Vod vod = new Vod();
|
if (url.startsWith("http")) {
|
||||||
vod.setTypeName("FongMi");
|
String name = Uri.parse(url).getLastPathSegment();
|
||||||
vod.setVodId(file.getAbsolutePath());
|
return Result.string(create(name, url));
|
||||||
vod.setVodName(file.getName());
|
} else {
|
||||||
vod.setVodPic(Image.VIDEO);
|
File file = new File(ids.get(0));
|
||||||
vod.setVodPlayFrom("播放");
|
return Result.string(create(file.getName(), file.getAbsolutePath()));
|
||||||
vod.setVodPlayUrl(file.getName() + "$" + file.getAbsolutePath());
|
}
|
||||||
return Result.string(vod);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
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 Result.get().url("file://" + id).subs(getSubs(id)).string();
|
if (id.startsWith("http")) {
|
||||||
|
return Result.get().url(id).string();
|
||||||
|
} else {
|
||||||
|
return Result.get().url("file://" + id).subs(getSubs(id)).string();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Vod create(String name, String url) {
|
||||||
|
Vod vod = new Vod();
|
||||||
|
vod.setTypeName("FongMi");
|
||||||
|
vod.setVodId(url);
|
||||||
|
vod.setVodName(name);
|
||||||
|
vod.setVodPic(Image.VIDEO);
|
||||||
|
vod.setVodPlayFrom("播放");
|
||||||
|
vod.setVodPlayUrl(name + "$" + url);
|
||||||
|
return vod;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Vod create(File file) {
|
private Vod create(File file) {
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
28add647ed5a1ba17dad2874d0aa37fa
|
9cc15b83a755468e6b725667ef362a04
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue