|
|
|
|
@ -37,8 +37,6 @@ import java.util.concurrent.Executors; |
|
|
|
|
import java.util.concurrent.Future; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
import okhttp3.Response; |
|
|
|
|
|
|
|
|
|
public class SiteViewModel extends ViewModel { |
|
|
|
|
|
|
|
|
|
public MutableLiveData<Episode> episode; |
|
|
|
|
@ -229,11 +227,8 @@ public class SiteViewModel extends ViewModel { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String fetchExt(Site site) throws IOException { |
|
|
|
|
if (!site.getExt().startsWith("http")) return site.getExt(); |
|
|
|
|
Response res = OkHttp.newCall(site.getExt()).execute(); |
|
|
|
|
if (res.code() != 200) return ""; |
|
|
|
|
site.setExt(res.body().string()); |
|
|
|
|
return site.getExt(); |
|
|
|
|
if (!site.getExt().contains("127.0.0.1")) return site.getExt(); |
|
|
|
|
return OkHttp.newCall(site.getExt()).execute().body().string(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Result fetchPic(Site site, Result result) throws Exception { |
|
|
|
|
|