aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-01-15 15:56:56 +0100
committerGitHub <noreply@github.com>2021-01-15 15:56:56 +0100
commit454c20fa7cdb05eba7f1be3c83389b54807af0b3 (patch)
treee9b364da69eaf88f0470414c506c3b5631984c60 /shared/extra-utils
parentd43c6b1ffc5e6c895f9e9f9de6625f17a9755c20 (diff)
downloadPeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.gz
PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.tar.zst
PeerTube-454c20fa7cdb05eba7f1be3c83389b54807af0b3.zip
stricter youtubedl format selectors (#3516)
* stricter youtubedl format selectors make sure selectors avoid av1, and otherwise match as closely to the maximum resolution enabled for transcoding * add support for merge formats in youtubedl * avoid vp9.2 in youtubedl to avoid any HDR * move getEnabledResolutions, safer replace of imported extension * add test for youtube-dl selectors
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/videos/video-imports.ts24
1 files changed, 23 insertions, 1 deletions
diff --git a/shared/extra-utils/videos/video-imports.ts b/shared/extra-utils/videos/video-imports.ts
index 52e0075fb..259b8a314 100644
--- a/shared/extra-utils/videos/video-imports.ts
+++ b/shared/extra-utils/videos/video-imports.ts
@@ -4,7 +4,28 @@ import { makeGetRequest, makeUploadRequest } from '../requests/requests'
4import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 4import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5 5
6function getYoutubeVideoUrl () { 6function getYoutubeVideoUrl () {
7 return 'http://www.youtube.com/watch?v=msX3jv1XdvM' 7 return 'https://www.youtube.com/watch?v=msX3jv1XdvM'
8}
9
10function getYoutubeHDRVideoUrl () {
11 /**
12 * The video is used to check format-selection correctness wrt. HDR,
13 * which brings its own set of oddities outside of a MediaSource.
14 * FIXME: refactor once HDR is supported at playback
15 *
16 * The video needs to have the following format_ids:
17 * (which you can check by using `youtube-dl <url> -F`):
18 * - 303 (1080p webm vp9)
19 * - 299 (1080p mp4 avc1)
20 * - 335 (1080p webm vp9.2 HDR)
21 *
22 * 15 jan. 2021: TEST VIDEO NOT CURRENTLY PROVIDING
23 * - 400 (1080p mp4 av01)
24 * - 315 (2160p webm vp9 HDR)
25 * - 337 (2160p webm vp9.2 HDR)
26 * - 401 (2160p mp4 av01 HDR)
27 */
28 return 'https://www.youtube.com/watch?v=MSJ25EqI19c'
8} 29}
9 30
10function getMagnetURI () { 31function getMagnetURI () {
@@ -61,6 +82,7 @@ function getMyVideoImports (url: string, token: string, sort?: string) {
61export { 82export {
62 getBadVideoUrl, 83 getBadVideoUrl,
63 getYoutubeVideoUrl, 84 getYoutubeVideoUrl,
85 getYoutubeHDRVideoUrl,
64 importVideo, 86 importVideo,
65 getMagnetURI, 87 getMagnetURI,
66 getMyVideoImports, 88 getMyVideoImports,