mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-07 06:16:42 +02:00
xhamster.one domain not exists as before.
This commit is contained in:
@@ -57,17 +57,17 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(4);
|
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());
|
m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return "user_" + m.group(1);
|
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());
|
m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(4);
|
return m.group(4);
|
||||||
@@ -100,7 +100,7 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean pageContainsAlbums(URL url) {
|
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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
LOGGER.info("Checking if page has albums");
|
LOGGER.info("Checking if page has albums");
|
||||||
LOGGER.info(m.matches());
|
LOGGER.info(m.matches());
|
||||||
@@ -109,17 +109,17 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRip(URL url) {
|
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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return true;
|
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());
|
m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return true;
|
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());
|
m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return true;
|
return true;
|
||||||
@@ -128,7 +128,7 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isVideoUrl(URL url) {
|
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());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
return m.matches();
|
return m.matches();
|
||||||
}
|
}
|
||||||
@@ -208,9 +208,9 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
|
|
||||||
private void downloadFile(String url) {
|
private void downloadFile(String url) {
|
||||||
try {
|
try {
|
||||||
addURLToDownload(new URL(url), getPrefix(index));
|
addURLToDownload(new URI(url).toURL(), getPrefix(index));
|
||||||
index = index + 1;
|
index = index + 1;
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException | URISyntaxException e) {
|
||||||
LOGGER.error("The url \"" + url + "\" is malformed");
|
LOGGER.error("The url \"" + url + "\" is malformed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,12 +33,6 @@ public class XhamsterRipperTest extends RippersTest {
|
|||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
@Tag("flaky")
|
@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 {
|
public void testXhamsterAlbumDesiDomain() throws IOException, URISyntaxException {
|
||||||
XhamsterRipper ripper = new XhamsterRipper(new URI("https://xhamster5.desi/photos/gallery/japanese-dolls-4-asahi-mizuno-7254664").toURL());
|
XhamsterRipper ripper = new XhamsterRipper(new URI("https://xhamster5.desi/photos/gallery/japanese-dolls-4-asahi-mizuno-7254664").toURL());
|
||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
|
Reference in New Issue
Block a user