Merge pull request #928 from cyian-1756/imgurVideoTest

Added unit test for imgur videoes
This commit is contained in:
cyian-1756 2018-09-12 17:36:06 -04:00 committed by GitHub
commit 0b0df6df1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ package com.rarchives.ripme.tst.ripper.rippers;
import com.rarchives.ripme.ripper.rippers.ImgurRipper;
import com.rarchives.ripme.ripper.rippers.ImgurRipper.ImgurAlbum;
import com.rarchives.ripme.utils.RipUtils;
import java.io.IOException;
import java.net.URL;
@ -69,6 +70,11 @@ public class ImgurRipperTest extends RippersTest {
assertTrue("Failed to find 100 files from " + album.url.toExternalForm() + ", only got " + album.images.size(), album.images.size() >= 100);
}
public void testImgurVideoFromGetFilesFromURL() throws Exception {
List<URL> urls = RipUtils.getFilesFromURL(new URL("https://i.imgur.com/4TtwxRN.gifv"));
assertEquals("https://i.imgur.com/4TtwxRN.mp4", urls.get(0).toExternalForm());
}
/*
// Imgur seems to be really flaky with this huge album, or the album was removed or something.
// Navigating to this link results in an "over capacity" warning on the page.