Merge pull request #544 from cyian-1756/TsuminoRipperFixes

TsuminoRipper now adds .png to filenames; Removed unneeded debug stat…
This commit is contained in:
cyian-1756 2018-04-29 16:17:14 -04:00 committed by GitHub
commit e5f6e2b396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,6 @@ import org.json.JSONObject;
import org.jsoup.Connection; import org.jsoup.Connection;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import com.rarchives.ripme.ripper.AbstractHTMLRipper; import com.rarchives.ripme.ripper.AbstractHTMLRipper;
@ -35,13 +34,10 @@ public class TsuminoRipper extends AbstractHTMLRipper {
try { try {
// This sessionId will expire and need to be replaced // This sessionId will expire and need to be replaced
cookies.put("ASP.NET_SessionId","c4rbzccf0dvy3e0cloolmlkq"); cookies.put("ASP.NET_SessionId","c4rbzccf0dvy3e0cloolmlkq");
logger.info(cookies);
Document doc = Jsoup.connect(postURL).data("q", getAlbumID()).userAgent(USER_AGENT).cookies(cookies).referrer("http://www.tsumino.com/Read/View/" + getAlbumID()).post(); Document doc = Jsoup.connect(postURL).data("q", getAlbumID()).userAgent(USER_AGENT).cookies(cookies).referrer("http://www.tsumino.com/Read/View/" + getAlbumID()).post();
String jsonInfo = doc.html().replaceAll("<html>","").replaceAll("<head></head>", "").replaceAll("<body>", "").replaceAll("</body>", "") String jsonInfo = doc.html().replaceAll("<html>","").replaceAll("<head></head>", "").replaceAll("<body>", "").replaceAll("</body>", "")
.replaceAll("</html>", "").replaceAll("\n", ""); .replaceAll("</html>", "").replaceAll("\n", "");
logger.info(jsonInfo);
JSONObject json = new JSONObject(jsonInfo); JSONObject json = new JSONObject(jsonInfo);
logger.info(json.getJSONArray("reader_page_urls"));
return json.getJSONArray("reader_page_urls"); return json.getJSONArray("reader_page_urls");
} catch (IOException e) { } catch (IOException e) {
logger.info(e); logger.info(e);
@ -85,7 +81,6 @@ public class TsuminoRipper extends AbstractHTMLRipper {
public Document getFirstPage() throws IOException { public Document getFirstPage() throws IOException {
Connection.Response resp = Http.url(url).response(); Connection.Response resp = Http.url(url).response();
cookies.putAll(resp.cookies()); cookies.putAll(resp.cookies());
logger.info(resp.parse());
return resp.parse(); return resp.parse();
} }
@ -103,6 +98,6 @@ public class TsuminoRipper extends AbstractHTMLRipper {
@Override @Override
public void downloadURL(URL url, int index) { public void downloadURL(URL url, int index) {
sleep(1000); sleep(1000);
addURLToDownload(url, getPrefix(index)); addURLToDownload(url, getPrefix(index), "", null, null, null, "png");
} }
} }