TeleFileDB_DEMO / docs /07_Adding_Files_Strategy.md
3v324v23's picture
v1.0.3: Official release with bilingual docs, best practice guides, and project story
b0dfa8c
|
Raw
History Blame Contribute Delete
3.63 kB

📡 添加檔案與索引策略 / File Addition & Indexing Strategies

TeleFileDB+ 的核心設計理念是「穩定、安全、免流量」。我們強烈建議將數據傳輸交給官方 App,將管理與索引交給本系統。 The core philosophy of TeleFileDB+ is stability and security. We recommend using the official app for data transfer and this system for indexing.


1. 自動監聽模式 (免動手) / Automatic Monitoring Mode

這是最推薦的「無感同步」方式。 The most recommended hands-free sync method.

  • 操作步驟 / Steps
    1. 在環境變數 MONITORED_CHAT_ID 中填入您的資源群組 ID。
    2. 使用 Telegram 官方客戶端 上傳檔案,或將他人分享的檔案「轉發」到該群組。
  • 效果 / Result: 系統會自動捕捉新消息,檔案將秒速自動添加到 TeleFileDB+ 的「自動監聽」分類目錄下。 Files forwarded or uploaded to monitored groups in the official app will be indexed instantly.

2. 指令手動索引 (精準控制) / Manual Indexing via Commands

適用於您想自定義路徑,或不想將檔案轉發到監聽群組時。 Useful for custom paths or non-monitored chats.

  • 操作步驟 / Steps
    1. 在官方 App 中,將檔案發送給您的 Telegram Bot(或發送到任何 Bot 所在的群組)。
    2. 對著該檔案點擊「回覆 (Reply)」,輸入 /savdb
  • 效果 / Result: 檔案會被索引至 TeleFileDB+。默認存放於 root/savdb 目錄。 The file will be saved to the default root/savdb folder.

2.1 自定義參數與進階操作 / Custom Parameters & Advanced Usage

手動索引支援強大的參數自定義,讓您在手機端就能完成檔案整理。 Manual indexing supports powerful parameter customization for organizing files on the go.

  • 命令格式 / Usage/savdb [-m 資料夾] [-n 新檔名] [-b] [-i 數字]
  • 參數詳解 / Parameters:
    • -m <path>指定目錄。例如 /savdb -m movies/marvel 將檔案存入指定路徑。 Specify the target folder path.
    • -n <name>重新命名。例如 /savdb -n report 索引時自動更改文件名。 Rename the file during indexing.
    • -b:**批量索引相簿 (Batch)**。回覆相簿(Album)中任意一張圖片即可索引整個媒體組。 Index an entire media group (album) by replying to any single item in it.
    • -i <number>:**區間連續索引 (Interval)**。從目前回覆的消息開始,向後自動搜尋並索引指定數量的檔案。 Automatically scan and index N files starting from the replied message.
  • 範例 / Examples
    • /savdb -b -m vacation: 將整個相簿保存到 root/vacation
    • /savdb -i 10: 從此處開始連續索引後續發現的 10 個檔案。

⚠️ 安全與速度的終極秘訣 / Security & Speed Tips

  • 避開網頁端大檔案操作 / Avoid Large File Web Ops: 超過 20MB 的下載50MB 的上傳,請務必回歸官方客戶端操作。網頁端頻繁處理大檔案會導致長達 2000+ 秒的 API 限制。 Always use official apps for files >20MB (download) or >50MB (upload) to avoid 2000+s API limits.
  • 穩定性第一 / Stability First: 官方客戶端具備最強的斷點續傳和全球加速能力,是您添加大檔案的唯一穩定途徑。 The official client is the only stable way to handle large files due to its superior resume and acceleration features.