new: feat: add bludv support
This commit is contained in:
28
api/index.go
28
api/index.go
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user