Brazen Framework - Subscriptions Loader

Account subscriptions manager for the Brazen user scripts framework

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/424516/1847310/Brazen%20Framework%20-%20Subscriptions%20Loader.js을(를) 사용하여 포함하는 라이브러리입니다.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

작성자
brazenvoid
버전
1.0.3
생성일
2021-04-05
갱신일
2026-06-09
크기
4.24KB
라이선스
GPL-3.0-only

Brazen Framework — Subscriptions Loader (developer guide)

Optional. Crawl logged-in subscription listing pages and cache channel names for a hide subscribed filter.

Greasy Fork: Subscriptions Loader · @require before Framework core


When to use

Sites where users subscribe to creators and you want to hide their content without maintaining a manual list. Requires the user to be logged in (isUserLoggedIn: true in framework config).


Setup

1. Framework wiring

// constructor
this._setupSubscriptionLoader()

// after loader exists — register one or more sources
this._subscriptionsLoader.addConfig({
  url: 'https://example.com/my/subscriptions',
  getPageCount: (sandbox) => /* int from first page DOM */,
  getPageUrl: (baseUrl, pageNo) => /* paginated URL */,
  subscriptionNameSelector: '.sub-name',
  subscriptionsCountSelector: '.sub-count',  // element whose page contains total count
})

2. Filter

this._addSubscriptionsFilter(
  () => true,  // exclusionsCallback — return false to skip filter on this page
  (item) => item.find('.uploader').text() || false,  // username or false to skip item
)

Registers:

  • FILTER_SUBSCRIBED_VIDEOS — flag Hide Subscribed Videos
  • STORE_SUBSCRIPTIONS — text field Account Subscriptions (cached names)

3. UI trigger

Framework _setupSubscriptionLoader creates button #subscriptions-loader (Load Subscriptions). Mount via _createSubscriptionLoaderControls() in your settings panel.

run() is invoked from that button when isUserLoggedIn() is true; otherwise an alert is shown.


addConfig shape (SubscriptionLoaderConfig)

Key Type Role
url string First page / index URL
getPageCount (sandbox: JQuery) => number Total pages (from count probe)
getPageUrl (baseUrl, pageNo) => string URL for page pageNo
subscriptionNameSelector string Selector for name text on each listing page
subscriptionsCountSelector string Selector loaded with url to read page count

Multiple configs: processed sequentially; names accumulate in one array.


run() behaviour

  1. Progress: Gathering subscriptions - 0% Complete
  2. Creates #brazen-subscriptions-loader-sandbox (hidden).
  3. For each config:
    • Load url + ' ' + subscriptionsCountSelector to probe page count.
    • getPageCount(sandbox)maxPage (ceiled).
    • For pageNo 1..maxPage: load full page, extract subscriptionNameSelector text (trimmed), push to array.
    • Progress: Gathering subscriptions - {percent}% Complete
  4. When all configs done: sandbox removed; callback with full string array.
  5. Framework handler formats names as quoted CSV in STORE_SUBSCRIPTIONS, calls save(), re-enables button.

Storage format in config field: "name1""name2""name3" (double-quote wrapped, concatenated). Filter matches via regex on username substring.

Included in normal config backup when persisted as the text field value.


Public API

Method Role
constructor(onProgressUpdate, onSubscriptionsGathered) Progress (status: string) => void; done (subscriptions: string[]) => void
addConfig(config) Append SubscriptionLoaderConfig; fluent
run() Start crawl (async via jQuery .load)

Grants

No grants on this module. jQuery .load() requires same-origin or CORS-permitted responses for subscription pages.

Requires: Framework core for _setupSubscriptionLoader and _addSubscriptionsFilter.