Skip to content

Commit

Permalink
Merge branch 'darkroom_09_01' into RFTW
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealKLH committed Sep 20, 2023
2 parents 9312f9f + cd198a4 commit 7b0ab28
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions pkg/api/scenes.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,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, "Has Preview")
outAttributes = append(outAttributes, "Rating 0")
Expand Down
2 changes: 2 additions & 0 deletions pkg/models/model_scene.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 "Has Preview":
Expand Down
14 changes: 6 additions & 8 deletions pkg/scrape/darkroomvr.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,18 @@ func DarkRoomVR(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out c
sc.Released = tmpDate.Format("YYYY-MM-DD")
})

// 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
base = strings.TrimPrefix(base, "/video/")
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:]
})

// Filenames (only a guess for now, according to the sample files)
suffixes := []string{"4k", "5k", "5k10", "6k", "7k", "960p", "1440p", "psvr_1440p"}
for _, suffix := range suffixes {
sc.Filenames = append(sc.Filenames, "release-"+sc.SiteID+"-"+suffix+".mp4")
}

// trailer details
sc.TrailerType = "load_json"
params := models.TrailerScrape{SceneUrl: `https://darkroomvr.com/api/vrplayer/video/detail/` + sc.SiteID, RecordPath: "sources", ContentPath: "url", QualityPath: "title"}
Expand Down

0 comments on commit 7b0ab28

Please sign in to comment.