Files
claude 9e33a343ab
Some checks failed
release / build-release (push) Has been cancelled
Floatplane channel plugin for Jellyfin 10.10.x: browse, HLS proxy, cookie session, CI release
- IChannel: creators -> sub-channels -> video posts (public listing API, search mapped)
- IRequiresMediaInfoCallback -> signed proxy URLs; stream controller rewrites HLS so the
  AES-128 key is fetched server-side with the session cookie, segments stay on the CDN
- delivery/info cached per token lifetime and throttled (~2/min)
- config page: paste sails.sid + validate, extra creators, quality, search test
- scripts/package.sh -> plugin folder + zip + md5 + manifest.json; Gitea release workflow
- research docs, HAR analysis (HAR itself gitignored), install-pi5.sh

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-25 09:42:27 +01:00

34 lines
1.5 KiB
TypeScript

import { Core } from "./Core.js";
import type { Options } from "got";
import { type components, type operations, ApiPaths } from "./lib/apiSchema.js";
export type GotOptions = Options & { isStream: true };
// V3
export type DeliveryResponse = components["schemas"]["CdnDeliveryV3Response"];
type QueryParams = operations["getDeliveryInfoV3"]["parameters"]["query"];
export class CDN extends Core {
/**
* Fetches resource information from cdn.
*
* @param scenario The scenario in which to consume the media.
* - `onDemand` = stream a Video/Audio On Demand
* - `download` = Download the content for the user to play later.
* - `live` = Livestream the content
* @param entityId The attachment or livestream identifier for the requested media. For video and audio, this would be from the `videoAttachments` or `audioAttachments` objects. For livestreams, this is the `liveStream.id` from the creator object.
* @param outputKind Use `outputKind` to ensure the right vehicle is used for your client, e.g. `outputKind=hls.fmp4` is optimal for tvOS 10+.
* @returns A promise that resolves to a `DeliveryResponse` object.
*/
delivery(scenario: QueryParams["scenario"], entityId: string, outputKind?: QueryParams["outputKind"]): Promise<DeliveryResponse> {
const url = new URL(this.baseUrl + ApiPaths.getDeliveryInfoV3);
url.searchParams.set("scenario", scenario);
url.searchParams.set("entityId", entityId);
if (outputKind !== undefined) url.searchParams.set("outputKind", outputKind);
return this.got(url.href).json();
}
}