aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/videos/captions.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-21 16:28:39 +0200
committerChocobozzz <me@florianbigard.com>2021-10-22 10:25:24 +0200
commit62549e6c9818f422698f030e0b242609115493ed (patch)
tree12a969f694239fe5f926f779698df9523605ee80 /shared/extra-utils/videos/captions.ts
parenta71d4140a5b7831dbe2eb7a0dfaa6a755cb2e906 (diff)
downloadPeerTube-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.ts8
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'
2import request from 'supertest' 2import request from 'supertest'
3import { HttpStatusCode } from '@shared/models' 3import { HttpStatusCode } from '@shared/models'
4 4
5async function testCaptionFile (url: string, captionPath: string, containsString: string) { 5async 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// ---------------------------------------------------------------------------