mirror of
https://github.com/RipMeApp/ripme.git
synced 2025-08-06 05:47:29 +02:00
Now sends a referrer when fetching first page
This commit is contained in:
@@ -25,6 +25,7 @@ public class GfycatRipper extends AbstractHTMLRipper {
|
|||||||
String username = "";
|
String username = "";
|
||||||
String cursor = "";
|
String cursor = "";
|
||||||
String count = "30";
|
String count = "30";
|
||||||
|
String REFERRER = "www.reddit.com";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -64,10 +65,10 @@ public class GfycatRipper extends AbstractHTMLRipper {
|
|||||||
@Override
|
@Override
|
||||||
public Document getFirstPage() throws IOException {
|
public Document getFirstPage() throws IOException {
|
||||||
if (!isProfile()) {
|
if (!isProfile()) {
|
||||||
return Http.url(url).get();
|
return Http.url(url).referrer(REFERRER).get();
|
||||||
} else {
|
} else {
|
||||||
username = getGID(url);
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user