@@ -0,0 +1,2100 @@
+package com.rarchives.ripme.ripper.rippers;%0A%0Aimport java.io.IOException;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL;%0A%0Aimport java.util.List;%0Aimport java.util.ArrayList;%0Aimport java.util.regex.Pattern;%0Aimport java.util.regex.Matcher;%0A%0Aimport org.json.JSONObject;%0Aimport org.json.JSONArray;%0A%0Aimport com.rarchives.ripme.ripper.AbstractJSONRipper;%0Aimport com.rarchives.ripme.utils.Http;%0A%0A/**%0A * @author owaiswiz%0A *%0A */%0Apublic class FolioRipper extends AbstractJSONRipper %7B%0A    public FolioRipper(URL url) throws IOException %7B%0A        super(url);%0A    %7D%0A%0A    @Override%0A    public String getHost() %7B%0A        return %22folio%22;%0A    %7D%0A%0A    @Override%0A    public String getDomain() %7B%0A        return %22folio.ink%22;%0A    %7D%0A%0A    @Override%0A    public String getGID(URL url) throws MalformedURLException %7B%0A        Pattern p = Pattern.compile(%22%5Ehttps?://(?:www.)?folio.ink/(%5Ba-zA-Z0-9%5D+).*$%22);%0A        Matcher m = p.matcher(url.toExternalForm());%0A        if (m.matches()) %7B%0A            return m.group(1);%0A        %7D%0A        throw new MalformedURLException(%22Expected folio.ink URL format: %22 +%0A            %22folio.ink/albumid (e.g: folio.ink/DmBe6i) - got %22 + url + %22 instead%22);%0A    %7D%0A%0A    @Override%0A    public JSONObject getFirstPage() throws IOException %7B%0A        String jsonArrayString = Http.url(%22https://folio.ink/getimages/%22 + getGID(url)).ignoreContentType().response().body();%0A        JSONArray imagesArray = new JSONArray(jsonArrayString);%0A        JSONObject imagesObject = new JSONObject();%0A        imagesObject.put(%22images%22, imagesArray);%0A%0A        return imagesObject;%0A    %7D%0A%0A    @Override%0A    public List%3CString%3E getURLsFromJSON(JSONObject json) %7B%0A        List%3CString%3E result = new ArrayList%3CString%3E();%0A        JSONArray imagesArray = json.getJSONArray(%22images%22);%0A%0A        for (int i = 0; i %3C imagesArray.length(); i++) %7B%0A            JSONObject image = imagesArray.getJSONObject(i);%0A            result.add(image.getString(%22image_url%22));%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A    @Override%0A    public void downloadURL(URL url, int index) %7B%0A        addURLToDownload(url, getPrefix(index));%0A    %7D%0A%7D%0A

Add Ripper for folio.ink