iptv-checker
Version:
Node.js CLI tool for checking links in IPTV playlists
18 lines (15 loc) • 384 B
JavaScript
import { URL } from 'node:url'
export class ProxyParser {
parse(_url) {
const parsed = new URL(_url)
return {
protocol: parsed.protocol.replace(':', '') || null,
auth: {
username: parsed.username || null,
password: parsed.password || null
},
host: parsed.hostname,
port: parsed.port ? parseInt(parsed.port) : null
}
}
}