Fixed
This commit is contained in:
@@ -76,36 +76,14 @@ let isPlaying = false;
|
||||
if (!value) return "Bilinmiyor";
|
||||
const raw = String(value).trim();
|
||||
if (!raw) return "Bilinmiyor";
|
||||
|
||||
const normalise = (input) => {
|
||||
try {
|
||||
return new URL(input);
|
||||
} catch {
|
||||
try {
|
||||
return new URL(`http://${input}`);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const parsed = normalise(raw);
|
||||
if (parsed) {
|
||||
let host = parsed.hostname || "";
|
||||
if (host.toLowerCase().startsWith("tracker.")) {
|
||||
host = host.slice(8);
|
||||
}
|
||||
if (host) return host;
|
||||
try {
|
||||
const url = new URL(raw);
|
||||
const host = url.hostname.replace(/^tracker\./i, "");
|
||||
return host || raw;
|
||||
} catch (err) {
|
||||
const stripped = raw.replace(/^.*?:\/\//, "").replace(/\/.*$/, "");
|
||||
return stripped.replace(/^tracker\./i, "") || raw;
|
||||
}
|
||||
|
||||
const stripped = raw
|
||||
.replace(/^.*?:\/\//, "")
|
||||
.replace(/\/.*$/, "")
|
||||
.replace(/:.*/, "");
|
||||
if (stripped.toLowerCase().startsWith("tracker.")) {
|
||||
return stripped.slice(8);
|
||||
}
|
||||
return stripped || raw;
|
||||
}
|
||||
function formatDateTime(value) {
|
||||
if (!value) return "—";
|
||||
|
||||
Reference in New Issue
Block a user