1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-15 18:34:09 +02:00

Fix #1416 - Fails to download gfycat.com/amp/*

Adding a string replace to remove the "/amp"
This commit is contained in:
Pocochub
2019-09-06 10:17:49 +01:00
committed by GitHub
parent 5f3533e45e
commit 828255d8bc

View File

@@ -49,10 +49,12 @@ public class GfycatRipper extends AbstractHTMLRipper {
@Override @Override
public URL sanitizeURL(URL url) throws MalformedURLException { public URL sanitizeURL(URL url) throws MalformedURLException {
url = new URL(url.toExternalForm().replace("/gifs/detail", "")); String sUrl = url.toExternalForm();
sUrl = sUrl.replace("/gifs/detail", "");
return url; sUrl = sUrl.replace("/amp", "");
return new URL(sUrl);
} }
public boolean isProfile() { public boolean isProfile() {
Pattern p = Pattern.compile("^https?://[wm.]*gfycat\\.com/@([a-zA-Z0-9]+).*$"); Pattern p = Pattern.compile("^https?://[wm.]*gfycat\\.com/@([a-zA-Z0-9]+).*$");
Matcher m = p.matcher(url.toExternalForm()); Matcher m = p.matcher(url.toExternalForm());
@@ -154,4 +156,4 @@ public class GfycatRipper extends AbstractHTMLRipper {
} }
throw new IOException(); throw new IOException();
} }
} }