From 62549e6c9818f422698f030e0b242609115493ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 21 Oct 2021 16:28:39 +0200 Subject: 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 --- shared/extra-utils/videos/captions.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'shared/extra-utils/videos') 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' import request from 'supertest' import { HttpStatusCode } from '@shared/models' -async function testCaptionFile (url: string, captionPath: string, containsString: string) { +async function testCaptionFile (url: string, captionPath: string, toTest: RegExp | string) { const res = await request(url) .get(captionPath) .expect(HttpStatusCode.OK_200) - expect(res.text).to.contain(containsString) + if (toTest instanceof RegExp) { + expect(res.text).to.match(toTest) + } else { + expect(res.text).to.contain(toTest) + } } // --------------------------------------------------------------------------- -- cgit v1.2.3