Migration 0041_rate_limit adds rate_limit_bucket. PgTokenBucket (@umt/db) refills and takes tokens under SELECT ... FOR UPDATE on the DB clock and polls with jitter within a wait budget; penalize() carries Retry-After. Site adapters get createSharedSiteRateLimiter (key site:<id>), shared by api / worker / worker:agent, with an in-process serial queue in front and a local fallback when the bucket is unavailable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
107 lines
2.7 KiB
TypeScript
107 lines
2.7 KiB
TypeScript
export {
|
|
audiencesDefinition,
|
|
BUILTIN_SITE_DEFINITIONS,
|
|
chdbitsDefinition,
|
|
DefinitionProvenanceSchema,
|
|
hhanclubDefinition,
|
|
IndexerDefinitionSchema,
|
|
loadIndexerDefinition,
|
|
loadSiteDefinition,
|
|
MteamDefinitionSchema,
|
|
parseIndexerDefinition,
|
|
parseMteamDefinition,
|
|
parseSpecializedSiteDefinition,
|
|
SpecializedSiteDefinitionSchema,
|
|
SpiderFieldSelectorSchema,
|
|
SpiderFilterSchema,
|
|
} from "./definitions/index.ts";
|
|
export type { SiteAdapterDeps } from "./deps.ts";
|
|
export {
|
|
classifyLoginError,
|
|
loginFailureText,
|
|
loginNexusPhp,
|
|
type NexusLoginForm,
|
|
type NexusLoginInput,
|
|
type NexusLoginResult,
|
|
SiteLoginError,
|
|
type SiteLoginFailure,
|
|
totpCode,
|
|
} from "./login/nexusphp.ts";
|
|
export { createMteamAdapter, mteamTorrentToRelease } from "./mteam/adapter.ts";
|
|
export { type MteamApiPath, mteamPost } from "./mteam/client.ts";
|
|
export { type MteamDefinition, mteamApiBase, mteamDefinition } from "./mteam/definition.ts";
|
|
export {
|
|
findImdbid,
|
|
getDownloadVolumeFactor,
|
|
getUploadVolumeFactor,
|
|
type MteamTorrentJson,
|
|
mteamSearchParams,
|
|
parseMteamResult,
|
|
} from "./mteam/spider.ts";
|
|
export {
|
|
createSharedSiteRateLimiter,
|
|
createSiteRateLimiter,
|
|
type RateLimiterOptions,
|
|
type SharedBucketPort,
|
|
type SharedRateLimiterOptions,
|
|
type SiteRateLimiter,
|
|
} from "./rate-limit.ts";
|
|
export {
|
|
createSiteAdapter,
|
|
getSiteAdapter,
|
|
getSiteDefinition,
|
|
listSiteDefinitions,
|
|
SITE_DEFINITIONS,
|
|
type SiteDefinition,
|
|
} from "./registry.ts";
|
|
export { clearSearchText, createSpiderSiteAdapter } from "./spider/adapter.ts";
|
|
export { parseDetailPage } from "./spider/detail.ts";
|
|
export { promotionFromFactors, spiderTorrentToRelease } from "./spider/map.ts";
|
|
export { mcSelect } from "./spider/mc-selector.ts";
|
|
export type {
|
|
DefinitionProvenance,
|
|
IndexerDefinition,
|
|
SpiderCategoryConfig,
|
|
SpiderCategoryItem,
|
|
SpiderFieldSelector,
|
|
SpiderFields,
|
|
SpiderFilter,
|
|
UmtSiteExtension,
|
|
} from "./spider/schema.ts";
|
|
export {
|
|
combineUrl,
|
|
type MediaKind,
|
|
type MpMediaType,
|
|
parseSizeMp,
|
|
resolveCategoryMediaType,
|
|
SiteSpider,
|
|
type SiteSpiderQuery,
|
|
type SpiderTorrent,
|
|
selectMediaCategories,
|
|
} from "./spider/spider.ts";
|
|
export * from "./spiders/index.ts";
|
|
export {
|
|
type DownloadTarget,
|
|
type HitAndRun,
|
|
type PromotionType,
|
|
type SecretResolver,
|
|
type SiteAdapter,
|
|
type SiteCallOptions,
|
|
type SiteCapabilities,
|
|
type SiteCategory,
|
|
type SiteCredentialKind,
|
|
SiteError,
|
|
type SiteErrorKind,
|
|
type SiteHealth,
|
|
type SiteHealthStatus,
|
|
type SiteKind,
|
|
type SiteListFilters,
|
|
type SitePage,
|
|
type SitePromotion,
|
|
type SiteRelease,
|
|
type SiteReleaseDetail,
|
|
staticSecretResolver,
|
|
} from "./types.ts";
|
|
export * from "./user-parsers/index.ts";
|
|
export { parseCount, parseSiteTime } from "./util.ts";
|