1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-01-17 20:58:31 +01:00

Fix Vsco session token

This commit is contained in:
neurolancer 2022-01-01 17:34:43 +00:00
parent 64dbb56c62
commit eb9f556643

View File

@ -11,6 +11,7 @@ import java.util.regex.Pattern;
import org.json.JSONObject;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.Connection.Response;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
@ -103,12 +104,12 @@ public class VscoRipper extends AbstractHTMLRipper {
String userinfoPage = "https://vsco.co/content/Static/userinfo";
String referer = "https://vsco.co/" + username + "/gallery";
Map<String,String> cookies = new HashMap<>();
Map<String,String> responseCookies = new HashMap<>();
cookies.put("vs_anonymous_id", UUID.randomUUID().toString());
try {
Element doc = Http.url(userinfoPage).cookies(cookies).referrer(referer).ignoreContentType().get().body();
String json = doc.text().replaceAll("define\\(", "");
json = json.replaceAll("\\)", "");
return new JSONObject(json).getString("tkn");
Response resp = Http.url(userinfoPage).cookies(cookies).referrer(referer).ignoreContentType().response();
responseCookies = resp.cookies();
return responseCookies.get("vs");
} catch (IOException e) {
LOGGER.error("Could not get user tkn");
return null;