Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.2.59 #155

Merged
merged 6 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (
var FakeHeaders = map[string]string{
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.8",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.3",
}

var FakeHeadersFirefox117 = map[string]string{
Expand Down
3 changes: 0 additions & 3 deletions downloader/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ func decrypt(key []byte, fileName string) ([]byte, error) {
}

iv := defaultIV(uint64(0))
if err != nil {
return nil, err
}
data, err = decryptAES128(data, key, iv)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion extractors/hentaifoundry/hentaifoundry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestParseURL(t *testing.T) {
}, {
Name: "Overview Category",
URL: "https://www.hentai-foundry.com/categories/372/Anime-and-Manga/Chobits/pictures",
Want: 15,
Want: 16,
},
}
config.Amount = 50
Expand Down
17 changes: 12 additions & 5 deletions extractors/hentaimama/hentaimama.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"regexp"
Expand Down Expand Up @@ -83,8 +84,8 @@ func extractData(URL string) (*static.Data, error) {
return nil, err
}

sources := make([]source, len(matchedMirrorURLs))
for i, u := range matchedMirrorURLs {
sources := []source{}
for _, u := range matchedMirrorURLs {
b64Path, err := base64.StdEncoding.DecodeString(u[1])
if err != nil {
return nil, err
Expand All @@ -97,10 +98,16 @@ func extractData(URL string) (*static.Data, error) {
}

reSrc := regexp.MustCompile(fmt.Sprintf(`[^"']*/%s[^"']*`, string(b64Paths[0])))
sources[i] = source{
URL: reSrc.FindString(htmlString),
Referer: u[0],
videoURL := reSrc.FindString(htmlString)
if videoURL == "" {
log.Printf("skipping broken source: %s", u)
continue
}
log.Println(htmlString)
sources = append(sources, source{
URL: videoURL,
Referer: u[0],
})
}

mirrorIdx := 0
Expand Down
21 changes: 9 additions & 12 deletions extractors/hentaimama/hentaimama_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,25 @@ func TestExtract(t *testing.T) {
{
Name: "Single Episode using HLS only",
Args: test.Args{
URL: "https://hentaimama.io/episodes/kuroinu-ii-animation-episode-1/",
Title: "Kuroinu II The Animation Episode 1",
Quality: "1280x720",
Size: 446315760,
URL: "https://hentaimama.io/episodes/kuroinu-ii-animation-episode-1/",
Title: "Kuroinu II The Animation Episode 1",
Size: 172537611,
},
},
{
Name: "Single Episode using a single mp4 file",
Args: test.Args{
URL: "https://hentaimama.io/episodes/ura-jutaijima-episode-1/",
Title: "Ura Jutaijima Episode 1",
Quality: "",
Size: 77530809,
URL: "https://hentaimama.io/episodes/ura-jutaijima-episode-1/",
Title: "Ura Jutaijima Episode 1",
Size: 77530809,
},
},
{
Name: "Single Episode using a both mp4 and HLS",
Args: test.Args{
URL: "https://hentaimama.io/episodes/torokase-orgasm-animation-episode-1/",
Title: "Torokase Orgasm The Animation Episode 1",
Quality: "1280x720",
Size: 427589832,
URL: "https://hentaimama.io/episodes/torokase-orgasm-animation-episode-1/",
Title: "Torokase Orgasm The Animation Episode 1",
Size: 186261816,
},
},
}
Expand Down
4 changes: 2 additions & 2 deletions extractors/iwara/iwara_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func TestExtract(t *testing.T) {
Args: test.Args{
URL: "https://www.iwara.tv/video/zwkobu5eevi17m309/14",
Title: "14.舞夜の侍奉Ⅱ💕",
Quality: "540p",
Size: 60567929,
Quality: "Source",
Size: 90608128,
},
},
{
Expand Down
203 changes: 188 additions & 15 deletions extractors/simplyhentai/simplyhentai.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"regexp"
"time"

"github.com/gan-of-culture/get-sauce/request"
"github.com/gan-of-culture/get-sauce/static"
Expand All @@ -26,28 +27,142 @@ type state struct {
Slug string `json:"slug"`
FlagCode string `json:"flag_code"`
} `json:"language"`
New bool `json:"new"`
Preview struct {
ID int `json:"id"`
PageNum int `json:"page_num"`
Sizes struct {
Full string `json:"full"`
SmallThumb string `json:"small_thumb"`
Thumb string `json:"thumb"`
GiantThumb string `json:"giant_thumb"`
} `json:"sizes"`
} `json:"preview"`
Reactions struct {
} `json:"reactions"`
Series struct {
AlbumCount int `json:"album_count"`
CommentCount int `json:"comment_count"`
ID int `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"series"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
}
}
} `json:"albums"`
Combinations struct {
Tags []struct {
ID int `json:"id"`
Letter string `json:"letter"`
ObjectCount int `json:"object_count"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"tags"`
} `json:"combinations"`
CreatedAt time.Time `json:"created_at"`
Description string `json:"description"`
ID int `json:"id"`
Interactions struct {
Downvotes int `json:"downvotes"`
Subscriptions int `json:"subscriptions"`
Upvotes int `json:"upvotes"`
} `json:"interactions"`
Letter string `json:"letter"`
ObjectCount int `json:"object_count"`
Preview struct {
ID int `json:"id"`
PageNum int `json:"page_num"`
Sizes struct {
Full string `json:"full"`
SmallThumb string `json:"small_thumb"`
Thumb string `json:"thumb"`
GiantThumb string `json:"giant_thumb"`
} `json:"sizes"`
} `json:"preview"`
Redirected bool `json:"redirected"`
Related interface{} `json:"related"`
Series interface{} `json:"series"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
Views int `json:"views"`
} `json:"tag"`
Manga struct {
Description interface{} `json:"description"`
ID int `json:"id"`
ImageCount int `json:"image_count"`
Language struct {
Anijunky struct {
Slug string `json:"slug"`
Banner struct {
ID int `json:"id"`
ImageType string `json:"image_type"`
Jpg struct {
Original string `json:"original"`
} `json:"jpg"`
Webp struct {
Original string `json:"original"`
} `json:"webp"`
} `json:"banner"`
Cover struct {
ID int `json:"id"`
ImageType string `json:"image_type"`
Jpg struct {
Original string `json:"original"`
Full string `json:"full"`
Thumb string `json:"thumb"`
Small string `json:"small"`
} `json:"jpg"`
Webp struct {
Original string `json:"original"`
Full string `json:"full"`
Thumb string `json:"thumb"`
Small string `json:"small"`
} `json:"webp"`
} `json:"cover"`
Description string `json:"description"`
Native string `json:"native"`
Romaji string `json:"romaji"`
Synonyms []string `json:"synonyms"`
Title string `json:"title"`
} `json:"anijunky"`
CommentCount int `json:"comment_count"`
CreatedAt time.Time `json:"created_at"`
Description interface{} `json:"description"`
ID int `json:"id"`
ImageCount int `json:"image_count"`
Images []struct {
ID int `json:"id"`
PageNum int `json:"page_num"`
Sizes struct {
Full string `json:"full"`
SmallThumb string `json:"small_thumb"`
Thumb string `json:"thumb"`
GiantThumb string `json:"giant_thumb"`
} `json:"sizes"`
} `json:"images"`
Interactions struct {
Downvotes int `json:"downvotes"`
Favorites int `json:"favorites"`
Reactions struct {
} `json:"reactions"`
Upvotes int `json:"upvotes"`
} `json:"interactions"`
Language struct {
Name string `json:"name"`
Slug string `json:"slug"`
FlagCode string `json:"flag_code"`
} `json:"language"`
Images []struct {
New bool `json:"new"`
OtherLanguages []interface{} `json:"other_languages"`
Parodies []struct {
ID int `json:"id"`
Letter string `json:"letter"`
ObjectCount int `json:"object_count"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"parodies"`
Preview struct {
ID int `json:"id"`
PageNum int `json:"page_num"`
Sizes struct {
Expand All @@ -56,21 +171,79 @@ type state struct {
Thumb string `json:"thumb"`
GiantThumb string `json:"giant_thumb"`
} `json:"sizes"`
} `json:"images"`
Slug string `json:"slug"`
} `json:"preview"`
Reactions struct {
} `json:"reactions"`
Redirected bool `json:"redirected"`
Related []struct {
CommentCount int `json:"comment_count"`
Description interface{} `json:"description"`
ID int `json:"id"`
ImageCount int `json:"image_count"`
Language struct {
Name string `json:"name"`
Slug string `json:"slug"`
FlagCode string `json:"flag_code"`
} `json:"language"`
New bool `json:"new"`
Preview struct {
ID int `json:"id"`
PageNum int `json:"page_num"`
Sizes struct {
Full string `json:"full"`
SmallThumb string `json:"small_thumb"`
Thumb string `json:"thumb"`
GiantThumb string `json:"giant_thumb"`
} `json:"sizes"`
} `json:"preview"`
Reactions struct {
} `json:"reactions"`
Series struct {
AlbumCount int `json:"album_count"`
CommentCount int `json:"comment_count"`
ID int `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"series"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"related"`
Series struct {
AlbumCount int `json:"album_count"`
CommentCount int `json:"comment_count"`
ID int `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"series"`
Slug string `json:"slug"`
Tags []struct {
ID int `json:"id"`
Letter string `json:"letter"`
ObjectCount int `json:"object_count"`
Slug string `json:"slug"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"tags"`
Title string `json:"title"`
Type string `json:"type"`
} `json:"manga"`
Meta struct {
Title string `json:"title"`
Description string `json:"description"`
} `json:"meta"`
} `json:"pageProps"`
} `json:"props"`
Page string `json:"page"`
Query struct {
Series string `json:"series"`
Slug string `json:"slug"`
Type string `json:"type"`
Slug string `json:"slug"`
} `json:"query"`
BuildID string `json:"buildId"`
IsFallback bool `json:"isFallback"`
DynamicIds []int `json:"dynamicIds"`
CustomServer bool `json:"customServer"`
Gip bool `json:"gip"`
AppGip bool `json:"appGip"`
ScriptLoader []interface{} `json:"scriptLoader"`
}

const site = "https://www.simply-hentai.com/"
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module github.com/gan-of-culture/get-sauce

go 1.22
go 1.23

require (
github.com/andybalholm/brotli v1.0.6
github.com/andybalholm/brotli v1.1.0
github.com/gan-of-culture/jsurl v0.0.0-20221216084718-9978d7873326
github.com/schollz/progressbar/v3 v3.13.1
github.com/schollz/progressbar/v3 v3.16.1
)

require (
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/pkg/errors v0.9.1
github.com/rivo/uniseg v0.4.4 // indirect
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6
golang.org/x/sys v0.26.0 // indirect
golang.org/x/term v0.25.0 // indirect
)
Loading
Loading