Skip to content

Commit

Permalink
scraper: Fix trailers for VRLatina (xbapps#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Nov 24, 2023
1 parent 7f6c3a8 commit 4f0bdb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/trailers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func ScrapeHtml(scrapeParams string) models.VideoSourceResponse {
origURLtmp := e.Attr(params.ContentPath)
quality := e.Attr(params.QualityPath)
if origURLtmp != "" {
if params.ContentBaseUrl != "" {
if params.ContentBaseUrl != "" && !strings.HasPrefix(origURLtmp, params.ContentBaseUrl) {
origURLtmp = params.ContentBaseUrl + origURLtmp
}
srcs = append(srcs, models.VideoSource{URL: origURLtmp, Quality: quality})
Expand Down Expand Up @@ -174,7 +174,7 @@ func extractFromJson(inputJson string, params models.TrailerScrape, srcs []model
if params.EncodingPath != "" {
encoding = gjson.Get(JsonMetadata, params.EncodingPath).String() + "-"
}
if params.ContentBaseUrl != "" {
if params.ContentBaseUrl != "" && !strings.HasPrefix(url, params.ContentBaseUrl) {
if params.ContentBaseUrl[len(params.ContentBaseUrl)-1:] == "/" && string(url[0]) == "/" {
url = params.ContentBaseUrl + url[1:]
} else {
Expand Down

0 comments on commit 4f0bdb5

Please sign in to comment.