hinet-hichannel-taiwan-radio
Version:
取得 HiNet hichannel 台灣電台的 m3u8 串流網址、節目表和其他資訊!
102 lines • 3.32 kB
JavaScript
;
/*
* Copyright (c) 2014-2022 旋風之音 GoneTone
*
* Website: https://blog.reh.tw/
* GitHub: https://github.com/GoneTone
* Facebook: https://www.facebook.com/GoneToneDY
* Twitter: https://twitter.com/TPGoneTone
*
* _oo0oo_
* o8888888o
* 88" . "88
* (| -_- |)
* 0\ = /0
* ___/`---'\___
* .' \\| |# '.
* / \\||| : |||# \
* / _||||| -:- |||||- \
* | | \\\ - #/ | |
* | \_| ''\---/'' |_/ |
* \ .-\__ '-' ___/-. /
* ___'. .' /--.--\ `. .'___
* ."" '< `.___\_<|>_/___.' >' "".
* | | : `- \`.;`\ _ /`;.`/ - ` : | |
* \ \ `_. \_ __\ /__ _/ .-` / /
* =====`-.____`.___ \_____/___.-`___.-'=====
* `=---='
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* 佛祖保佑 永無 BUG
*
* Project GitHub: https://github.com/GoneToneStudio/node-google-play-api
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Proxy = void 0;
class Proxy {
/**
* Proxy constructor.
*
* @param {ProxyOptions} options 主機名、端口 (預設 3128)、協定 (預設 http)
*/
constructor(options) {
var _a, _b;
Object.defineProperty(this, "_host", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_port", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_protocol", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_username", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_password", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this._host = options.host;
this._port = (_a = options.port) !== null && _a !== void 0 ? _a : 3128;
this._protocol = (_b = options.protocol) !== null && _b !== void 0 ? _b : 'http';
}
/**
* 登入 Proxy
*
* @param {string} username 帳號
* @param {string} password 密碼
*/
login(username, password) {
this._username = username;
this._password = password;
}
/**
* 取得 Proxy URL
*
* @returns {string}
*/
get() {
const url = `${this._host}:${this._port}`;
let proxy = `${this._protocol}://${url}`;
if (this._username && this._password) {
proxy = `${this._protocol}://${this._username}:${this._password}@${url}`;
}
return proxy;
}
}
exports.Proxy = Proxy;
//# sourceMappingURL=Proxy.js.map