mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 20:59:59 +00:00
dd563eb752
- tlds are now parsed and validated correctly (e.g. ".co.uk" works now) - url patterns are pre-compiled instead of being compiled for every request - aliases are computed in a safe manner using the URL object where possible
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
import UrlPattern from "url-pattern";
|
|
import { loadJSON } from "./sub/loadFromFs.js";
|
|
const config = loadJSON("./src/config.json");
|
|
const packageJson = loadJSON("./package.json");
|
|
const servicesConfigJson = loadJSON("./src/modules/processing/servicesConfig.json");
|
|
|
|
Object.values(servicesConfigJson.config).forEach(service => {
|
|
service.patterns = service.patterns.map(
|
|
pattern => new UrlPattern(pattern, {
|
|
segmentValueCharset: UrlPattern.defaultOptions.segmentValueCharset + '\\.'
|
|
})
|
|
)
|
|
})
|
|
|
|
export const
|
|
services = servicesConfigJson.config,
|
|
audioIgnore = servicesConfigJson.audioIgnore,
|
|
version = packageJson.version,
|
|
streamLifespan = config.streamLifespan,
|
|
maxVideoDuration = config.maxVideoDuration,
|
|
genericUserAgent = config.genericUserAgent,
|
|
repo = packageJson["bugs"]["url"].replace('/issues', ''),
|
|
authorInfo = config.authorInfo,
|
|
donations = config.donations,
|
|
ffmpegArgs = config.ffmpegArgs,
|
|
supportedAudio = config.supportedAudio,
|
|
celebrations = config.celebrations,
|
|
links = config.links,
|
|
sponsors = config.sponsors
|