1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-13 17:34:13 +02:00

luscios, old --> legacy.

fixes https://github.com/RipMeApp/ripme/issues/1924, but the
unit tests still fail, so the ripper most likely is not fixed.
This commit is contained in:
soloturn
2021-12-30 00:36:19 +01:00
parent d1e1ff9302
commit ae73b7348b

View File

@@ -19,7 +19,7 @@ import com.rarchives.ripme.utils.Http;
public class LusciousRipper extends AbstractHTMLRipper { public class LusciousRipper extends AbstractHTMLRipper {
private static final int RETRY_COUNT = 5; // Keeping it high for read timeout exception. private static final int RETRY_COUNT = 5; // Keeping it high for read timeout exception.
private static final Pattern P = Pattern.compile("^https?:\\/\\/(?:members\\.|old\\.|www\\.)?luscious.net\\/albums\\/([-_.0-9a-zA-Z]+)\\/?"); private static final Pattern P = Pattern.compile("^https?:\\/\\/(?:members\\.|legacy\\.|www\\.)?luscious.net\\/albums\\/([-_.0-9a-zA-Z]+)\\/?");
private DownloadThreadPool lusciousThreadPool = new DownloadThreadPool("lusciousThreadPool"); private DownloadThreadPool lusciousThreadPool = new DownloadThreadPool("lusciousThreadPool");
public LusciousRipper(URL url) throws IOException { public LusciousRipper(URL url) throws IOException {
@@ -89,15 +89,15 @@ public class LusciousRipper extends AbstractHTMLRipper {
@Override @Override
public URL sanitizeURL(URL url) throws MalformedURLException { public URL sanitizeURL(URL url) throws MalformedURLException {
// Sanitizes the url removing GET parameters and convert to old api url. // Sanitizes the url removing GET parameters and convert to legacy api url.
// "https://old.luscious.net/albums/albumname" // "https://legacy.luscious.net/albums/albumname"
try { try {
Matcher m = P.matcher(url.toString()); Matcher m = P.matcher(url.toString());
if (m.matches()) { if (m.matches()) {
String sanitizedUrl = m.group(); String sanitizedUrl = m.group();
sanitizedUrl = sanitizedUrl.replaceFirst( sanitizedUrl = sanitizedUrl.replaceFirst(
"^https?:\\/\\/(?:members\\.|old\\.|www\\.)?luscious.net", "^https?:\\/\\/(?:members\\.|legacy\\.|www\\.)?luscious.net",
"https://old.luscious.net"); "https://legacy.luscious.net");
return new URL(sanitizedUrl); return new URL(sanitizedUrl);
} }
@@ -113,7 +113,7 @@ public class LusciousRipper extends AbstractHTMLRipper {
public String normalizeUrl(String url) { public String normalizeUrl(String url) {
try { try {
return url.toString().replaceFirst( return url.toString().replaceFirst(
"^https?:\\/\\/(?:members\\.|old\\.)?luscious.net", "https://www.luscious.net"); "^https?:\\/\\/(?:members\\.|legacy\\.)?luscious.net", "https://www.luscious.net");
} catch (Exception e) { } catch (Exception e) {
LOGGER.info("Error normalizing the url."); LOGGER.info("Error normalizing the url.");
LOGGER.error(e); LOGGER.error(e);