Skip to content

Commit

Permalink
[extractor:ehentai] updated data extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
gan-of-culture committed Dec 13, 2023
1 parent 62d4f75 commit 65c1fce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions extractors/ehentai/ehentai.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const site = "https://e-hentai.org/"

var reNumbOfPages = regexp.MustCompile(`([0-9]+) pages`)
var reIMGURLs = regexp.MustCompile(`https://e-hentai.org/s[^"]+-[0-9]+`)
var reFileInfo = regexp.MustCompile(`<div>[^.]+\.([^::]+):: ([^::]+) :: ([^.]+.[0-9]+) ([A-Za-z]{2,3})`)
var reFileInfo = regexp.MustCompile(`<div>[^.]+\.(\w+)\s*:: ([^::]+) :: ([^.]+.[0-9]+) ([A-Za-z]{2,3})`)
var reSourceURL = regexp.MustCompile(`<img id="img" src="([^"]+)`)

type extractor struct{}
Expand Down Expand Up @@ -69,10 +69,6 @@ func parseURL(URL string) []string {
}

func extractData(URL string) ([]*static.Data, error) {
if !strings.Contains(URL, "?nw=session") {
URL = URL + "?nw=session"
}

htmlString, err := request.Get(URL)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions extractors/htdoujin/htdoujin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestParseURL(t *testing.T) {
URL string
Want int
}{
/*{
{
Name: "Single Gallery HentaiEra",
URL: "https://hentaiera.com/gallery/150354/",
Want: 1,
Expand All @@ -26,7 +26,7 @@ func TestParseURL(t *testing.T) {
Name: "Tag HentaiEra",
URL: "https://hentaiera.com/tag/ahegao/",
Want: 25,
},*/{
}, {
Name: "Single Gallery HentaiEnvy",
URL: "https://hentaienvy.com/gallery/808735/",
Want: 1,
Expand Down Expand Up @@ -91,15 +91,15 @@ func TestExtract(t *testing.T) {
Name string
Args test.Args
}{
/*{
{
Name: "Single Gallery HentaiEra",
Args: test.Args{
URL: "https://hentaiera.com/gallery/610929/",
Title: "Senran Princess G",
Quality: "",
Size: 0,
},
},*/
},
{
Name: "Single Gallery HentaiEnvy",
Args: test.Args{
Expand Down

0 comments on commit 65c1fce

Please sign in to comment.