1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-04-22 04:32:06 +02:00

xhamster.one domain not exists as before.

This commit is contained in:
soloturn 2024-03-20 12:33:17 +01:00
parent 404da9b5e5
commit c2d1472008
2 changed files with 10 additions and 16 deletions

View File

@ -57,17 +57,17 @@ public class XhamsterRipper extends AbstractHTMLRipper {
@Override
public String getGID(URL url) throws MalformedURLException {
Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster([^<]*)\\.(com|one|desi)/photos/gallery/.*?(\\d+)$");
Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster([^<]*)\\.(com|desi)/photos/gallery/.*?(\\d+)$");
Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) {
return m.group(4);
}
p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|one|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
return "user_" + m.group(1);
}
p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|one|desi)/(movies|videos)/(.*$)");
p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|desi)/(movies|videos)/(.*$)");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
return m.group(4);
@ -100,7 +100,7 @@ public class XhamsterRipper extends AbstractHTMLRipper {
@Override
public boolean pageContainsAlbums(URL url) {
Pattern p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|one|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
Pattern p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
Matcher m = p.matcher(url.toExternalForm());
LOGGER.info("Checking if page has albums");
LOGGER.info(m.matches());
@ -109,17 +109,17 @@ public class XhamsterRipper extends AbstractHTMLRipper {
@Override
public boolean canRip(URL url) {
Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster([^<]*)\\.(com|one|desi)/photos/gallery/.*?(\\d+)$");
Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster([^<]*)\\.(com|desi)/photos/gallery/.*?(\\d+)$");
Matcher m = p.matcher(url.toExternalForm());
if (m.matches()) {
return true;
}
p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|one|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
p = Pattern.compile("^https?://[\\w\\w.]*xhamster([^<]*)\\.(com|desi)/users/([a-zA-Z0-9_-]+)/(photos|videos)(/\\d+)?");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
return true;
}
p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|one|desi)/(movies|videos)/(.*$)");
p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|desi)/(movies|videos)/(.*$)");
m = p.matcher(url.toExternalForm());
if (m.matches()) {
return true;
@ -128,7 +128,7 @@ public class XhamsterRipper extends AbstractHTMLRipper {
}
private boolean isVideoUrl(URL url) {
Pattern p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|one|desi)/(movies|videos)/(.*$)");
Pattern p = Pattern.compile("^https?://.*xhamster([^<]*)\\.(com|desi)/(movies|videos)/(.*$)");
Matcher m = p.matcher(url.toExternalForm());
return m.matches();
}
@ -208,9 +208,9 @@ public class XhamsterRipper extends AbstractHTMLRipper {
private void downloadFile(String url) {
try {
addURLToDownload(new URL(url), getPrefix(index));
addURLToDownload(new URI(url).toURL(), getPrefix(index));
index = index + 1;
} catch (MalformedURLException e) {
} catch (MalformedURLException | URISyntaxException e) {
LOGGER.error("The url \"" + url + "\" is malformed");
}
}

View File

@ -33,12 +33,6 @@ public class XhamsterRipperTest extends RippersTest {
}
@Test
@Tag("flaky")
public void testXhamsterAlbumOneDomain() throws IOException, URISyntaxException {
XhamsterRipper ripper = new XhamsterRipper(new URI("https://xhamster.one/photos/gallery/japanese-dolls-4-asahi-mizuno-7254664").toURL());
testRipper(ripper);
}
@Test
@Tag("flaky")
public void testXhamsterAlbumDesiDomain() throws IOException, URISyntaxException {
XhamsterRipper ripper = new XhamsterRipper(new URI("https://xhamster5.desi/photos/gallery/japanese-dolls-4-asahi-mizuno-7254664").toURL());
testRipper(ripper);