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

Commit

Permalink
Speed up the extract of 91porn videos in mainland China
Browse files Browse the repository at this point in the history
  • Loading branch information
grandiloquent authored and grandiloquent committed Nov 10, 2021
1 parent ac2af99 commit fc2f284
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.widget.Toast;

import euphoria.psycho.share.KeyShare;
import euphoria.psycho.share.PreferenceShare;
import euphoria.psycho.share.StringShare;
import euphoria.psycho.share.WebViewShare;
import euphoria.psycho.tasks.HLSDownloadActivity;
Expand Down Expand Up @@ -67,7 +68,8 @@ public void download(String uri) {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
String videoUri;
if (uri.contains("91porn.com")) {
videoUri = Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"),true);
videoUri = Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"), PreferenceShare.getPreferences()
.getBoolean("in_china",false));
} else if (uri.contains("xvideos.com")) {
videoUri = Native.fetchXVideos(uri);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private void initialize() {
loadStartPage(this, mWebView);
checkUnfinishedVideoTasks(this);
checkUpdate();

// tryPlayVideo(this);
}

Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/euphoria/psycho/explorer/WebActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import androidx.annotation.Nullable;
import euphoria.psycho.share.KeyShare;
import euphoria.psycho.share.PreferenceShare;
import euphoria.psycho.share.StringShare;
import euphoria.psycho.share.WebViewShare;
import euphoria.psycho.tasks.HLSDownloadActivity;
Expand Down Expand Up @@ -142,7 +143,8 @@ public void parse(String uri) {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
String videoUri;
if (uri.contains("91porn.com")) {
videoUri = Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"),true);
videoUri = Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"), PreferenceShare.getPreferences()
.getBoolean("in_china",false));
} else if (uri.contains("xvideos.com")) {
videoUri = Native.fetchXVideos(uri);
} else {
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/euphoria/psycho/videos/Porn91.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import euphoria.psycho.explorer.MainActivity;
import euphoria.psycho.explorer.Native;
import euphoria.psycho.explorer.WebActivity;
import euphoria.psycho.share.PreferenceShare;
import euphoria.psycho.share.StringShare;
import euphoria.psycho.tasks.HLSDownloadActivity;
import euphoria.psycho.tasks.HLSDownloadService;
Expand All @@ -38,7 +39,8 @@ public void fetchVideoList(String uri) {
videoList.add(matcher.group());
}
startVideoService(mMainActivity, videoList.parallelStream()
.map(v -> Native.fetch91Porn(StringShare.substringAfter(v, "91porn.com"),true))
.map(v -> Native.fetch91Porn(StringShare.substringAfter(v, "91porn.com"), PreferenceShare.getPreferences()
.getBoolean("in_china",false)))
.collect(Collectors.toList()));
}).start();

Expand All @@ -65,7 +67,8 @@ static void startVideoService(MainActivity mainActivity, List<String> videoList)
//
@Override
protected String fetchVideoUri(String uri) {
return Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"),true);
return Native.fetch91Porn(StringShare.substringAfter(uri, "91porn.com"),PreferenceShare.getPreferences()
.getBoolean("in_china",false));
}

@Override
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
android:key="key_tencent"
android:summary="设置用于下载腾讯会员视频的Cookie"
android:title="设置腾讯视频会员信息" />
<CheckBoxPreference
android:defaultValue="true"
android:key="in_china"
android:title="是否为中国大陆用户" />
</PreferenceScreen>

0 comments on commit fc2f284

Please sign in to comment.