@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.
- package/README.md +2 -2
- package/dist/browser/index.js +6 -6
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +6 -6
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +6 -6
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -522,13 +522,13 @@ function extractYtStartTime(url) {
|
|
|
522
522
|
try {
|
|
523
523
|
const urlObj = new URL(url);
|
|
524
524
|
const params = new URLSearchParams(urlObj.search);
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
return params.get("start") || "";
|
|
525
|
+
const m = /^(?:(\d{1,7})h)?(?:(\d{1,7})m)?(?:(\d{1,7})s?)?$/i.exec(params.get("t") || "");
|
|
526
|
+
if (m && (m[1] || m[2] || m[3])) {
|
|
527
|
+
const seconds = +(m[1] || 0) * 3600 + +(m[2] || 0) * 60 + +(m[3] || 0);
|
|
528
|
+
if (seconds <= 9999999) return "" + seconds;
|
|
530
529
|
}
|
|
531
|
-
|
|
530
|
+
const start = params.get("start") || "";
|
|
531
|
+
return /^\d{1,7}$/.test(start) ? "" + +start : "";
|
|
532
532
|
} catch (error) {
|
|
533
533
|
return "";
|
|
534
534
|
}
|