Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Commit

Permalink
修复无法解析91PORN的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
grandiloquent authored and grandiloquent committed Nov 23, 2021
1 parent 099b3fe commit c641439
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions app/src/main/java/euphoria/psycho/explorer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Process;
Expand All @@ -13,8 +14,8 @@
import euphoria.psycho.downloader.DownloaderService;
import euphoria.psycho.downloader.DownloaderTask;
import euphoria.psycho.share.PreferenceShare;
import euphoria.psycho.share.StringShare;
import euphoria.psycho.videos.Ck52;
import euphoria.psycho.videos.Porn91;
import euphoria.psycho.videos.PornHub;
import euphoria.psycho.videos.PornOne;
import euphoria.psycho.videos.XiGua;
Expand Down Expand Up @@ -154,7 +155,13 @@ public void onVideoUrl(String uri) {

@Override
public boolean shouldOverrideUrlLoading(String uri) {
if (Porn91.handle(uri, this)) {
if (StringShare.matchOne(new String[]{
"/vodplay/[\\d-]+\\.html",
"https://91porn.com/view_video.php",
}, uri)) {
Intent starter = new Intent(this, WebActivity.class);
starter.putExtra("extra.URI", uri);
startActivity(starter);
return true;
}
if (YouTube.handle(uri, this)) {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/euphoria/psycho/videos/Porn91.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class Porn91 extends BaseExtractor<String[]> {
public Porn91(String inputUri, MainActivity mainActivity) {
super(inputUri, mainActivity);
}

// public void fetchVideoList(String uri) {
// new Thread(() -> {
// String response = getString(uri, null);
Expand Down Expand Up @@ -68,7 +67,7 @@ protected String[] fetchVideoUri(String uri) {

@Override
protected void processVideo(String[] videoUris) {
if (videoUris.length > 0) {
if (videoUris.length < 2) {
Toast.makeText(mMainActivity, "无法解析视频", Toast.LENGTH_LONG).show();
return;
}
Expand Down

0 comments on commit c641439

Please sign in to comment.