mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-28 04:49:39 +00:00
feat(media): support extension media fetch
Thread extension-provided headers and cookies into Firelink media metadata loading so authenticated page fetches show the correct formats. Include those auth inputs in both metadata and yt-dlp info-json cache keys to prevent cross-session collisions, and advance the Firefox extension submodule to the published media-fetch commit.
This commit is contained in:
@@ -207,6 +207,8 @@ export const AddDownloadsModal = () => {
|
||||
cookieBrowser: browserArg,
|
||||
username: useAuth ? username.trim() || null : login?.username || null,
|
||||
password: useAuth ? password || null : keychainPassword,
|
||||
headers: headers?.trim() || null,
|
||||
cookies: cookies?.trim() || null,
|
||||
proxy
|
||||
});
|
||||
if (mediaData && mediaData.formats.length > 0) {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ type CommandMap = {
|
||||
result: MetadataResponse;
|
||||
};
|
||||
fetch_media_metadata: {
|
||||
args: { url: string; cookieBrowser: string | null; username: string | null; password: string | null; proxy: string | null };
|
||||
args: { url: string; cookieBrowser: string | null; username: string | null; password: string | null; headers: string | null; cookies: string | null; proxy: string | null };
|
||||
result: MediaMetadata;
|
||||
};
|
||||
get_aria2_engine_status: { args: undefined; result: EngineStatusItem };
|
||||
|
||||
@@ -6,13 +6,23 @@ type FetchMediaMetadataArgs = {
|
||||
cookieBrowser: string | null;
|
||||
username: string | null;
|
||||
password: string | null;
|
||||
headers: string | null;
|
||||
cookies: string | null;
|
||||
proxy: string | null;
|
||||
};
|
||||
|
||||
const inFlightMediaMetadata = new Map<string, Promise<MediaMetadata>>();
|
||||
|
||||
const metadataKey = (args: FetchMediaMetadataArgs) =>
|
||||
JSON.stringify([args.url, args.cookieBrowser, args.username, args.password, args.proxy]);
|
||||
JSON.stringify([
|
||||
args.url,
|
||||
args.cookieBrowser,
|
||||
args.username,
|
||||
args.password,
|
||||
args.headers,
|
||||
args.cookies,
|
||||
args.proxy
|
||||
]);
|
||||
|
||||
export const fetchMediaMetadataDeduped = (args: FetchMediaMetadataArgs): Promise<MediaMetadata> => {
|
||||
const key = metadataKey(args);
|
||||
|
||||
Reference in New Issue
Block a user