@zetagoaurum-dev/straw 1.2.0 → 1.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.2.1] "Hotfix" - 2026-02-27
6
+ - **Fix:** Removed accidentally tracked `ytInitialData_dump.json` and local `test_*.js` scripts from the previous NPM deployment bundle to ensure zero-bloat runtime.
7
+
5
8
  ## [1.2.0] "Deep Metadata & Formats Engine" - 2026-02-27
6
9
  - **Feat:** Integrated extracting `subscribers`, `likes`, and `comments` directly from YouTube's `ytInitialData` payload without external parsing overhead.
7
10
  - **Feat:** Segregated `formats` array into three exact categorical bins: `video` (combined), `videoOnly`, and `audio` (audio-only), ensuring zero-ambiguity when downloading specific streams.
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
- {
2
- "name": "@zetagoaurum-dev/straw",
3
- "version": "1.2.0",
4
- "description": "Enterprise-grade unified JS/TS and Python scraping library for Web, YouTube, and Media (Images, Audio, Video, Documents)",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "require": "./dist/index.js",
11
- "import": "./dist/index.mjs",
12
- "types": "./dist/index.d.ts"
13
- }
14
- },
15
- "scripts": {
16
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
17
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
18
- "test": "tsx tests/test.ts"
19
- },
20
- "keywords": [
21
- "scraping",
22
- "scraper",
23
- "youtube-scraper",
24
- "media-extractor",
25
- "anti-cors"
26
- ],
27
- "author": "ZetaGo-Aurum",
28
- "license": "MIT",
29
- "repository": {
30
- "type": "git",
31
- "url": "https://github.com/ZetaGo-Aurum/straw.git"
32
- },
33
- "devDependencies": {
34
- "@types/node": "^25.3.2",
35
- "ts-node": "^10.9.2",
36
- "tsup": "^8.5.1",
37
- "tsx": "^4.21.0",
38
- "typescript": "^5.9.3"
39
- },
40
- "dependencies": {
41
- "cheerio": "^1.2.0",
42
- "undici": "^7.22.0"
43
- }
44
- }
1
+ {
2
+ "name": "@zetagoaurum-dev/straw",
3
+ "version": "1.2.1",
4
+ "description": "Enterprise-grade unified JS/TS and Python scraping library for Web, YouTube, and Media (Images, Audio, Video, Documents)",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "require": "./dist/index.js",
11
+ "import": "./dist/index.mjs",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "scripts": {
16
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
17
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
18
+ "test": "tsx tests/test.ts"
19
+ },
20
+ "keywords": [
21
+ "scraping",
22
+ "scraper",
23
+ "youtube-scraper",
24
+ "media-extractor",
25
+ "anti-cors"
26
+ ],
27
+ "author": "ZetaGo-Aurum",
28
+ "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/ZetaGo-Aurum/straw.git"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^25.3.2",
35
+ "ts-node": "^10.9.2",
36
+ "tsup": "^8.5.1",
37
+ "tsx": "^4.21.0",
38
+ "typescript": "^5.9.3"
39
+ },
40
+ "dependencies": {
41
+ "cheerio": "^1.2.0",
42
+ "undici": "^7.22.0"
43
+ }
44
+ }
package/download_test.js DELETED
@@ -1,46 +0,0 @@
1
- const fs = require('fs');
2
- const { fetch } = require('undici');
3
- const straw = require('./dist/index.js');
4
-
5
- async function download() {
6
- const yt = new straw.YouTubeScraper();
7
- console.log('Scraping metadata and direct links...');
8
- const res = await yt.scrapeVideo('https://youtu.be/_4j1Abt_AiM?si=_dA2lroz096f1cYp');
9
-
10
- // Find a combined video+audio format, or fallback to the highest quality video format
11
- const combined = res.formats.find(f => f.hasVideo && f.hasAudio);
12
- const bestVideo = res.formats.filter(f => f.hasVideo).sort((a, b) => (b.width || 0) - (a.width || 0))[0];
13
-
14
- const target = combined || bestVideo;
15
-
16
- if (!target) {
17
- console.log('No suitable downloadable format found.');
18
- return;
19
- }
20
-
21
- console.log(`Downloading: ${res.title}`);
22
- console.log(`Format: ${target.mimeType} (${target.width || 'unknown'}x${target.height || 'unknown'})`);
23
-
24
- // To avoid buffering the whole video in memory, we stream it to the file
25
- const outPath = 'downloaded_video.mp4';
26
- const outStream = fs.createWriteStream(outPath);
27
-
28
- console.log('Initiating download stream...');
29
- const response = await fetch(target.url);
30
- if (!response.body) throw new Error('No response body');
31
-
32
- const reader = response.body.getReader();
33
- let downloaded = 0;
34
-
35
- while (true) {
36
- const { done, value } = await reader.read();
37
- if (done) break;
38
- outStream.write(value);
39
- downloaded += value.length;
40
- process.stdout.write(`\rDownloaded: ${(downloaded / 1024 / 1024).toFixed(2)} MB`);
41
- }
42
- outStream.end();
43
- console.log(`\nDownload complete! Saved to ${outPath}`);
44
- }
45
-
46
- download().catch(console.error);
package/find_keys.js DELETED
@@ -1,25 +0,0 @@
1
- const fs = require('fs');
2
-
3
- const data = JSON.parse(fs.readFileSync('next_api_dump.json', 'utf-8'));
4
-
5
- function findKey(obj, key, path = '') {
6
- if (obj === null || typeof obj !== 'object') return;
7
- if (Array.isArray(obj)) {
8
- for (let i = 0; i < obj.length; i++) {
9
- findKey(obj[i], key, `${path}[${i}]`);
10
- }
11
- } else {
12
- for (const k in obj) {
13
- if (k === key) {
14
- console.log(`Found ${key} at ${path}.${k} =`, JSON.stringify(obj[k]).substring(0, 100));
15
- }
16
- findKey(obj[k], key, `${path}.${k}`);
17
- }
18
- }
19
- }
20
-
21
- findKey(data, 'subscriberCountText');
22
- findKey(data, 'likeCount');
23
- findKey(data, 'likeCountWithLikeText');
24
- findKey(data, 'description');
25
- findKey(data, 'commentCount');