Skip to content

sbr

Modules:

Classes:

Functions:

Attributes:

PRESETS module-attribute

PRESETS: list[PresetConfig] = [
    PresetConfig(
        "ads",
        "🛑 ADs",
        [
            "blackmatrix7:Advertising",
            "DustinWin/geosite-all:ads",
            "MetaCubeX/geosite:*-ads,*-ads-all,*@ads",
        ],
        [],
    ),
    PresetConfig(
        "private",
        "🔒 Private",
        [
            "blackmatrix7:Lan,NTPService",
            "DustinWin/geoip-all:private",
            "DustinWin/geosite-all:private",
            "MetaCubeX/geoip:private",
            "MetaCubeX/geosite:category-ntp*,private",
        ],
        ["preset:ads"],
    ),
    PresetConfig(
        "cn",
        "🇨🇳 CN",
        [
            "blackmatrix7:ChinaMax,Direct",
            "DustinWin/geoip-all:cn",
            "DustinWin/geosite-all:cn",
            "liblaf:cn",
            "MetaCubeX/geoip:cn",
            "MetaCubeX/geosite:cn,*-cn,*@cn",
        ],
        ["liblaf:!cn", "preset:ads", "preset:private"],
    ),
    PresetConfig(
        "proxy",
        "✈️ Proxy",
        [
            "blackmatrix7:Global",
            "DustinWin/geosite-all:proxy",
            "MetaCubeX/geosite:*!cn*",
        ],
        ["preset:ads", "preset:cn", "preset:private"],
    ),
    PresetConfig(
        "ai",
        "🤖 AI",
        [
            "blackmatrix7:Claude,Copilot,Gemini,OpenAI",
            "DustinWin/geosite-all:ai",
            "MetaCubeX/geosite:openai",
        ],
        ["preset:ads", "preset:cn", "preset:private"],
    ),
    PresetConfig(
        "download",
        "☁️ Download",
        [
            "blackmatrix7:Download,OneDrive",
            "MetaCubeX/geosite:onedrive",
        ],
        ["preset:ads", "preset:cn", "preset:private"],
    ),
    PresetConfig(
        "emby",
        "🍟 Emby",
        ["liblaf:emby", "NotSFC:Emby"],
        ["preset:ads", "preset:cn", "preset:private"],
    ),
    PresetConfig(
        "media",
        "📺 Media",
        [
            "blackmatrix7:GlobalMedia",
            "DustinWin/geosite-all:youtube",
            "MetaCubeX/geosite-lite:proxymedia,youtube",
            "MetaCubeX/geosite:youtube",
        ],
        ["preset:ads", "preset:cn", "preset:private"],
    ),
]

PresetConfig

Bases: NamedTuple

Attributes:

exclude instance-attribute

exclude: list[str]

id instance-attribute

id: str

include instance-attribute

include: list[str]

name instance-attribute

name: str

Rule

Bases: BaseModel

Methods:

Attributes:

domain class-attribute instance-attribute

domain: Set = set()

domain_keyword class-attribute instance-attribute

domain_keyword: Set = set()

domain_regex class-attribute instance-attribute

domain_regex: Set = set()

domain_suffix class-attribute instance-attribute

domain_suffix: Set = set()

ip_cidr class-attribute instance-attribute

ip_cidr: Set = set()

model_config class-attribute instance-attribute

model_config = ConfigDict(extra='forbid')

__getitem__

__getitem__(key: str) -> set[str]

__len__

__len__() -> int

__or__

__or__(other: Rule) -> Rule

__sub__

__sub__(other: Rule) -> Rule

difference

difference(*others: Rule) -> Rule

from_file classmethod

from_file(path: StrPath) -> Rule

geoip

geoip() -> Rule

geosite

geosite() -> Rule

op

op(op: Callable[[Any, Any], Any], other: Rule) -> Rule

optimize

optimize() -> None

save

save(path: StrPath) -> None

summary

summary() -> str

union

union(*others: Rule) -> Rule

RuleSet

Bases: BaseModel

Methods:

Attributes:

rules instance-attribute

rules: list[Rule]

version instance-attribute

version: Literal[1, 2]

from_file classmethod

from_file(path: StrPath) -> RuleSet

save

save(path: StrPath) -> None

Source

Bases: ABC

Methods:

Attributes:

name instance-attribute

name: str

__init__

__init__() -> None

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

get_rule async

get_rule(*spec: str) -> Rule

get_source

get_source(name: str) -> Source