1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-04-22 12:42:02 +02:00

Now sends a referrer when fetching first page

This commit is contained in:
cyian-1756 2020-05-20 23:55:38 -04:00
parent 6128862fbf
commit 1d600e5a31

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();
}
}