Removed unused class

This commit is contained in:
litetex 2022-03-26 19:17:46 +01:00
parent 8771af7ba5
commit ec5b54c38b
1 changed files with 0 additions and 44 deletions

View File

@ -1,44 +0,0 @@
package org.schabi.newpipe.extractor.utils;
import java.net.MalformedURLException;
/**
* Note: this class seems unused? Should it be removed?
*/
public final class DonationLinkHelper {
public enum DonationService {
NO_DONATION,
PATREON,
PAYPAL,
}
public enum AffiliateService {
NO_AFFILIATE,
AMAZON,
}
private DonationLinkHelper() {
}
public static DonationService getDonationServiceByLink(final String link)
throws MalformedURLException {
switch (Utils.stringToURL(link).getHost()) {
case "www.patreon.com":
case "patreon.com":
return DonationService.PATREON;
case "www.paypal.me":
case "paypal.me":
return DonationService.PAYPAL;
default:
return DonationService.NO_DONATION;
}
}
public static AffiliateService getAffiliateServiceByLink(final String link)
throws MalformedURLException {
if ("amzn.to".equals(Utils.stringToURL(link).getHost())) {
return AffiliateService.AMAZON;
}
return AffiliateService.NO_AFFILIATE;
}
}