@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/README.md
CHANGED
|
@@ -35,7 +35,7 @@ Built and maintained by [Ecency](https://ecency.com), an open-source social plat
|
|
|
35
35
|
- `postBodySummary` - Generate text summary from post body
|
|
36
36
|
- `proxifyImageSrc` - Proxify image URLs through Ecency's image server
|
|
37
37
|
- `setProxyBase` - Configure image proxy endpoint (default: `https://i.ecency.com`)
|
|
38
|
-
- `setCacheSize` - Configure LRU cache size (default:
|
|
38
|
+
- `setCacheSize` - Configure LRU cache size (default: 500 entries)
|
|
39
39
|
|
|
40
40
|
### Processing Pipeline
|
|
41
41
|
|
|
@@ -95,7 +95,7 @@ Built and maintained by [Ecency](https://ecency.com), an open-source social plat
|
|
|
95
95
|
- LRU cache v11 (`src/cache.ts`) stores rendered HTML and extracted images
|
|
96
96
|
- Cache keys include content hash (last_update, updated) to auto-invalidate
|
|
97
97
|
- Separate cache entries for different image sizes and formats
|
|
98
|
-
- Default size:
|
|
98
|
+
- Default size: 500 entries
|
|
99
99
|
- Uses modern `LRUCache` named import from lru-cache v11
|
|
100
100
|
|
|
101
101
|
## File Structure
|
package/dist/browser/index.js
CHANGED
|
@@ -524,13 +524,13 @@ function extractYtStartTime(url) {
|
|
|
524
524
|
try {
|
|
525
525
|
const urlObj = new URL(url);
|
|
526
526
|
const params = new URLSearchParams(urlObj.search);
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
return params.get("start") || "";
|
|
527
|
+
const m = /^(?:(\d{1,7})h)?(?:(\d{1,7})m)?(?:(\d{1,7})s?)?$/i.exec(params.get("t") || "");
|
|
528
|
+
if (m && (m[1] || m[2] || m[3])) {
|
|
529
|
+
const seconds = +(m[1] || 0) * 3600 + +(m[2] || 0) * 60 + +(m[3] || 0);
|
|
530
|
+
if (seconds <= 9999999) return "" + seconds;
|
|
532
531
|
}
|
|
533
|
-
|
|
532
|
+
const start = params.get("start") || "";
|
|
533
|
+
return /^\d{1,7}$/.test(start) ? "" + +start : "";
|
|
534
534
|
} catch (error) {
|
|
535
535
|
return "";
|
|
536
536
|
}
|