1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-17 11:20:56 +02:00

new URI instead of new URL, flickr, hqporn.

This commit is contained in:
soloturn
2023-12-29 12:01:22 +01:00
parent 52425a7ad7
commit d1166a73bf
2 changed files with 7 additions and 6 deletions

View File

@@ -130,8 +130,8 @@ public class FlickrRipper extends AbstractHTMLRipper {
String apiURL = null;
try {
apiURL = apiURLBuilder(getAlbum(url.toExternalForm()), page, apiKey);
pageURL = new URL(apiURL);
} catch (MalformedURLException e) {
pageURL = new URI(apiURL).toURL();
} catch (MalformedURLException | URISyntaxException e) {
LOGGER.error("Unable to get api link " + apiURL + " is malformed");
}
try {

View File

@@ -11,6 +11,7 @@ import org.jsoup.select.Elements;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
@@ -164,10 +165,10 @@ public class HqpornerRipper extends AbstractHTMLRipper {
}
if (downloadUrl != null) {
addURLToDownload(new URL(downloadUrl), "", subdirectory, "", null, getVideoName(), "mp4");
addURLToDownload(new URI(downloadUrl).toURL(), "", subdirectory, "", null, getVideoName(), "mp4");
}
} catch (IOException e) {
} catch (IOException | URISyntaxException e) {
LOGGER.error("[!] Exception while downloading video.", e);
}
}
@@ -215,7 +216,7 @@ public class HqpornerRipper extends AbstractHTMLRipper {
try {
logger.info("Trying to download from unknown video host " + videoPageurl);
URL url = new URL(videoPageurl);
URL url = new URI(videoPageurl).toURL();
Response response = Http.url(url).referrer(hqpornerVideoPageUrl).response();
Document doc = response.parse();
@@ -245,7 +246,7 @@ public class HqpornerRipper extends AbstractHTMLRipper {
}
}
} catch (IOException e) {
} catch (IOException | URISyntaxException e) {
logger.error("Unable to get video url using generic methods.");
}