Skip to content

Commit

Permalink
[extractor:hentaimama] more skipping of broken sources
Browse files Browse the repository at this point in the history
  • Loading branch information
gan-of-culture committed Oct 15, 2024
1 parent 62365a3 commit 1cc488b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions extractors/hentaimama/hentaimama.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func extractData(URL string) (*static.Data, error) {
log.Printf("skipping broken source: %s", u)
continue
}
log.Println(htmlString)
sources = append(sources, source{
URL: videoURL,
Referer: u[0],
Expand All @@ -121,7 +120,9 @@ func extractData(URL string) (*static.Data, error) {

streams, err = hls.Extract(src.URL, map[string]string{"Referer": src.Referer})
if err != nil {
return nil, err
log.Println(err)
log.Printf("skipping broken source: %s", src.URL)
continue
}

mirrorIdx += 1
Expand All @@ -132,6 +133,9 @@ func extractData(URL string) (*static.Data, error) {
}

idx := len(streams) - 1
if idx == -1 {
streams = make(map[string]*static.Stream)
}
// resolve other URLs
for _, src := range sources {
ext := strings.TrimSuffix(utils.GetLastItemString(reExt.FindStringSubmatch(src.URL)), "?")
Expand All @@ -150,6 +154,8 @@ func extractData(URL string) (*static.Data, error) {

idx += 1
mirrorIdx += 1
log.Println(streams)
log.Println(idx)
streams[fmt.Sprint(idx)] = &static.Stream{
Type: static.DataTypeVideo,
URLs: []*static.URL{
Expand All @@ -158,8 +164,9 @@ func extractData(URL string) (*static.Data, error) {
Ext: ext,
},
},
Size: size,
Info: fmt.Sprintf("Mirror %d", mirrorIdx),
Size: size,
Info: fmt.Sprintf("Mirror %d", mirrorIdx),
Headers: map[string]string{},
}
continue
}
Expand Down

0 comments on commit 1cc488b

Please sign in to comment.