Merge pull request #389 from rephormat/xhamster-video-fix
Xhamster video fix
This commit is contained in:
commit
f770226d31
@ -39,10 +39,10 @@ public class XhamsterRipper extends VideoRipper {
|
||||
|
||||
@Override
|
||||
public String getGID(URL url) throws MalformedURLException {
|
||||
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/.*$");
|
||||
Pattern p = Pattern.compile("^https?://.*xhamster\\.com/(movies|videos)/(.*)$");
|
||||
Matcher m = p.matcher(url.toExternalForm());
|
||||
if (m.matches()) {
|
||||
return m.group(1);
|
||||
return m.group(2);
|
||||
}
|
||||
|
||||
throw new MalformedURLException(
|
||||
@ -56,7 +56,7 @@ public class XhamsterRipper extends VideoRipper {
|
||||
public void rip() throws IOException {
|
||||
logger.info("Retrieving " + this.url);
|
||||
Document doc = Http.url(url).get();
|
||||
Elements videos = doc.select("a.mp4Thumb");
|
||||
Elements videos = doc.select("div.player-container > a");
|
||||
if (videos.size() == 0) {
|
||||
throw new IOException("Could not find Embed code at " + url);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||
import com.rarchives.ripme.ripper.VideoRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.video.PornhubRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.video.VineRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.video.XhamsterRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.video.XvideosRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.video.YoupornRipper;
|
||||
|
||||
@ -35,6 +36,15 @@ public class VideoRippersTest extends RippersTest {
|
||||
}
|
||||
}
|
||||
|
||||
public void testXhamsterRipper() throws IOException {
|
||||
List<URL> contentURLs = new ArrayList<>();
|
||||
contentURLs.add(new URL("https://xhamster.com/videos/brazzers-busty-big-booty-milf-lisa-ann-fucks-her-masseur-1492828"));
|
||||
for (URL url : contentURLs) {
|
||||
XhamsterRipper ripper = new XhamsterRipper(url);
|
||||
videoTestHelper(ripper);
|
||||
}
|
||||
}
|
||||
|
||||
public void testXvideosRipper() throws IOException {
|
||||
List<URL> contentURLs = new ArrayList<>();
|
||||
contentURLs.add(new URL("https://www.xvideos.com/video19719109/ziggy_star_ultra_hard_anal_pounding"));
|
||||
|
Loading…
Reference in New Issue
Block a user