Skip to content

Commit 6128862

Browse files
author
cyian-1756
committed
Merge branch 'master' of https://github.com/RipMeApp/ripme
2 parents 57aa76b + 6c70797 commit 6128862

File tree

4 files changed

+151
-3
lines changed

4 files changed

+151
-3
lines changed

src/LabelsBundle_zh_CN.properties

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
Log = 日志
2+
History = 历史
3+
created = 创建时间
4+
modified = 修改时间
5+
queue = 队列
6+
Configuration = 配置
7+
open = 打开
8+
9+
# Keys for the Configuration menu
10+
current.version = 当前版本
11+
check.for.updates = 检查更新
12+
auto.update = 自动更新?
13+
max.download.threads = 最大下载线程数:
14+
timeout.mill = 超时(毫秒):
15+
retry.download.count = 重试下载次数
16+
overwrite.existing.files = 覆盖现有文件?
17+
sound.when.rip.completes = 抓取完成时播放声音
18+
preserve.order = 保持顺序
19+
save.logs = 保存日志
20+
notification.when.rip.starts = 通知抓取开始
21+
save.urls.only = 仅保存 URL
22+
save.album.titles = 保存专辑标题
23+
autorip.from.clipboard = 监视剪贴板上的 URL
24+
save.descriptions = 保存描述
25+
prefer.mp4.over.gif = 首选 MP4 而非 GIF
26+
restore.window.position = 恢复窗口位置
27+
remember.url.history = 记住 URL 历史
28+
loading.history.from = 加载历史从
29+
30+
# Queue keys
31+
queue.remove.all = 移除全部
32+
queue.validation = 您确定要移除队列内的全部项目?
33+
queue.remove.selected = 移除所选项目
34+
35+
# History
36+
re-rip.checked = 重新抓取选中的项目
37+
remove = 移除
38+
clear = 清除
39+
history.check.all = 选中全部
40+
history.check.none = 取消选中全部
41+
history.check.selected = 选中所选项目
42+
history.uncheck.selected = 取消选中所选项目
43+
history.load.failed.warning = RipMe 加载位于 historyFile.getAbsolutePath() 的历史文件失败\n\n错误:%s\n\n关闭 RipMe 会自动覆盖此文件的内容,\n请在关闭 RipMe 前备份它!
44+
history.load.none = 无可重新抓取的历史条目。请先抓取一些专辑
45+
history.load.none.checked = 未 '选中' 任何历史条目,请通过选中所需 URL 前面的复选框或URL 的右键菜单以选中所需条目
46+
47+
# TrayIcon
48+
tray.show = 显示
49+
tray.hide = 隐藏
50+
tray.autorip = 监视剪贴板上的 URL
51+
tray.exit = 退出
52+
53+
# Misc UI keys
54+
loading.history.from.configuration = 从配置加载历史
55+
interrupted.while.waiting.to.rip.next.album = 等候抓取下一专辑期间发生中断
56+
inactive = 非活动
57+
download.url.list = 下载 URL 列表
58+
select.save.dir = 选择保存目录
59+
60+
# Keys for the logs generated by DownloadFileThread
61+
nonretriable.status.code = 非可重试状态代码
62+
retriable.status.code = 可重试状态代码
63+
server.doesnt.support.resuming.downloads = 服务器不支持继续下载(续传)
64+
# A "magic number" can also be called a file signature
65+
was.unable.to.get.content.type.using.magic.number = 不能使用幻数获取内容类型
66+
magic.number.was = 幻数为
67+
deleting.existing.file = 删除现有文件
68+
request.properties = 请求属性
69+
download.interrupted = 下载中断
70+
exceeded.maximum.retries = 超过最大重试次数
71+
http.status.exception = HTTP 状态意外
72+
exception.while.downloading.file = 下载文件时发生意外
73+
failed.to.download = 下载失败
74+
skipping = 跳过
75+
file.already.exists = 文件已存在

src/main/java/com/rarchives/ripme/ripper/rippers/ArtStationRipper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public String getGID(URL url) throws MalformedURLException {
6060
// URL points to user portfolio, use user's full name as GID
6161
String userInfoURL = "https://www.artstation.com/users/" + albumURL.getID() + "/quick.json";
6262
try {
63-
// groupData = Http.url(userInfoURL).getJSON();
63+
// groupData = Http.url(userInfoURL).getJSON();
6464
groupData = getJson(userInfoURL);
6565
} catch (IOException e) {
6666
throw new MalformedURLException("Couldn't load JSON from " + userInfoURL);
@@ -254,7 +254,7 @@ private ParsedURL parseURL(URL url) {
254254
con.userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0");
255255
con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
256256
con.header("Accept-Language", "en-US,en;q=0.5");
257-
con.header("Accept-Encoding", "gzip, deflate, br");
257+
// con.header("Accept-Encoding", "gzip, deflate, br");
258258
con.header("Upgrade-Insecure-Requests", "1");
259259
Response res = con.execute();
260260
int status = res.statusCode();
@@ -309,7 +309,7 @@ private JSONObject getJson(URL url) throws IOException {
309309
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
310310
con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
311311
con.header("Accept-Language", "en-US,en;q=0.5");
312-
con.header("Accept-Encoding", "gzip, deflate, br");
312+
// con.header("Accept-Encoding", "gzip, deflate, br");
313313
con.header("Upgrade-Insecure-Requests", "1");
314314
Response res = con.execute();
315315
int status = res.statusCode();

src/main/java/com/rarchives/ripme/ripper/rippers/PawooRipper.java

+18
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import java.io.IOException;
44
import java.net.URL;
55

6+
import com.rarchives.ripme.utils.Http;
7+
8+
import org.jsoup.nodes.Document;
9+
import org.jsoup.select.Elements;
10+
611
public class PawooRipper extends MastodonRipper {
712
public PawooRipper(URL url) throws IOException {
813
super(url);
@@ -17,4 +22,17 @@ public String getHost() {
1722
public String getDomain() {
1823
return "pawoo.net";
1924
}
25+
26+
27+
@Override
28+
// Pawoo uses a custom theme that has different navigation links
29+
public Document getNextPage(Document doc) throws IOException {
30+
Elements hrefs = doc.select(".pagination a[rel=\"next\"]");
31+
if (hrefs.isEmpty()) {
32+
throw new IOException("No more pages");
33+
}
34+
String nextUrl = hrefs.last().attr("href");
35+
sleep(500);
36+
return Http.url(nextUrl).get();
37+
}
2038
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package com.rarchives.ripme.ripper.rippers;
2+
3+
import java.io.IOException;
4+
import java.net.MalformedURLException;
5+
import java.net.URL;
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
import java.util.regex.Matcher;
9+
import java.util.regex.Pattern;
10+
11+
import org.jsoup.nodes.Document;
12+
import org.jsoup.nodes.Element;
13+
14+
import com.rarchives.ripme.ripper.AbstractHTMLRipper;
15+
import com.rarchives.ripme.utils.Http;
16+
17+
public class ReadcomicRipper extends ViewcomicRipper {
18+
19+
public ReadcomicRipper(URL url) throws IOException {
20+
super(url);
21+
}
22+
23+
@Override
24+
public String getHost() {
25+
return "read-comic";
26+
}
27+
28+
@Override
29+
public String getDomain() {
30+
return "read-comic.com";
31+
}
32+
33+
34+
35+
@Override
36+
public String getGID(URL url) throws MalformedURLException {
37+
Pattern p = Pattern.compile("https?://read-comic.com/([a-zA-Z1-9_-]*)/?$");
38+
Matcher m = p.matcher(url.toExternalForm());
39+
if (m.matches()) {
40+
return m.group(1);
41+
}
42+
throw new MalformedURLException("Expected view-comic URL format: " +
43+
"read-comic.com/COMIC_NAME - got " + url + " instead");
44+
}
45+
46+
@Override
47+
public List<String> getURLsFromPage(Document doc) {
48+
List<String> result = new ArrayList<String>();
49+
for (Element el : doc.select("div.pinbin-copy > a > img")) {
50+
result.add(el.attr("src"));
51+
}
52+
return result;
53+
}
54+
55+
}

0 commit comments

Comments
 (0)