Updated xhamster ripper to support new URL format
Fixes 4pr0n/ripme#593 Fixes ripmeapp/ripme#4
This commit is contained in:
parent
021cd031ee
commit
cfab32d271
@ -23,7 +23,7 @@ public class XhamsterRipper extends AlbumRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRip(URL url) {
|
public boolean canRip(URL url) {
|
||||||
Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/[0-9]+.*$");
|
Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/.*[0-9]+$");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
return m.matches();
|
return m.matches();
|
||||||
}
|
}
|
||||||
@ -87,14 +87,14 @@ public class XhamsterRipper extends AlbumRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern.compile("^https?://([a-z0-9.]*?)xhamster\\.com/photos/gallery/([0-9]{1,})/.*\\.html");
|
Pattern p = Pattern.compile("^https?://[wmde.]*xhamster\\.com/photos/gallery/.*?(\\d{1,})$");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(2);
|
return m.group(1);
|
||||||
}
|
}
|
||||||
throw new MalformedURLException(
|
throw new MalformedURLException(
|
||||||
"Expected xhamster.com gallery formats: "
|
"Expected xhamster.com gallery formats: "
|
||||||
+ "xhamster.com/photos/gallery/#####/xxxxx..html"
|
+ "xhamster.com/photos/gallery/xxxxx-#####"
|
||||||
+ " Got: " + url);
|
+ " Got: " + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ public class BasicRippersTest extends RippersTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testXhamsterAlbums() throws IOException {
|
public void testXhamsterAlbums() throws IOException {
|
||||||
XhamsterRipper ripper = new XhamsterRipper(new URL("http://xhamster.com/photos/gallery/1462237/alyssa_gadson.html"));
|
XhamsterRipper ripper = new XhamsterRipper(new URL("https://xhamster.com/photos/gallery/volleyball-sluts-8305007"));
|
||||||
testRipper(ripper);
|
testRipper(ripper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user