From 9012f206ed11ccf27115d823573567645144ef88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=92scar=20Casajuana?= Date: Sat, 18 May 2024 10:45:52 +0200 Subject: [PATCH] Remove mangajar and manganelos support, since they don't exist anymore closes #41 --- README.md | 2 -- grabber/plainhtml.go | 56 -------------------------------------------- 2 files changed, 58 deletions(-) diff --git a/README.md b/README.md index e2f353c..70a0bd1 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,11 @@ Supported sites - [Manga Monks](https://mangamonks.com) - [mangabat.com](https://mangabat.com) - [Mangadex](https://mangadex.org) -- [MangaJar](https://mangajar.pro) - [mangakakalot.com](https://mangakakalot.com) - [mangakakalot.tv](https://mangakakalot.tv) - [manganato.com](https://manganato.com) - [manganelo.com](https://manganelo.com) - [manganelo.tv](https://manganelo.tv) -- [manganelos.com](http://manganelos.com) - [mangapanda.in](https://mangapanda.in) - [readmangabat.com](https://readmangabat.com) - [tcbscans.com](https://tcbscans.com) diff --git a/grabber/plainhtml.go b/grabber/plainhtml.go index df6ee9e..25584bb 100644 --- a/grabber/plainhtml.go +++ b/grabber/plainhtml.go @@ -1,7 +1,6 @@ package grabber import ( - "fmt" "regexp" "strconv" "strings" @@ -9,7 +8,6 @@ import ( "github.com/PuerkitoBio/goquery" "github.com/elboletaire/manga-downloader/http" "github.com/fatih/color" - "golang.org/x/net/html" ) // PlainHTML is a grabber for any plain HTML page (with no ajax pagination whatsoever) @@ -27,9 +25,6 @@ type SiteSelector struct { Chapter string ChapterTitle string Image string - Ajax string - AjaxRows string - AjaxNext string } // PlainHTMLChapter represents a PlainHTML Chapter @@ -97,18 +92,6 @@ func (m *PlainHTML) Test() (bool, error) { Link: "a", Image: "#readerarea img.ts-main-image", }, - // mangajar.pro - { - Title: "h1 .post-name", - Rows: "article.chaptersList li.chapter-item", - Chapter: ".chapter-title", - ChapterTitle: "a", - Link: "a", - Image: "#chapter-slider .carousel-item img", - Ajax: ".chapters-infinite-pagination .pagination .page-item", - AjaxRows: ".chapter-list-container .chapter-item", - AjaxNext: "ul.pagination .page-item:not(.disabled):last-child", - }, // mangamonks { Title: "h3.info-title", @@ -131,45 +114,6 @@ func (m *PlainHTML) Test() (bool, error) { } } - // some sites have ajax pagination - if m.site.Ajax != "" && m.doc.Find(m.site.Ajax).Length() > 0 { - var err error - var fetchChaps func(page int) - rows := &goquery.Selection{ - Nodes: []*html.Node{}, - } - - fetchChaps = func(page int) { - rbody, err := http.Get(http.RequestParams{ - URL: fmt.Sprintf("%s/chaptersList?page=%d", m.URL, page), - }) - if err != nil { - return - } - defer rbody.Close() - - doc, err := goquery.NewDocumentFromReader(rbody) - if err != nil { - return - } - - rows = rows.AddNodes(doc.Find(m.site.AjaxRows).Nodes...) - - if doc.Find(m.site.AjaxNext).Length() > 0 { - fetchChaps(page + 1) - } - } - - fetchChaps(1) - if err != nil { - return false, err - } - - m.rows = rows - - return m.rows.Length() > 0, nil - } - if m.rows == nil { return false, nil }