Floatplane channel plugin for Jellyfin 10.10.x: browse, HLS proxy, cookie session, CI release
Some checks failed
release / build-release (push) Has been cancelled
Some checks failed
release / build-release (push) Has been cancelled
- 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>
This commit is contained in:
74
doc/research/reference-sources/fpts_creator.ts
Normal file
74
doc/research/reference-sources/fpts_creator.ts
Normal file
@@ -0,0 +1,74 @@
|
||||
import { Core } from "./Core.js";
|
||||
|
||||
import type { OptionalOnly } from "@inrixia/helpers";
|
||||
import { type components, type operations, ApiPaths } from "./lib/apiSchema.js";
|
||||
|
||||
export type BlogPost = components["schemas"]["BlogPostModelV3"];
|
||||
type BlogPostQueryParams = operations["getCreatorBlogPosts"]["parameters"]["query"];
|
||||
|
||||
export type CreatorInfo = components["schemas"]["CreatorModelV2"];
|
||||
type CreatorQueryParams = operations["getInfo"]["parameters"]["query"];
|
||||
|
||||
export type CreatorChannel = components["schemas"]["ChannelModel"];
|
||||
type CreatorChannelsQueryParams = operations["listCreatorChannelsV3"]["parameters"]["query"];
|
||||
export class Creator extends Core {
|
||||
/**
|
||||
* Fetch blogPosts from a creator, returns a Async Iterator.
|
||||
*/
|
||||
async *blogPostsIterable(creatorGUID: string, options?: Omit<OptionalOnly<BlogPostQueryParams>, "fetchAfter">): AsyncIterableIterator<BlogPost> {
|
||||
let fetchAfter = 0;
|
||||
let blogPosts = await this.blogPosts(creatorGUID, { ...options, fetchAfter });
|
||||
while (blogPosts.length > 0) {
|
||||
yield* blogPosts;
|
||||
fetchAfter += 20;
|
||||
blogPosts = await this.blogPosts(creatorGUID, { ...options, fetchAfter });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch blogPosts from a creator.
|
||||
*/
|
||||
blogPosts = (creatorGUID: BlogPostQueryParams["id"], options?: OptionalOnly<BlogPostQueryParams>): Promise<BlogPost[]> => {
|
||||
const url = new URL(this.baseUrl + ApiPaths.getCreatorBlogPosts);
|
||||
url.searchParams.append("id", creatorGUID);
|
||||
if (options !== undefined) {
|
||||
const { limit, fetchAfter, search, tags, hasVideo, hasAudio, hasPicture, hasText, sort, fromDuration, toDuration, fromDate, toDate, channel } = options;
|
||||
if (channel !== undefined) url.searchParams.append("channel", channel.toString());
|
||||
if (limit !== undefined) url.searchParams.append("limit", limit.toString());
|
||||
if (fetchAfter !== undefined) url.searchParams.append("fetchAfter", fetchAfter.toString());
|
||||
if (search !== undefined) url.searchParams.append("search", search);
|
||||
if (tags !== undefined) url.searchParams.append("tags", tags.join(","));
|
||||
|
||||
if (hasVideo !== undefined) url.searchParams.append("hasVideo", hasVideo.toString());
|
||||
if (hasAudio !== undefined) url.searchParams.append("hasAudio", hasAudio.toString());
|
||||
if (hasPicture !== undefined) url.searchParams.append("hasPicture", hasPicture.toString());
|
||||
if (hasText !== undefined) {
|
||||
if (hasVideo === true) throw new Error("hasVideo cannot be true if hasText is true");
|
||||
if (hasAudio === true) throw new Error("hasAudio cannot be true if hasText is true");
|
||||
if (hasPicture === true) throw new Error("hasPicture cannot be true if hasText is true");
|
||||
url.searchParams.append("hasText", hasText.toString());
|
||||
}
|
||||
|
||||
if (sort !== undefined) url.searchParams.append("sort", sort);
|
||||
|
||||
if (fromDuration !== undefined) {
|
||||
if (hasVideo !== true) throw new Error("hasVideo must be true if fromDuration is set");
|
||||
url.searchParams.append("fromDuration", fromDuration.toString());
|
||||
}
|
||||
if (toDuration !== undefined) {
|
||||
if (hasVideo !== true) throw new Error("hasVideo must be true if toDuration is set");
|
||||
url.searchParams.append("toDuration", toDuration.toString());
|
||||
}
|
||||
|
||||
if (fromDate !== undefined) url.searchParams.append("fromDate", fromDate.toString());
|
||||
if (toDate !== undefined) url.searchParams.append("toDate", toDate.toString());
|
||||
}
|
||||
return this.got(url.href).json();
|
||||
};
|
||||
|
||||
info = (creatorGUID: CreatorQueryParams["creatorGUID"]): Promise<CreatorInfo[]> =>
|
||||
this.got(`${this.baseUrl}${ApiPaths.getInfo}?creatorGUID=${creatorGUID}`).json();
|
||||
|
||||
channels = (creatorGUID: CreatorChannelsQueryParams["ids"]): Promise<CreatorChannel[]> =>
|
||||
this.got(`${this.baseUrl}${ApiPaths.listCreatorChannelsV3}?ids=${creatorGUID}`).json();
|
||||
}
|
||||
Reference in New Issue
Block a user