mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-26 15:24:51 +02:00
Merge pull request #1189 from rephormat/xhamster-newurl
xHamster New URL Fix
This commit is contained in:
@@ -45,6 +45,7 @@ public class XhamsterRipper extends AbstractHTMLRipper {
|
|||||||
@Override
|
@Override
|
||||||
public URL sanitizeURL(URL url) throws MalformedURLException {
|
public URL sanitizeURL(URL url) throws MalformedURLException {
|
||||||
String URLToReturn = url.toExternalForm();
|
String URLToReturn = url.toExternalForm();
|
||||||
|
URLToReturn = URLToReturn.replaceAll("xhamster.one", "xhamster.com");
|
||||||
URLToReturn = URLToReturn.replaceAll("m.xhamster.com", "xhamster.com");
|
URLToReturn = URLToReturn.replaceAll("m.xhamster.com", "xhamster.com");
|
||||||
URLToReturn = URLToReturn.replaceAll("\\w\\w.xhamster.com", "xhamster.com");
|
URLToReturn = URLToReturn.replaceAll("\\w\\w.xhamster.com", "xhamster.com");
|
||||||
URL san_url = new URL(URLToReturn.replaceAll("xhamster.com", "m.xhamster.com"));
|
URL san_url = new URL(URLToReturn.replaceAll("xhamster.com", "m.xhamster.com"));
|
||||||
@@ -113,17 +114,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/photos/gallery/.*?(\\d+)$");
|
Pattern p = Pattern.compile("^https?://([\\w\\w]*\\.)?xhamster\\.(com|one)/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/users/([a-zA-Z0-9_-]+)/photos");
|
p = Pattern.compile("^https?://[\\w\\w.]*xhamster\\.(com|one)/users/([a-zA-Z0-9_-]+)/photos");
|
||||||
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/(movies|videos)/.*$");
|
p = Pattern.compile("^https?://.*xhamster\\.(com|one)/(movies|videos)/.*$");
|
||||||
m = p.matcher(url.toExternalForm());
|
m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user