- PornHubCom: fixed cookie login which failed as website is using .org domain while plugin is using .com domain by default; normal login is working fine for me

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@48890 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: 24a8157d6dbf746e3b278e9093fe43afe31f966a
This commit is contained in:
psp 2024-04-10 14:11:36 +00:00
parent 3e791f5fad
commit f6b29bd954

View File

@ -1127,7 +1127,7 @@ public class PornHubCom extends PluginForHost {
if ((freeCookies != null && premiumCookies != null) || userCookies != null) {
/* Check cookies - only perform a full login if they're not valid anymore. */
if (userCookies != null) {
br.setCookies(userCookies);
this.setCookies(br, userCookies);
} else {
br.setCookies(freeCookieDomain, freeCookies);
br.setCookies(preferredLoginPremiumDomain, premiumCookies);
@ -1275,6 +1275,17 @@ public class PornHubCom extends PluginForHost {
}
}
/** Sets given cookies on all domains we know. */
private void setCookies(final Browser br, final Cookies cookies) {
final List<String> domains = new ArrayList<String>();
domains.addAll(Arrays.asList(domainsFree));
domains.addAll(Arrays.asList(domainsPremium));
br.setCookies(cookies);
for (final String domain : domains) {
br.setCookies(domain, cookies);
}
}
private boolean isAccountAgeVerificationRequired(final Browser br, final Account account) {
final String[] errorMessages = new String[] { "Please verify your age to access Pornhub Premium", "Bitte überprüfen Sie Ihr Alter, um auf Pornhub Premium zugreifen zu können", "Veuillez vérifier votre âge pour accéder à Pornhub Premium" };
for (final String errorMessage : errorMessages) {