Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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