From a46e04358aefcb3ff8ad861a95f536bc03b3d31a Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 28 Oct 2024 15:14:36 +0600 Subject: [PATCH] api/match-action: rename `isM3U8` to `isHLS` and `u` to `url` --- api/src/processing/match-action.js | 18 +++++++++--------- api/src/processing/request.js | 4 ++-- api/src/processing/services/bluesky.js | 2 +- api/src/processing/services/dailymotion.js | 2 +- api/src/processing/services/rutube.js | 2 +- api/src/processing/services/vimeo.js | 2 +- api/src/stream/manage.js | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/src/processing/match-action.js b/api/src/processing/match-action.js index 31d12e7f..578a5218 100644 --- a/api/src/processing/match-action.js +++ b/api/src/processing/match-action.js @@ -9,7 +9,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab let action, responseType = "tunnel", defaultParams = { - u: r.urls, + url: r.urls, headers: r.headers, service: host, filename: r.filenameAttributes ? @@ -24,7 +24,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab else if (r.isGif && twitterGif) action = "gif"; else if (isAudioOnly) action = "audio"; else if (isAudioMuted) action = "muteVideo"; - else if (r.isM3U8) action = "m3u8"; + else if (r.isHLS) action = "hls"; else action = "video"; if (action === "picker" || action === "audio") { @@ -54,7 +54,7 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab params = { type: "gif" }; break; - case "m3u8": + case "hls": params = { type: Array.isArray(r.urls) ? "merge" : "remux" } @@ -62,12 +62,12 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab case "muteVideo": let muteType = "mute"; - if (Array.isArray(r.urls) && !r.isM3U8) { + if (Array.isArray(r.urls) && !r.isHLS) { muteType = "proxy"; } params = { type: muteType, - u: Array.isArray(r.urls) ? r.urls[0] : r.urls + url: Array.isArray(r.urls) ? r.urls[0] : r.urls } if (host === "reddit" && r.typeId === "redirect") { responseType = "redirect"; @@ -92,10 +92,10 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab } params = { picker: r.picker, - u: createStream({ + url: createStream({ service: "tiktok", type: audioStreamType, - u: r.urls, + url: r.urls, headers: r.headers, filename: r.audioFilename, isAudioOnly: true, @@ -184,14 +184,14 @@ export default function({ r, host, audioFormat, isAudioOnly, isAudioMuted, disab } } - if (r.isM3U8 || host === "vimeo") { + if (r.isHLS || host === "vimeo") { copy = false; processType = "audio"; } params = { type: processType, - u: Array.isArray(r.urls) ? r.urls[1] : r.urls, + url: Array.isArray(r.urls) ? r.urls[1] : r.urls, audioBitrate, audioCopy: copy, diff --git a/api/src/processing/request.js b/api/src/processing/request.js index 4287267c..d512bfe5 100644 --- a/api/src/processing/request.js +++ b/api/src/processing/request.js @@ -37,7 +37,7 @@ export function createResponse(responseType, responseData) { case "redirect": response = { - url: responseData?.u, + url: responseData?.url, filename: responseData?.filename } break; @@ -52,7 +52,7 @@ export function createResponse(responseType, responseData) { case "picker": response = { picker: responseData?.picker, - audio: responseData?.u, + audio: responseData?.url, audioFilename: responseData?.filename } break; diff --git a/api/src/processing/services/bluesky.js b/api/src/processing/services/bluesky.js index 5f5cbcec..d200296c 100644 --- a/api/src/processing/services/bluesky.js +++ b/api/src/processing/services/bluesky.js @@ -26,7 +26,7 @@ const extractVideo = async ({ media, filename }) => { urls: videoURL, filename: `${filename}.mp4`, audioFilename: `${filename}_audio`, - isM3U8: true, + isHLS: true, } } diff --git a/api/src/processing/services/dailymotion.js b/api/src/processing/services/dailymotion.js index a403a16b..a30a8bc7 100644 --- a/api/src/processing/services/dailymotion.js +++ b/api/src/processing/services/dailymotion.js @@ -92,7 +92,7 @@ export default async function({ id }) { return { urls: bestQuality.uri, - isM3U8: true, + isHLS: true, filenameAttributes: { service: 'dailymotion', id: media.xid, diff --git a/api/src/processing/services/rutube.js b/api/src/processing/services/rutube.js index 4305241a..67609ffc 100644 --- a/api/src/processing/services/rutube.js +++ b/api/src/processing/services/rutube.js @@ -65,7 +65,7 @@ export default async function(obj) { return { urls: matchingQuality.uri, - isM3U8: true, + isHLS: true, filenameAttributes: { service: "rutube", id: obj.id, diff --git a/api/src/processing/services/vimeo.js b/api/src/processing/services/vimeo.js index 23e84191..0268e1ec 100644 --- a/api/src/processing/services/vimeo.js +++ b/api/src/processing/services/vimeo.js @@ -122,7 +122,7 @@ const getHLS = async (configURL, obj) => { return { urls, - isM3U8: true, + isHLS: true, filenameAttributes: { resolution: `${bestQuality.resolution.width}x${bestQuality.resolution.height}`, qualityLabel: `${resolutionMatch[bestQuality.resolution.width]}p`, diff --git a/api/src/stream/manage.js b/api/src/stream/manage.js index e25f4434..557caa55 100644 --- a/api/src/stream/manage.js +++ b/api/src/stream/manage.js @@ -34,7 +34,7 @@ export function createStream(obj) { streamData = { exp: exp, type: obj.type, - urls: obj.u, + urls: obj.url, service: obj.service, filename: obj.filename,