Skip to content

Commit

Permalink
Fixed issue with Invidious instance caption test
Browse files Browse the repository at this point in the history
  • Loading branch information
iBicha committed Nov 22, 2024
1 parent 8815c1e commit 1ccc17f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Bug where deleted channels cannot be removed from bookmarks
- Issue with Invidious instance caption test

## [0.29.2] - 2024-11-07

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,12 @@ end function

function CanFetchVideoCaptions(instance as string, testNode as object, cancellation as object) as void
try
videoId = "jNQXAC9IVRw"
' videoId = "jNQXAC9IVRw"
videoId = "k85mRPqvMbE"
label = "English"
' expectedText = `All right, so here we are, in front of the\nelephants`
expectedText = `Ding ding pch n daa, bam-ba-ba-re-bam`

url = `${instance}/api/v1/captions/${videoId}?label=${label}`
response = HttpClient.Get(url).NoCache().Cancellation(cancellation).Await()

Expand All @@ -242,7 +246,7 @@ function CanFetchVideoCaptions(instance as string, testNode as object, cancellat
return
end if

if text.InStr(`All right, so here we are, in front of the\nelephants`) = -1
if text.InStr(expectedText) = -1
testNode.state = "failed"
testNode.details = Tr(Locale.InvidiousTesting.ExpectedTextNotFoundInCaptionData).Replace("%1", url)
return
Expand Down

0 comments on commit 1ccc17f

Please sign in to comment.