Skip to content

sbr.source

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

ClashClassicalText

Bases: Source

Methods:

Attributes:

dpath instance-attribute

dpath: Path = Path(dpath)

name instance-attribute

name: str = name

url instance-attribute

url: Template

__init__

__init__(
    name: str, url: str | Template, dpath: StrPath
) -> None

from_file staticmethod

from_file(fpath: StrPath) -> Rule

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

GeoIP

Bases: Source

Methods:

Attributes:

dpath instance-attribute

dpath: Path = Path(dpath)

fpath property

fpath: Path

name instance-attribute

name: str = name

url instance-attribute

url: str = url

__init__

__init__(name: str, url: str, dpath: StrPath) -> None

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

GeoSite

Bases: Source

Methods:

Attributes:

dpath instance-attribute

dpath: Path = Path(dpath)

fpath property

fpath: Path

name instance-attribute

name: str = name

url instance-attribute

url: str = url

__init__

__init__(name: str, url: str, dpath: StrPath) -> None

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

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

SingBoxRuleSet

Bases: Source

Methods:

Attributes:

dpath instance-attribute

dpath: Path = Path(dpath)

name instance-attribute

name: str = name

url instance-attribute

url: Template

__init__

__init__(
    name: str, url: str | Template, dpath: StrPath
) -> None

get async

get(*key: str) -> Rule

keys async

keys() -> list[str]

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