Skip to content

Commit

Permalink
兼容 acg.rip
Browse files Browse the repository at this point in the history
  • Loading branch information
wushuo894 committed Nov 13, 2024
1 parent 59744d6 commit 2efb555
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion UPDATE.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
修改Logo
兼容 acg.rip
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ani.rss</groupId>
<artifactId>ani-rss</artifactId>
<version>1.1.187</version>
<version>1.1.188</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
13 changes: 8 additions & 5 deletions src/main/java/ani/rss/util/ItemsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -118,15 +119,17 @@ public static List<Item> getItems(Ani ani, String xml, Item newItem) {
if (itemChildNodeName.equals("enclosure")) {
NamedNodeMap attributes = itemChild.getAttributes();
String url = attributes.getNamedItem("url").getNodeValue();
length = attributes.getNamedItem("length").getNodeValue();
if (Long.parseLong(length) > 1) {
torrent = url;
infoHash = FileUtil.mainName(torrent);
}
length = Optional.of(attributes)
.map(it -> it.getNamedItem("length"))
.map(Node::getNodeValue)
.orElse("1");

if (ReUtil.contains(StringEnum.MAGNET_REG, url)) {
torrent = url;
infoHash = ReUtil.get(StringEnum.MAGNET_REG, url, 1);
} else {
torrent = url;
infoHash = FileUtil.mainName(torrent);
}
}
if (itemChildNodeName.equals("nyaa:infoHash")) {
Expand Down

0 comments on commit 2efb555

Please sign in to comment.