@postfetch/core 0.5.0 → 0.5.1

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/dist/index.js CHANGED
@@ -1467,7 +1467,7 @@ async function followShortlink(net, userAgent, input) {
1467
1467
  return href ? new URL(href.split("?")[0]).href : input;
1468
1468
  }
1469
1469
  function videoId(input) {
1470
- return asUrl(input).pathname.match(/video\/(\d+)/)?.[1] ?? null;
1470
+ return asUrl(input).pathname.match(/(?:video|photo)\/(\d+)/)?.[1] ?? null;
1471
1471
  }
1472
1472
  function itemStruct(html) {
1473
1473
  if (html.includes("SlardarWAF") || html.includes("_wafchallengeid")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postfetch/core",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Zero-dependency typed core that turns Facebook, Instagram, Pinterest, Reddit, SoundCloud, TikTok, X and YouTube post URLs into media files.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/tiktok.ts CHANGED
@@ -110,7 +110,8 @@ async function followShortlink(net: Net, userAgent: string, input: string): Prom
110
110
  }
111
111
 
112
112
  function videoId(input: string): string | null {
113
- return asUrl(input).pathname.match(/video\/(\d+)/)?.[1] ?? null;
113
+ // Photo (slideshow) posts share the video id namespace under /photo/<id>.
114
+ return asUrl(input).pathname.match(/(?:video|photo)\/(\d+)/)?.[1] ?? null;
114
115
  }
115
116
 
116
117
  function itemStruct(html: string): Json {