mirror of
https://github.com/Flowseal/zapret-discord-youtube.git
synced 2026-03-08 07:55:21 +00:00
test zapret.ps1 dpi suite dynamic update (#10121)
This commit is contained in:
@@ -75,34 +75,36 @@ function Convert-Target {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# DPI checker defaults (override via MONITOR_* env vars like in monitor.ps1)
|
||||||
|
$dpiTimeoutSeconds = 5
|
||||||
|
$dpiRangeBytes = 262144
|
||||||
|
$dpiWarnMinKB = 14
|
||||||
|
$dpiWarnMaxKB = 22
|
||||||
|
$dpiMaxParallel = 8
|
||||||
|
$dpiCustomUrl = $env:MONITOR_URL
|
||||||
|
if ($env:MONITOR_TIMEOUT) { [int]$dpiTimeoutSeconds = $env:MONITOR_TIMEOUT }
|
||||||
|
if ($env:MONITOR_RANGE) { [int]$dpiRangeBytes = $env:MONITOR_RANGE }
|
||||||
|
if ($env:MONITOR_WARN_MINKB) { [int]$dpiWarnMinKB = $env:MONITOR_WARN_MINKB }
|
||||||
|
if ($env:MONITOR_WARN_MAXKB) { [int]$dpiWarnMaxKB = $env:MONITOR_WARN_MAXKB }
|
||||||
|
if ($env:MONITOR_MAX_PARALLEL) { [int]$dpiMaxParallel = $env:MONITOR_MAX_PARALLEL }
|
||||||
|
|
||||||
function Get-DpiSuite {
|
function Get-DpiSuite {
|
||||||
# Suite sourced from https://github.com/hyperion-cs/dpi-checkers (Apache-2.0 license)
|
# Suite sourced from https://github.com/hyperion-cs/dpi-checkers (Apache-2.0 license)
|
||||||
# Original copyright retained from dpi-checkers repository
|
# Original copyright retained from dpi-checkers repository
|
||||||
return @(
|
$url = "https://hyperion-cs.github.io/dpi-checkers/ru/tcp-16-20/suite.json"
|
||||||
@{ Id = "US.CF-01"; Provider = "Cloudflare"; Url = "https://cdn.cookielaw.org/scripttemplates/202501.2.0/otBannerSdk.js"; Times = 1 }
|
|
||||||
@{ Id = "US.CF-02"; Provider = "Cloudflare"; Url = "https://genshin.jmp.blue/characters/all#"; Times = 1 }
|
try {
|
||||||
@{ Id = "US.CF-03"; Provider = "Cloudflare"; Url = "https://api.frankfurter.dev/v1/2000-01-01..2002-12-31"; Times = 1 }
|
(Invoke-RestMethod -Uri $url -TimeoutSec $dpiTimeoutSeconds) |
|
||||||
@{ Id = "US.DO-01"; Provider = "DigitalOcean"; Url = "https://genderize.io/"; Times = 2 }
|
Select-Object `
|
||||||
@{ Id = "DE.HE-01"; Provider = "Hetzner"; Url = "https://j.dejure.org/jcg/doctrine/doctrine_banner.webp"; Times = 1 }
|
@{n='Id'; e={$_.id}},
|
||||||
@{ Id = "FI.HE-01"; Provider = "Hetzner"; Url = "https://tcp1620-01.dubybot.live/1MB.bin"; Times = 1 }
|
@{n='Provider'; e={$_.provider}},
|
||||||
@{ Id = "FI.HE-02"; Provider = "Hetzner"; Url = "https://tcp1620-02.dubybot.live/1MB.bin"; Times = 1 }
|
@{n='Url'; e={$_.url}},
|
||||||
@{ Id = "FI.HE-03"; Provider = "Hetzner"; Url = "https://tcp1620-05.dubybot.live/1MB.bin"; Times = 1 }
|
@{n='Times'; e={$_.times}}
|
||||||
@{ Id = "FI.HE-04"; Provider = "Hetzner"; Url = "https://tcp1620-06.dubybot.live/1MB.bin"; Times = 1 }
|
}
|
||||||
@{ Id = "FR.OVH-01"; Provider = "OVH"; Url = "https://eu.api.ovh.com/console/rapidoc-min.js"; Times = 1 }
|
catch {
|
||||||
@{ Id = "FR.OVH-02"; Provider = "OVH"; Url = "https://ovh.sfx.ovh/10M.bin"; Times = 1 }
|
Write-Host "[WARN] Fetch dpi suite failed." -ForegroundColor Yellow
|
||||||
@{ Id = "SE.OR-01"; Provider = "Oracle"; Url = "https://oracle.sfx.ovh/10M.bin"; Times = 1 }
|
@()
|
||||||
@{ Id = "DE.AWS-01"; Provider = "AWS"; Url = "https://tms.delta.com/delta/dl_anderson/Bootstrap.js"; Times = 1 }
|
}
|
||||||
@{ Id = "US.AWS-01"; Provider = "AWS"; Url = "https://corp.kaltura.com/wp-content/cache/min/1/wp-content/themes/airfleet/dist/styles/theme.css"; Times = 1 }
|
|
||||||
@{ Id = "US.GC-01"; Provider = "Google Cloud"; Url = "https://api.usercentrics.eu/gvl/v3/en.json"; Times = 1 }
|
|
||||||
@{ Id = "US.FST-01"; Provider = "Fastly"; Url = "https://openoffice.apache.org/images/blog/rejected.png"; Times = 1 }
|
|
||||||
@{ Id = "US.FST-02"; Provider = "Fastly"; Url = "https://www.juniper.net/etc.clientlibs/juniper/clientlibs/clientlib-site/resources/fonts/lato/Lato-Regular.woff2"; Times = 1 }
|
|
||||||
@{ Id = "PL.AKM-01"; Provider = "Akamai"; Url = "https://www.lg.com/lg5-common-gp/library/jquery.min.js"; Times = 1 }
|
|
||||||
@{ Id = "PL.AKM-02"; Provider = "Akamai"; Url = "https://media-assets.stryker.com/is/image/stryker/gateway_1?$max_width_1410$"; Times = 1 }
|
|
||||||
@{ Id = "US.CDN77-01"; Provider = "CDN77"; Url = "https://cdn.eso.org/images/banner1920/eso2520a.jpg"; Times = 1 }
|
|
||||||
@{ Id = "DE.CNTB-01"; Provider = "Contabo"; Url = "https://cloudlets.io/wp-content/themes/Avada/includes/lib/assets/fonts/fontawesome/webfonts/fa-solid-900.woff2"; Times = 1 }
|
|
||||||
@{ Id = "FR.SW-01"; Provider = "Scaleway"; Url = "https://renklisigorta.com.tr/teklif-al"; Times = 1 }
|
|
||||||
@{ Id = "US.CNST-01"; Provider = "Constant"; Url = "https://cdn.xuansiwei.com/common/lib/font-awesome/4.7.0/fontawesome-webfont.woff2?v=4.7.0"; Times = 1 }
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-DpiTargets {
|
function Build-DpiTargets {
|
||||||
@@ -366,18 +368,6 @@ if ($hasErrors) {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# DPI checker defaults (override via MONITOR_* env vars like in monitor.ps1)
|
|
||||||
$dpiTimeoutSeconds = 5
|
|
||||||
$dpiRangeBytes = 262144
|
|
||||||
$dpiWarnMinKB = 14
|
|
||||||
$dpiWarnMaxKB = 22
|
|
||||||
$dpiMaxParallel = 8
|
|
||||||
$dpiCustomUrl = $env:MONITOR_URL
|
|
||||||
if ($env:MONITOR_TIMEOUT) { [int]$dpiTimeoutSeconds = $env:MONITOR_TIMEOUT }
|
|
||||||
if ($env:MONITOR_RANGE) { [int]$dpiRangeBytes = $env:MONITOR_RANGE }
|
|
||||||
if ($env:MONITOR_WARN_MINKB) { [int]$dpiWarnMinKB = $env:MONITOR_WARN_MINKB }
|
|
||||||
if ($env:MONITOR_WARN_MAXKB) { [int]$dpiWarnMaxKB = $env:MONITOR_WARN_MAXKB }
|
|
||||||
if ($env:MONITOR_MAX_PARALLEL) { [int]$dpiMaxParallel = $env:MONITOR_MAX_PARALLEL }
|
|
||||||
$dpiTargets = Build-DpiTargets -CustomUrl $dpiCustomUrl
|
$dpiTargets = Build-DpiTargets -CustomUrl $dpiCustomUrl
|
||||||
|
|
||||||
# Config
|
# Config
|
||||||
|
|||||||
Reference in New Issue
Block a user