Fixes RipMeApp/ripme#57
This commit is contained in:
parent
a1ed774550
commit
c5f6367fe6
@ -27,7 +27,7 @@ public class XhamsterRipper extends VideoRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canRip(URL url) {
|
public boolean canRip(URL url) {
|
||||||
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/movies/[0-9]+.*$");
|
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
return m.matches();
|
return m.matches();
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ public class XhamsterRipper extends VideoRipper {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGID(URL url) throws MalformedURLException {
|
public String getGID(URL url) throws MalformedURLException {
|
||||||
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/movies/([0-9]+).*$");
|
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$");
|
||||||
Matcher m = p.matcher(url.toExternalForm());
|
Matcher m = p.matcher(url.toExternalForm());
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
return m.group(1);
|
return m.group(1);
|
||||||
@ -47,7 +47,8 @@ public class XhamsterRipper extends VideoRipper {
|
|||||||
|
|
||||||
throw new MalformedURLException(
|
throw new MalformedURLException(
|
||||||
"Expected xhamster format:"
|
"Expected xhamster format:"
|
||||||
+ "xhamster.com/movies/####"
|
+ "xhamster.com/movies/#### or"
|
||||||
|
+ "xhamster.com/videos/####"
|
||||||
+ " Got: " + url);
|
+ " Got: " + url);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,4 +64,4 @@ public class XhamsterRipper extends VideoRipper {
|
|||||||
addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url));
|
addURLToDownload(new URL(vidUrl), HOST + "_" + getGID(this.url));
|
||||||
waitForThreads();
|
waitForThreads();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user