mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-15 10:24:04 +02:00
Fix rgif ripper tests
This commit is contained in:
@@ -2,7 +2,6 @@ package com.rarchives.ripme.tst.ripper.rippers;
|
||||
|
||||
import com.rarchives.ripme.ripper.rippers.RedditRipper;
|
||||
import com.rarchives.ripme.ripper.rippers.RedgifsRipper;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.junit.jupiter.api.*;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -15,9 +14,8 @@ public class RedgifsRipperTest extends RippersTest {
|
||||
* Rips correctly formatted URL directly from Redgifs
|
||||
*/
|
||||
@Test
|
||||
@Disabled("test or ripper broken")
|
||||
public void testRedgifsGoodURL() throws IOException, URISyntaxException {
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/talkativewarpeddragon-petite").toURL());
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/watch/ashamedselfishcoypu").toURL());
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
@@ -25,36 +23,38 @@ public class RedgifsRipperTest extends RippersTest {
|
||||
* Rips gifdeliverynetwork URL's by redirecting them to proper redgifs url
|
||||
*/
|
||||
@Test
|
||||
@Tag("flaky")
|
||||
public void testRedgifsBadRL() throws IOException, URISyntaxException {
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/foolishelasticchimpanzee").toURL());
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.gifdeliverynetwork.com/consideratetrustworthypigeon").toURL());
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rips a Redifs profile
|
||||
* Rips a Redgifs profile
|
||||
*/
|
||||
@Test
|
||||
@Tag("flaky")
|
||||
public void testRedgifsProfile() throws IOException, URISyntaxException {
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/users/margo_monty").toURL());
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/users/ra-kunv2").toURL());
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rips a Redifs category/search
|
||||
* Rips a Redgif search
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
@Disabled("test or ripper broken")
|
||||
public void testRedgifsSearch() throws IOException, URISyntaxException {
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://redgifs.com/gifs/browse/little-caprice").toURL());
|
||||
Document doc = ripper.getFirstPage();
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/search?query=take+a+shot+every+time").toURL());
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
doc = ripper.getNextPage(doc);
|
||||
Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=150".equalsIgnoreCase(doc.location()));
|
||||
doc = ripper.getNextPage(doc);
|
||||
Assertions.assertTrue("https://api.redgifs.com/v1/gfycats/search?search_text=little%20caprice&count=150&start=300".equalsIgnoreCase(doc.location()));
|
||||
/**
|
||||
* Rips Redgif tags
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void testRedgifsTags() throws IOException, URISyntaxException {
|
||||
RedgifsRipper ripper = new RedgifsRipper(new URI("https://www.redgifs.com/gifs/animation,sfw,funny?order=best&tab=gifs").toURL());
|
||||
testRipper(ripper);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user