Skip to content

Commit

Permalink
Remove mangajar and manganelos support, since they don't exist anymore
Browse files Browse the repository at this point in the history
closes #41
  • Loading branch information
elboletaire committed May 18, 2024
1 parent 9981ace commit 9012f20
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
56 changes: 0 additions & 56 deletions grabber/plainhtml.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package grabber

import (
"fmt"
"regexp"
"strconv"
"strings"

"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)
Expand All @@ -27,9 +25,6 @@ type SiteSelector struct {
Chapter string
ChapterTitle string
Image string
Ajax string
AjaxRows string
AjaxNext string
}

// PlainHTMLChapter represents a PlainHTML Chapter
Expand Down Expand Up @@ -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",
Expand All @@ -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
}
Expand Down

0 comments on commit 9012f20

Please sign in to comment.