diff --git a/pkg/api/scenes.go b/pkg/api/scenes.go index 306c32fe4..e0e446e54 100644 --- a/pkg/api/scenes.go +++ b/pkg/api/scenes.go @@ -326,6 +326,7 @@ func (i SceneResource) getFilters(req *restful.Request, resp *restful.Response) outAttributes = append(outAttributes, "Has Simple Cuepoints") outAttributes = append(outAttributes, "Has HSP Cuepoints") outAttributes = append(outAttributes, "In Trailer List") + outAttributes = append(outAttributes, "Has Preview") outAttributes = append(outAttributes, "Has Subscription") outAttributes = append(outAttributes, "Rating 0") outAttributes = append(outAttributes, "Rating .5") diff --git a/pkg/models/model_scene.go b/pkg/models/model_scene.go index acad6d58f..3865f1e28 100644 --- a/pkg/models/model_scene.go +++ b/pkg/models/model_scene.go @@ -756,6 +756,8 @@ func queryScenes(db *gorm.DB, r RequestSceneList) (*gorm.DB, *gorm.DB) { where = "exists (select 1 from scene_cuepoints where scene_cuepoints.scene_id = scenes.id and track is not null)" case "In Trailer List": where = "trailerlist = 1" + case "Has Preview": + where = "has_video_preview = 1" case "Has Subscription": where = "is_subscribed = 1" case "Rating": diff --git a/pkg/scrape/darkroomvr.go b/pkg/scrape/darkroomvr.go index 623093e8b..ff2a7e5f7 100644 --- a/pkg/scrape/darkroomvr.go +++ b/pkg/scrape/darkroomvr.go @@ -80,6 +80,12 @@ func DarkRoomVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out c sc.Released = tmpDate.Format("YYYY-MM-DD") }) + // Scene ID + e.ForEach(`a[href*="signup.php?vid"]`, func(id int, e *colly.HTMLElement) { + url := e.Attr("href") + sc.SiteID = url[strings.LastIndex(url, "=")+1:] + }) + // Filenames (only a guess for now, according to the sample files) suffixes := []string{"4k", "5k", "5k10", "6k", "7k", "960p", "1440p", "psvr_1440p"} base := e.Request.URL.Path @@ -87,12 +93,11 @@ func DarkRoomVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out c for _, suffix := range suffixes { sc.Filenames = append(sc.Filenames, "drvr-"+base+"-"+suffix+"_180_LR.mp4") } - - // Scene ID - e.ForEach(`a[href*="signup.php?vid"]`, func(id int, e *colly.HTMLElement) { - url := e.Attr("href") - sc.SiteID = url[strings.LastIndex(url, "=")+1:] - }) + release := strings.TrimSuffix(e.ChildAttr(`meta[property="og:video"]`, "content"), "-ws_4k.mp4") + relname := release[strings.LastIndex(release, "/")+1:] + for _, suffix := range suffixes { + sc.Filenames = append(sc.Filenames, relname+"-"+suffix+".mp4") + } // trailer details sc.TrailerType = "load_json"