new: feat: add bludv support

This commit is contained in:
2023-10-01 20:27:44 +00:00
parent ae124f4858
commit 67bf0cbf3e
5 changed files with 261 additions and 24 deletions

View File

@@ -6,12 +6,33 @@ import (
"time"
"github.com/felipemarinho97/torrent-indexer/cache"
"github.com/felipemarinho97/torrent-indexer/schema"
)
type Indexer struct {
redis *cache.Redis
}
type IndexerMeta struct {
URL string
SearchURL string
}
type IndexedTorrent struct {
Title string `json:"title"`
OriginalTitle string `json:"original_title"`
Details string `json:"details"`
Year string `json:"year"`
Audio []schema.Audio `json:"audio"`
MagnetLink string `json:"magnet_link"`
Date time.Time `json:"date"`
InfoHash string `json:"info_hash"`
Trackers []string `json:"trackers"`
Size string `json:"size"`
LeechCount int `json:"leech_count"`
SeedCount int `json:"seed_count"`
}
func NewIndexers(redis *cache.Redis) *Indexer {
return &Indexer{
redis: redis,
@@ -32,6 +53,13 @@ func HandlerIndex(w http.ResponseWriter, r *http.Request) {
"q": "search query",
},
},
"/indexers/bludv": map[string]interface{}{
"method": "GET",
"description": "Indexer for bludv",
"query_params": map[string]string{
"q": "search query",
},
},
},
})
}