@ecency/render-helper 2.5.43 → 2.5.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -549,13 +549,13 @@ function extractYtStartTime(url) {
549
549
  try {
550
550
  const urlObj = new URL(url);
551
551
  const params = new URLSearchParams(urlObj.search);
552
- if (params.has("t")) {
553
- const t = params.get("t");
554
- return "" + parseInt(t || "0");
555
- } else if (params.has("start")) {
556
- return params.get("start") || "";
552
+ const m = /^(?:(\d{1,7})h)?(?:(\d{1,7})m)?(?:(\d{1,7})s?)?$/i.exec(params.get("t") || "");
553
+ if (m && (m[1] || m[2] || m[3])) {
554
+ const seconds = +(m[1] || 0) * 3600 + +(m[2] || 0) * 60 + +(m[3] || 0);
555
+ if (seconds <= 9999999) return "" + seconds;
557
556
  }
558
- return "";
557
+ const start = params.get("start") || "";
558
+ return /^\d{1,7}$/.test(start) ? "" + +start : "";
559
559
  } catch (error) {
560
560
  return "";
561
561
  }