diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-21 16:28:39 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-22 10:25:24 +0200 |
commit | 62549e6c9818f422698f030e0b242609115493ed (patch) | |
tree | 12a969f694239fe5f926f779698df9523605ee80 /shared/extra-utils/videos/captions.ts | |
parent | a71d4140a5b7831dbe2eb7a0dfaa6a755cb2e906 (diff) | |
download | PeerTube-62549e6c9818f422698f030e0b242609115493ed.tar.gz PeerTube-62549e6c9818f422698f030e0b242609115493ed.tar.zst PeerTube-62549e6c9818f422698f030e0b242609115493ed.zip |
Rewrite youtube-dl import
Use python3 binary
Allows to use a custom youtube-dl release URL
Allows to use yt-dlp (youtube-dl fork)
Remove proxy config from configuration to use HTTP_PROXY and HTTPS_PROXY
env variables
Diffstat (limited to 'shared/extra-utils/videos/captions.ts')
-rw-r--r-- | shared/extra-utils/videos/captions.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/shared/extra-utils/videos/captions.ts b/shared/extra-utils/videos/captions.ts index fc44cd250..35e722408 100644 --- a/shared/extra-utils/videos/captions.ts +++ b/shared/extra-utils/videos/captions.ts | |||
@@ -2,12 +2,16 @@ import { expect } from 'chai' | |||
2 | import request from 'supertest' | 2 | import request from 'supertest' |
3 | import { HttpStatusCode } from '@shared/models' | 3 | import { HttpStatusCode } from '@shared/models' |
4 | 4 | ||
5 | async function testCaptionFile (url: string, captionPath: string, containsString: string) { | 5 | async function testCaptionFile (url: string, captionPath: string, toTest: RegExp | string) { |
6 | const res = await request(url) | 6 | const res = await request(url) |
7 | .get(captionPath) | 7 | .get(captionPath) |
8 | .expect(HttpStatusCode.OK_200) | 8 | .expect(HttpStatusCode.OK_200) |
9 | 9 | ||
10 | expect(res.text).to.contain(containsString) | 10 | if (toTest instanceof RegExp) { |
11 | expect(res.text).to.match(toTest) | ||
12 | } else { | ||
13 | expect(res.text).to.contain(toTest) | ||
14 | } | ||
11 | } | 15 | } |
12 | 16 | ||
13 | // --------------------------------------------------------------------------- | 17 | // --------------------------------------------------------------------------- |