Skip to content

sbr.source.preset

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"],
    ),
]

Preset

Bases: Source

Methods:

Attributes:

name class-attribute instance-attribute

name: str = 'preset'

__init__

__init__() -> None

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

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

get_preset async

get_preset(_id: str, *, exclude: bool = True) -> Rule

get_rule async

get_rule(*spec: str) -> Rule