new: feat: add magnet-metadata-api post processor (#39)
* new: feat: add magnet-metadata-api post processor * chg: fix: lint issue * chg: chore: comment optional containers * chg: fix: remove redundant check
This commit is contained in:
@@ -21,7 +21,7 @@ var torrent_dos_filmes = IndexerMeta{
|
||||
Label: "torrent_dos_filmes",
|
||||
URL: "https://torrentdosfilmes.se/",
|
||||
SearchURL: "?s=",
|
||||
PagePattern: "page/%s",
|
||||
PagePattern: "category/dublado/page/%s",
|
||||
}
|
||||
|
||||
func (i *Indexer) HandlerTorrentDosFilmesIndexer(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -79,7 +79,7 @@ func (i *Indexer) HandlerTorrentDosFilmesIndexer(w http.ResponseWriter, r *http.
|
||||
})
|
||||
|
||||
// extract each torrent link
|
||||
indexedTorrents := utils.ParallelMap(links, func(link string) ([]schema.IndexedTorrent, error) {
|
||||
indexedTorrents := utils.ParallelFlatMap(links, func(link string) ([]schema.IndexedTorrent, error) {
|
||||
return getTorrentsTorrentDosFilmes(ctx, i, link)
|
||||
})
|
||||
|
||||
@@ -186,6 +186,11 @@ func getTorrentsTorrentDosFilmes(ctx context.Context, i *Indexer, link string) (
|
||||
if len(size) == len(magnetLinks) {
|
||||
mySize = size[it]
|
||||
}
|
||||
if mySize == "" {
|
||||
go func() {
|
||||
_, _ = i.magnetMetadataAPI.FetchMetadata(ctx, magnetLink)
|
||||
}()
|
||||
}
|
||||
|
||||
ixt := schema.IndexedTorrent{
|
||||
Title: releaseTitle,
|
||||
|
||||
Reference in New Issue
Block a user