diff options
| author | Fuwn <[email protected]> | 2023-08-08 02:36:11 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-08-08 02:36:11 -0700 |
| commit | 7ceb0199f2b9a4cd7fa5925c8d595c9cacf940b0 (patch) | |
| tree | 551076e977bb4fc8f2d1f71625350fc767a13fcf | |
| parent | feat(index): hide light novels (diff) | |
| download | old.due.moe-7ceb0199f2b9a4cd7fa5925c8d595c9cacf940b0.tar.xz old.due.moe-7ceb0199f2b9a4cd7fa5925c8d595c9cacf940b0.zip | |
fix(html): manga sortv0.1.9
| -rw-r--r-- | src/due/html/utilities.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/due/html/utilities.py b/src/due/html/utilities.py index 367b434..5cd518e 100644 --- a/src/due/html/utilities.py +++ b/src/due/html/utilities.py @@ -6,15 +6,14 @@ def seen(element, manga=False): read = 0 if manga: - available_matches = re.search(r"\[<a.*?>(\d+)<\/a>\]", element) - read_matches = re.search(r"\[<a.*?>(?=\d+)<\/a>\]", element) + available_matches = re.search(r"\[<a href=\".*\">(\d+)</a>\]|\[(\d+)\]", element) + read_matches = re.search(r"</a> (\d+) <a href=\"/anilist", element) if read_matches: - read = int(read_matches.group()) - print(read) + read = int(read_matches.group(1)) if available_matches: - return int(available_matches.group(1)) - read + return int(available_matches.group(1) or re.sub(r"[\[\]]", '', available_matches.group(0))) - read else: return 0 |