@ooneex/youtube 1.1.3 → 1.1.4

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.d.ts CHANGED
@@ -19,6 +19,6 @@ declare class Youtube implements IYoutube {
19
19
  }
20
20
  import { Exception } from "@ooneex/exception";
21
21
  declare class YoutubeException extends Exception {
22
- constructor(message: string, data?: Record<string, unknown>);
22
+ constructor(message: string, key: string, data?: Record<string, unknown>);
23
23
  }
24
24
  export { YoutubeVideoQualityType, YoutubeVideoProgressType, YoutubeVideoFormatType, YoutubeQualityOptionsType, YoutubeFormatOptionsType, YoutubeFormatKeyWordType, YoutubeException, YoutubeAudioQualityType, YoutubeArgsOptionsType, Youtube, IYoutube };
package/dist/index.js CHANGED
@@ -34,8 +34,9 @@ import { Exception } from "@ooneex/exception";
34
34
  import { HttpStatus } from "@ooneex/http-status";
35
35
 
36
36
  class YoutubeException extends Exception {
37
- constructor(message, data = {}) {
37
+ constructor(message, key, data = {}) {
38
38
  super(message, {
39
+ key,
39
40
  status: HttpStatus.Code.InternalServerError,
40
41
  data
41
42
  });
@@ -47,4 +48,4 @@ export {
47
48
  Youtube
48
49
  };
49
50
 
50
- //# debugId=7091406D01C6357564756E2164756E21
51
+ //# debugId=C54E21D3D991D9CF64756E2164756E21
package/dist/index.js.map CHANGED
@@ -3,9 +3,9 @@
3
3
  "sources": ["src/Youtube.ts", "src/YoutubeException.ts"],
4
4
  "sourcesContent": [
5
5
  "import type { IYoutube } from \"./types\";\n\nexport class Youtube implements IYoutube {\n public getWatchId(url: string): string | null {\n const patterns = [\n /(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/|youtube\\.com\\/embed\\/|youtube\\.com\\/v\\/|youtube\\.com\\/watch\\?.*&v=)([^&\\n?#]+)/,\n /youtube\\.com\\/shorts\\/([^&\\n?#]+)/,\n ];\n\n for (const pattern of patterns) {\n const match = url.match(pattern);\n if (match?.[1]) {\n return match[1];\n }\n }\n\n return null;\n }\n\n public getEmbedUrl(urlOrId: string): string | null {\n const videoId = this.getWatchId(urlOrId) ?? urlOrId;\n\n if (!/^[\\w-]{10,12}$/.test(videoId)) {\n return null;\n }\n\n return `https://www.youtube.com/embed/${videoId}`;\n }\n\n public getWatchUrl(urlOrId: string): string | null {\n const videoId = this.getWatchId(urlOrId) ?? urlOrId;\n\n if (!/^[\\w-]{10,12}$/.test(videoId)) {\n return null;\n }\n\n return `https://www.youtube.com/watch?v=${videoId}`;\n }\n}\n",
6
- "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class YoutubeException extends Exception {\n constructor(message: string, data: Record<string, unknown> = {}) {\n super(message, {\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"YoutubeException\";\n }\n}\n"
6
+ "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class YoutubeException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.InternalServerError,\n data,\n });\n this.name = \"YoutubeException\";\n }\n}\n"
7
7
  ],
8
- "mappings": ";;AAEO,MAAM,QAA4B;AAAA,EAChC,UAAU,CAAC,KAA4B;AAAA,IAC5C,MAAM,WAAW;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,IAEA,WAAW,WAAW,UAAU;AAAA,MAC9B,MAAM,QAAQ,IAAI,MAAM,OAAO;AAAA,MAC/B,IAAI,QAAQ,IAAI;AAAA,QACd,OAAO,MAAM;AAAA,MACf;AAAA,IACF;AAAA,IAEA,OAAO;AAAA;AAAA,EAGF,WAAW,CAAC,SAAgC;AAAA,IACjD,MAAM,UAAU,KAAK,WAAW,OAAO,KAAK;AAAA,IAE5C,IAAI,CAAC,iBAAiB,KAAK,OAAO,GAAG;AAAA,MACnC,OAAO;AAAA,IACT;AAAA,IAEA,OAAO,iCAAiC;AAAA;AAAA,EAGnC,WAAW,CAAC,SAAgC;A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M,SAAS;AAAA,MACb;AAAA,MACA,QAAQ,WAAW,KAAK;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,KAAK,OAAO;AAAA;AAEhB;",
9
+ "debugId": "C54E21D3D991D9CF64756E2164756E21",
10
10
  "names": []
11
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ooneex/youtube",
3
3
  "description": "YouTube video downloader and metadata extraction library for fetching video information, thumbnails, and media streams",
4
- "version": "1.1.3",
4
+ "version": "1.1.4",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -28,8 +28,8 @@
28
28
  "npm:publish": "bun publish --tolerate-republish --force --production --access public"
29
29
  },
30
30
  "dependencies": {
31
- "@ooneex/exception": "1.1.2",
32
- "@ooneex/http-status": "1.1.2",
31
+ "@ooneex/exception": "1.1.3",
32
+ "@ooneex/http-status": "1.1.3",
33
33
  "ytdlp-nodejs": "^2.3.5"
34
34
  },
35
35
  "keywords": [