diff --git a/videos.html b/videos.html index 74ac316..4565c28 100644 --- a/videos.html +++ b/videos.html @@ -74,15 +74,11 @@ function card(p) { + esc(p.video_url) + '" download>Download'; } - // The file URL ends in /public with no filename. Headers are already right - // (video/mp4), but clients that sniff the URL string are not, and a filename - // query is accepted and ignored by the file service. + // Through our own domain, so an open is a page load we can count. A link + // straight to the file is invisible to us. 33 characters against 74. window.__shareUrl = window.__shareUrl || function (p) { - var u = p.cut_url || p.video_url || ""; - if (!u) return ""; - var slug = ((p.pet_name || "video") + " " + (p.title || "")).toLowerCase() - .replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40) || "video"; - return u + (u.indexOf("?") < 0 ? "?" : "&") + "v=" + slug + ".mp4"; + if (!(p.cut_url || p.video_url)) return ""; + return location.origin + "/v/" + String(p.id || "").slice(0, 8); }; return '