Skip to content

Commit

Permalink
fix(asura): broken chapters (#762)
Browse files Browse the repository at this point in the history
* fix(asura): update selectors

* chore(asura): bump version
  • Loading branch information
KaBankz authored Sep 25, 2024
1 parent cbf1730 commit 8fe5f04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/rust/en.asurascans/res/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"id": "en.asurascans",
"lang": "en",
"name": "Asura Scans",
"version": 2,
"version": 3,
"url": "https://asuracomic.net",
"nsfw": 0
}
Expand Down
8 changes: 4 additions & 4 deletions src/rust/en.asurascans/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ fn get_chapter_list(manga_id: String) -> Result<Vec<Chapter>> {
let url = get_chapter_url(&id, &manga_id);

// Chapter's title if it exists
let title = node.select("h3:eq(0) > a > span").text().read();
let title = node.select("h3 > a > span").text().read();

let chapter = node
.select("h3:eq(0) > a")
.select("h3 > a")
.text()
.read()
.replace(&title, "")
Expand All @@ -257,7 +257,7 @@ fn get_chapter_list(manga_id: String) -> Result<Vec<Chapter>> {
.unwrap_or(-1.0);

let cleaned_date: StringRef = {
let mut date = node.select("h3:eq(1)").text().read();
let mut date = node.select("h3:not(:has(*))").text().read();

let mut parts = date.split_whitespace().collect::<Vec<&str>>();

Expand Down Expand Up @@ -303,7 +303,7 @@ fn get_page_list(manga_id: String, chapter_id: String) -> Result<Vec<Page>> {

let mut pages: Vec<Page> = Vec::new();

for node in html.select("div > img[alt=chapter page]").array() {
for node in html.select("div > img[alt^=chapter page]").array() {
let node = node.as_node()?;

let url = node.attr("abs:src").read();
Expand Down

0 comments on commit 8fe5f04

Please sign in to comment.