diff --git a/src/LabelsBundle_zh_CN.properties b/src/LabelsBundle_zh_CN.properties new file mode 100644 index 000000000..994efcf8b --- /dev/null +++ b/src/LabelsBundle_zh_CN.properties @@ -0,0 +1,75 @@ +Log = 日志 +History = 历史 +created = 创建时间 +modified = 修改时间 +queue = 队列 +Configuration = 配置 +open = 打开 + +# Keys for the Configuration menu +current.version = 当前版本 +check.for.updates = 检查更新 +auto.update = 自动更新? +max.download.threads = 最大下载线程数: +timeout.mill = 超时(毫秒): +retry.download.count = 重试下载次数 +overwrite.existing.files = 覆盖现有文件? +sound.when.rip.completes = 抓取完成时播放声音 +preserve.order = 保持顺序 +save.logs = 保存日志 +notification.when.rip.starts = 通知抓取开始 +save.urls.only = 仅保存 URL +save.album.titles = 保存专辑标题 +autorip.from.clipboard = 监视剪贴板上的 URL +save.descriptions = 保存描述 +prefer.mp4.over.gif = 首选 MP4 而非 GIF +restore.window.position = 恢复窗口位置 +remember.url.history = 记住 URL 历史 +loading.history.from = 加载历史从 + +# Queue keys +queue.remove.all = 移除全部 +queue.validation = 您确定要移除队列内的全部项目? +queue.remove.selected = 移除所选项目 + +# History +re-rip.checked = 重新抓取选中的项目 +remove = 移除 +clear = 清除 +history.check.all = 选中全部 +history.check.none = 取消选中全部 +history.check.selected = 选中所选项目 +history.uncheck.selected = 取消选中所选项目 +history.load.failed.warning = RipMe 加载位于 historyFile.getAbsolutePath() 的历史文件失败\n\n错误:%s\n\n关闭 RipMe 会自动覆盖此文件的内容,\n请在关闭 RipMe 前备份它! +history.load.none = 无可重新抓取的历史条目。请先抓取一些专辑 +history.load.none.checked = 未 '选中' 任何历史条目,请通过选中所需 URL 前面的复选框或URL 的右键菜单以选中所需条目 + +# TrayIcon +tray.show = 显示 +tray.hide = 隐藏 +tray.autorip = 监视剪贴板上的 URL +tray.exit = 退出 + +# Misc UI keys +loading.history.from.configuration = 从配置加载历史 +interrupted.while.waiting.to.rip.next.album = 等候抓取下一专辑期间发生中断 +inactive = 非活动 +download.url.list = 下载 URL 列表 +select.save.dir = 选择保存目录 + +# Keys for the logs generated by DownloadFileThread +nonretriable.status.code = 非可重试状态代码 +retriable.status.code = 可重试状态代码 +server.doesnt.support.resuming.downloads = 服务器不支持继续下载(续传) +# A "magic number" can also be called a file signature +was.unable.to.get.content.type.using.magic.number = 不能使用幻数获取内容类型 +magic.number.was = 幻数为 +deleting.existing.file = 删除现有文件 +request.properties = 请求属性 +download.interrupted = 下载中断 +exceeded.maximum.retries = 超过最大重试次数 +http.status.exception = HTTP 状态意外 +exception.while.downloading.file = 下载文件时发生意外 +failed.to.download = 下载失败 +skipping = 跳过 +file.already.exists = 文件已存在 \ No newline at end of file diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ArtStationRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ArtStationRipper.java index f61f48f8e..66455861b 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/ArtStationRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ArtStationRipper.java @@ -60,7 +60,7 @@ public String getGID(URL url) throws MalformedURLException { // URL points to user portfolio, use user's full name as GID String userInfoURL = "https://www.artstation.com/users/" + albumURL.getID() + "/quick.json"; try { - // groupData = Http.url(userInfoURL).getJSON(); +// groupData = Http.url(userInfoURL).getJSON(); groupData = getJson(userInfoURL); } catch (IOException e) { throw new MalformedURLException("Couldn't load JSON from " + userInfoURL); @@ -254,7 +254,7 @@ private ParsedURL parseURL(URL url) { con.userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0"); con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); con.header("Accept-Language", "en-US,en;q=0.5"); - con.header("Accept-Encoding", "gzip, deflate, br"); +// con.header("Accept-Encoding", "gzip, deflate, br"); con.header("Upgrade-Insecure-Requests", "1"); Response res = con.execute(); int status = res.statusCode(); @@ -309,7 +309,7 @@ private JSONObject getJson(URL url) throws IOException { "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"); con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); con.header("Accept-Language", "en-US,en;q=0.5"); - con.header("Accept-Encoding", "gzip, deflate, br"); +// con.header("Accept-Encoding", "gzip, deflate, br"); con.header("Upgrade-Insecure-Requests", "1"); Response res = con.execute(); int status = res.statusCode(); diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/PawooRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/PawooRipper.java index 8f5c8c372..31817c84c 100644 --- a/src/main/java/com/rarchives/ripme/ripper/rippers/PawooRipper.java +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/PawooRipper.java @@ -3,6 +3,11 @@ import java.io.IOException; import java.net.URL; +import com.rarchives.ripme.utils.Http; + +import org.jsoup.nodes.Document; +import org.jsoup.select.Elements; + public class PawooRipper extends MastodonRipper { public PawooRipper(URL url) throws IOException { super(url); @@ -17,4 +22,17 @@ public String getHost() { public String getDomain() { return "pawoo.net"; } + + + @Override + // Pawoo uses a custom theme that has different navigation links + public Document getNextPage(Document doc) throws IOException { + Elements hrefs = doc.select(".pagination a[rel=\"next\"]"); + if (hrefs.isEmpty()) { + throw new IOException("No more pages"); + } + String nextUrl = hrefs.last().attr("href"); + sleep(500); + return Http.url(nextUrl).get(); + } } diff --git a/src/main/java/com/rarchives/ripme/ripper/rippers/ReadcomicRipper.java b/src/main/java/com/rarchives/ripme/ripper/rippers/ReadcomicRipper.java new file mode 100644 index 000000000..55b3559ae --- /dev/null +++ b/src/main/java/com/rarchives/ripme/ripper/rippers/ReadcomicRipper.java @@ -0,0 +1,55 @@ +package com.rarchives.ripme.ripper.rippers; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.jsoup.nodes.Document; +import org.jsoup.nodes.Element; + +import com.rarchives.ripme.ripper.AbstractHTMLRipper; +import com.rarchives.ripme.utils.Http; + +public class ReadcomicRipper extends ViewcomicRipper { + + public ReadcomicRipper(URL url) throws IOException { + super(url); + } + + @Override + public String getHost() { + return "read-comic"; + } + + @Override + public String getDomain() { + return "read-comic.com"; + } + + + + @Override + public String getGID(URL url) throws MalformedURLException { + Pattern p = Pattern.compile("https?://read-comic.com/([a-zA-Z1-9_-]*)/?$"); + Matcher m = p.matcher(url.toExternalForm()); + if (m.matches()) { + return m.group(1); + } + throw new MalformedURLException("Expected view-comic URL format: " + + "read-comic.com/COMIC_NAME - got " + url + " instead"); + } + + @Override + public List getURLsFromPage(Document doc) { + List result = new ArrayList(); + for (Element el : doc.select("div.pinbin-copy > a > img")) { + result.add(el.attr("src")); + } + return result; + } + +}