mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add JSON scrape support (#717)
* Add support for scene fragment scrape in xpath
This commit is contained in:
@@ -8,17 +8,19 @@ const (
|
||||
scraperActionScript scraperAction = "script"
|
||||
scraperActionStash scraperAction = "stash"
|
||||
scraperActionXPath scraperAction = "scrapeXPath"
|
||||
scraperActionJson scraperAction = "scrapeJson"
|
||||
)
|
||||
|
||||
var allScraperAction = []scraperAction{
|
||||
scraperActionScript,
|
||||
scraperActionStash,
|
||||
scraperActionXPath,
|
||||
scraperActionJson,
|
||||
}
|
||||
|
||||
func (e scraperAction) IsValid() bool {
|
||||
switch e {
|
||||
case scraperActionScript, scraperActionStash, scraperActionXPath:
|
||||
case scraperActionScript, scraperActionStash, scraperActionXPath, scraperActionJson:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -47,6 +49,8 @@ func getScraper(scraper scraperTypeConfig, config config, globalConfig GlobalCon
|
||||
return newStashScraper(scraper, config, globalConfig)
|
||||
case scraperActionXPath:
|
||||
return newXpathScraper(scraper, config, globalConfig)
|
||||
case scraperActionJson:
|
||||
return newJsonScraper(scraper, config, globalConfig)
|
||||
}
|
||||
|
||||
panic("unknown scraper action: " + scraper.Action)
|
||||
|
||||
Reference in New Issue
Block a user