dynamicseeding

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2025 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

实验性功能:动态保种。 自动从站点下载亟需保种(做种人数 < 10)的种子并做种。用户自行设置每个站点的总保种体积上限。 默认仅会下载免费的并且没有 HnR 的种子。 当前保种的种子如果没有断种风险(做种人数充足),会在需要时自动删除以腾出空间下载新的(亟需保种)种子。 使用方法:在 ptoo.toml 站点配置里增加 "dynamicSeedingSize = 100GiB" 设置总保种体积上限, 然后定时运行 ptool dynamicseeding <client> <site> 即可。 动态保种添加的种子会放到 dynamic-seeding-<site> 分类里并且打上 site:<site> 标签。 用户也可以将手工下载的该站点种子放到该分类里(也需要打上 site:<site> 标签)以让动态保种管理。 @todo : 动态保种种子的辅种,有辅种的种子删除时保留文件。

Index

Constants

View Source
const IGNORE_FILE_SIZE = 100
View Source
const INACTIVITY_TIMESPAN = 3600 * 3 // If incomplete torrent has no activity for enough time, abort.
View Source
const MAX_PARALLEL_DOWNLOAD = 3
View Source
const MAX_SCANNED_TORRENTS = 1000
View Source
const MAX_SEEDERS = 10

site torrent which current seeders >= MAX_SEEDERS will NOT be added; client torrent which current seeders (including self client) > MAX_SEEDERS could be safely deleted.

View Source
const MIN_FREE_REMAINING_TIME = 3600 * 3
View Source
const MIN_REPLACE_SEEDERS_DIFF = 3

Could replace a client seeding torrent with a new site torrent if their seeders diff >= this

View Source
const MIN_SEEDERS = 3

client torrent which current seeders <= MIN_SEEDERS will NEVER be deleted. client torrent that MIN_SEEDERS < current seeders <= MAX_SEEDERS may be deleted sometimes.

View Source
const MIN_SEEDING_TIME = 86400 * 10 // completed torrent will NOT be deleted during this time span. 10d
View Source
const MIN_SIZE = 10 * 1024 * 1024 * 1024 // minimal dynamicSeedingSize required. 10GiB

client torrent params

View Source
const MIN_TORRENT_AGE = 86400 * 15 // site torrent must be published before this time ago

site torrent params

View Source
const NEW_TORRENT_TIMESPAN = 3600

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	OverflowSpace     int64 // If torrents current total size is over limit, the overflow size.
	Timestamp         int64
	Sitename          string
	Size              int64
	DeleteTorrents    []*client.Torrent
	AddTorrents       []*site.Torrent
	AddTorrentsOption *client.TorrentOption
	Msg               string
	Log               string
}

func (*Result) Print

func (result *Result) Print(output io.Writer)

type TrackersStatus

type TrackersStatus int
const (
	TRACKER_UNKNOWN TrackersStatus = iota
	TRACKER_OK
	TRACKER_INVALID
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL