MCPcopy
hub / github.com/gaotianliuyun/gao / getHome

Function getHome

lib/live2cms.js:89–99  ·  view source on GitHub ↗

* 获取链接的host(带http协议的完整链接) * @param url 任意一个正常完整的Url,自动提取根 * @returns {string}

(url)

Source from the content-addressed store, hash-verified

87 * @returns {string}
88 */
89function getHome(url){
90 if(!url){
91 return ''
92 }
93 let tmp = url.split('//');
94 url = tmp[0] + '//' + tmp[1].split('/')[0];
95 try {
96 url = decodeURIComponent(url);
97 }catch (e) {}
98 return url
99}
100
101/**
102 * m3u直播格式转一般直播格式

Callers 1

httpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected