1732241632
2024-11-22 00:13:00
Broadcastarr は、Web ページから取得したメディア コンテンツをブロードキャストできるサービスです。
さまざまなアクションは、AgendaTS サービスによって処理されるタスクに分割されます。タスクは次のとおりです。
- カテゴリの公開 アクティブなカテゴリが公開されていることを確認し、アクティブなインデクサーごとにカテゴリのインデックス作成を開始します。
- インデックス カテゴリ 指定された各インデクサーのカテゴリにインデックスを付け、次のインデックス作成とブロードキャスト ストリームの取得をスケジュールします。
- ブロードキャスト ストリームの取得 カテゴリ内の各ブロードキャストのブロードキャスト ストリームを取得し、ブロードキャストのリリースをスケジュールします。
- ブロードキャストをリリース アクティブなリリーサーにブロードキャストをリリースし、関連するグループの公開をスケジュールします。
- グループの公開 グループをアクティブな発行者に公開します。
- カテゴリ チャネル名の更新 アクティブなパブリッシャーのカテゴリ チャネル名を更新します。
- ブロードキャストを削除 ブロードキャストを削除します。
Discord を介して対話とコマンドを処理します。認証が設定されていない場合、ボットは誰でも利用できるようになります。利用可能なコマンド:
- カテゴリを追加
- 追加ロール
- インデックスカテゴリー
- カテゴリを削除する
- セットカテゴリー絵文字
- セットコンフィグ
- セットグループ絵文字
- トグルグループ
- トグルインデクサー
リリーサーとはブロードキャストを閲覧できるサービスです。
実装されたリリーサー:
パブリッシャーは、カテゴリ、グループ、ブロードキャストをさまざまなプラットフォームに公開できるサービスです。
実装されたパブリッシャー:
このサービスはスケーラブルになるように設計されており、複数のインスタンスにデプロイできます。
Docker Compose には、ワーカーが VPN 経由で Web ページからブロードキャストをスクレイピングおよび取得できるようにする Wireguard クライアントが含まれています。使用される設定ファイルは ./wg0.conf です。
まず、env ファイルを作成し、正しい値を入力する必要があります。
cp .env.default .env
cp .env.init.default .env.init
次に、データベースを初期化してシャットダウンする必要があります。
docker compose up init
docker compose down init
ようやくサービスを開始できるようになります。
docker compose up -d server worker
さらに、構成ファイルに複数のワーカーを含めて、より多くのタスクを同時に処理することができます。
.env.init ファイル内:
- さまざまな遅延値を設定します (秒単位)。
- 制限値を設定します(分単位)。
- それぞれの絵文字を使用して作成するカテゴリを設定します。
CATEGORIES_EMOJI=Football:⚽,Basketball:🏀
- それぞれのカテゴリと国で作成するグループを設定します。
GROUPS="Football:France*Ligue 1,Spain*La Liga|Basketball:USA*NBA"
- Discord Webhook を有効に設定します。
DISCORD_WEBHOOKS="Football:id:token,Rugby:id:token"
インデクサーの定義を json ファイルとして ./src/init/data に追加します。
{ "name": string, "url": string, "active": boolean, // The data to configure the indexation "data": { "category": { // The links to retrieve the categories "links": Selector[], // When set, the lookup is a map category => strings to look for in the category name in the links textContent retrieved by the links selectors "lookups": Mapstring, string[]>, }, // Element to wait before looking for links "loadPageElement": string, // Broadcasts can be grouped by sets, in this case we start by looking for the day "broadcastSets": { // The selectors to retrieve the sets of broadcasts "selector": Selector[], // The selectors to retrieve the day "day": DateSelector[], // Some sites have a "today" string instead of the current date, in this case we need to replace it "today": { "regex": string, "format": string, }, }, // The selectors to retrieve the broadcasts, is run in the context of the set, or the page if not set "broadcast": { // The selectors to retrieve the broadcasts "selector": Selector[], // The selectors to retrieve the broadcast start time, is run in the context of the broadcast "startTime": DateSelector[], // The selectors to retrieve the broadcast link, is run in the context of the broadcast "link": TextContentSelector[], // The selectors to retrieve the broadcast title, is run in the context of the broadcast "name": TextContentSelector[], // The selectors to retrieve the broadcast group, is run in the context of the broadcast "group": RegexSelector[], }, // The selectors to retrieve the next page link, as long as there is a next page, and the broadcastSets start before the future limit, we go to the next page and continue the indexation "nextPage": Selector[], }, // The data to configure the grabbing "interceptorData": { // Element to wait before looking for stream items "loadPageElement": string, // The selectors to retrieve the stream items "streamItems": Selector[], // The selectors to retrieve the score of the broadcast, is run in the context of the stream item "positiveScores": Selector[], // The selectors to retrieve the link of the broadcast, is run in the context of the stream item "link": TextContentSelector[], // If set, we go to the link(s) previously found with a referer header "referer": string, // If set, we click on the items found (play button for instance) "clickButton": Selector[], } }
.env ファイルに正しい値を入力します。
- [] 単体テスト
- [] パブリッシャーをアクティブ化/非アクティブ化するための構成
- [] パブリッシャーをアクティブ化/非アクティブ化するための Discord ボット コマンド
- [] リリーサーを有効化/無効化するための設定
- [] リリーサーをアクティブ化/非アクティブ化するための Discord ボット コマンド
- [] TheSportsDB の動作 API
- [] プロキシが要求されたときにストリームをリロードするオプション
- [] リリースでのバージョン管理と変更ログの自動生成のためのスクリプト
- [] srcフォルダーをマウントしないdockerイメージを作成する
- [] スクリーンショットを使用してドキュメントを改善する
#BillosBroadcastarr #Jellyfin #インスタンスを通じて #Web #コンテンツをストリーミングする