1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-08-11 16:34:04 +02:00

Merge pull request #1667 from cyian-1756/gyfcat_referer_fixes

Now sends a referrer when fetching first page
This commit is contained in:
cyian-1756
2020-05-21 04:05:15 +00:00
committed by GitHub

View File

@@ -25,6 +25,7 @@ public class GfycatRipper extends AbstractHTMLRipper {
String username = "";
String cursor = "";
String count = "30";
String REFERRER = "www.reddit.com";
@@ -64,10 +65,10 @@ public class GfycatRipper extends AbstractHTMLRipper {
@Override
public Document getFirstPage() throws IOException {
if (!isProfile()) {
return Http.url(url).get();
return Http.url(url).referrer(REFERRER).get();
} else {
username = getGID(url);
return Http.url(new URL("https://api.gfycat.com/v1/users/" + username + "/gfycats")).ignoreContentType().get();
return Http.url(new URL("https://api.gfycat.com/v1/users/" + username + "/gfycats")).referrer((REFERRER)).ignoreContentType().get();
}
}