diff --git a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs index 6b2b1ae1..d5372c2c 100644 --- a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs +++ b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs @@ -107,6 +107,7 @@ namespace Invidious cacheSeconds = 18000 ' 5 hours cancellation = invalid tryCount = 2 + region = invalid if options <> invalid if options.DoesExist("cacheSeconds") @@ -118,6 +119,9 @@ namespace Invidious if options.DoesExist("tryCount") tryCount = options.tryCount end if + if options.DoesExist("region") + region = options.region + end if end if instance = m.GetInstance() @@ -125,6 +129,10 @@ namespace Invidious request = HttpClient.Get(url) + if not StringUtils.IsNullOrEmpty(region) + request.QueryParam("region", region) + end if + request.CacheSeconds(cacheSeconds) request.Cancellation(cancellation) diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs index 15d533fd..250d4b96 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs @@ -17,7 +17,7 @@ function VideoContentTask(input as object) as object service = new Invidious.InvidiousService(invidiousNode) - response = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation }) + response = service.GetVideoMetadata(contentNode.videoId, { region: "US", cancellation: m.top.cancellation }) if m.top.cancel return invalid diff --git a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs index 6aa967d0..1306355e 100644 --- a/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs +++ b/playlet-lib/src/components/Web/PlayletWebServer/Middleware/DashRouter.bs @@ -28,7 +28,7 @@ namespace Http return true end if - metadataRequest = m.invidiousService.GetVideoMetadata(v) + metadataRequest = m.invidiousService.GetVideoMetadata(v, { region: "US" }) if not metadataRequest.IsSuccess() response.Default(metadataRequest.StatusCode(), metadataRequest.ErrorMessage()) return true