Created
January 13, 2021 05:23
-
-
Save esterTion/0b291e2d4101e658d1c8d135bb512df3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// $return为获取到的durl json | |
// 按照设置 替换upos服务器 | |
if (isset($_COOKIE['upos_server']) && in_array($_COOKIE['upos_server'], ['ks3u','cosu','kodou','bosu','hw','wcsu','xycdn'])) { | |
$return = preg_replace_callback('/upos\-hz\-mirror([a-z0-9]+?).acgvideo\.com/', function ($m) { | |
if (in_array($m[1], ['wcs','ks3','cos','kodo','bos'])) { | |
if (!empty($_COOKIE['upos_server_legacy'])) { | |
return 'upos-hz-mirror'.$_COOKIE['upos_server_legacy'].'.acgvideo.com'; | |
} | |
return $m[0]; | |
} | |
return 'upos-hz-mirror'.$_COOKIE['upos_server'].'.acgvideo.com'; | |
}, $return); | |
$return = preg_replace_callback('/upos\-sz\-mirror([a-z0-9]+?).bilivideo\.com|upos-hz-mirror(akam)\.akamaized\.net/', function ($m) { | |
if (in_array($_COOKIE['upos_server'], ['wcsu','ks3u','cosu','kodou','bosu'])) { | |
return 'upos-sz-mirror'.substr($_COOKIE['upos_server'], 0, -1).'.bilivideo.com'; | |
} | |
return 'upos-sz-mirror'.$_COOKIE['upos_server'].'.bilivideo.com'; | |
}, $return); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment