From 6c84b192b76e1e9b7bb6f9a1e3c7e27d59aa56a1 Mon Sep 17 00:00:00 2001 From: 4pr0n Date: Tue, 1 Jul 2014 22:48:02 -0700 Subject: [PATCH] 1.0.76 - Taptastic ripper improvements New (improved) filename scheme. Shortened code length/complexity. Can now rip all episodes in series from a single /episode/ page. Code formatting the way I like it. From pull request #86. --- pom.xml | 2 +- .../ripme/ripper/rippers/TapasticRipper.java | 93 +++++++++---------- .../com/rarchives/ripme/ui/UpdateUtils.java | 2 +- 3 files changed, 46 insertions(+), 51 deletions(-) diff --git a/pom.xml b/pom.xml index 9e6dccf0..b0878842 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rarchives.ripme ripme jar - 1.0.75 + 1.0.76 ripme http://rip.rarchives.com diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/TapasticRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/TapasticRipper.java index 0fcc0aa6..e6756307 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/TapasticRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/TapasticRipper.java @@ -11,31 +11,20 @@ import java.util.regex.Pattern; import org.json.JSONArray; import org.json.JSONObject; import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import com.rarchives.ripme.ripper.AbstractHTMLRipper; import com.rarchives.ripme.utils.Http; +import com.rarchives.ripme.utils.Utils; class TapasticEpisode { - int index; - int id; - String title; - String filename; + protected int index, id; + protected String title, filename; public TapasticEpisode(int index, int id, String title) { - this.index=index; - this.id=id; - this.title=title; - this.filename=title // Windows filenames may not contain any of these... - .replace("\\", "") - .replace("/", "") - .replace(":", "") - .replace("*", "") - .replace("?", "") - .replace("\"", "") - .replace("<", "") - .replace(">", "") - .replace("|", ""); + this.index = index; + this.id = id; + this.title = title; + this.filename = Utils.filesystemSafe(title); } } @@ -65,25 +54,18 @@ public class TapasticRipper extends AbstractHTMLRipper { @Override public List getURLsFromPage(Document page) { List urls = new ArrayList(); - Elements scripts=page.select("script"); - for(Element script: scripts) { - String text=script.data(); - if(text.contains("var _data")) { - String[] lines=text.split("\n"); - for(String line:lines) { - String trimmed=line.trim(); - if(trimmed.startsWith("episodeList : ")) { - JSONArray json_episodes=new JSONArray(trimmed.substring("episodeList : ".length())); - for(int i=0;i