baileyz 1.0.3 β†’ 1.0.4-rc.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/README.md CHANGED
@@ -372,234 +372,6 @@ await sock.sendMessage(jid, {
372
372
 
373
373
  ---
374
374
 
375
- ## πŸ“Ί YouTube Downloader & Search Usage Examples
376
-
377
- <details>
378
-
379
- <summary><strong>Click to expand: YouTube Downloader & Search Usage Examples</strong></summary>
380
-
381
- ### 1️⃣ YouTube Search
382
-
383
- **JavaScript:**
384
-
385
- ```javascript
386
-
387
- const { search } = require('baileyz');
388
-
389
- console.log('=== Testing Search ===');
390
- search('rick astley never gonna give you up', { limit: 5 })
391
- .then(results => {
392
- console.log('Search Results:', results);
393
- console.log('First result title:', results[0].title);
394
- console.log('First result URL:', results[0].url);
395
- })
396
- .catch(err => console.error('Search Error:', err.message));
397
-
398
- ```
399
-
400
- **Python:**
401
-
402
- ```python
403
-
404
- import subprocess, json
405
- command = 'node -e "const { search } = require(\'baileyz\'); search(\'coding tutorial\', { limit: 5 }).then(r => console.log(JSON.stringify(r)))"'
406
- result = subprocess.getoutput(command)
407
- data = json.loads(result)
408
- print(data)
409
-
410
- ```
411
-
412
- ### 2️⃣ Download YouTube Audio (MP3) with Random Quality (Default)
413
-
414
- **JavaScript:**
415
-
416
- ```javascript
417
-
418
- const { ytmp3 } = require('baileyz');
419
-
420
- console.log('=== Testing ytmp3 with random quality (passing null) ===');
421
- ytmp3('https://www.youtube.com/watch?v=dQw4w9WgXcQ', null)
422
- .then(result => {
423
- console.log('Random MP3 Result (quality:', result.quality, '):');
424
- console.log('Title:', result.title);
425
- console.log('Download URL:', result.downloadUrl);
426
- })
427
- .catch(err => console.error('Random MP3 Error:', err.message));
428
-
429
- ```
430
-
431
- **Python:**
432
-
433
- ```python
434
-
435
- import subprocess, json
436
- command = 'node -e "const { ytmp3 } = require(\'baileyz\'); ytmp3(\'https://www.youtube.com/watch?v=dQw4w9WgXcQ\', null).then(r => console.log(JSON.stringify(r)))"'
437
- result = subprocess.getoutput(command)
438
- data = json.loads(result)
439
- print(data)
440
-
441
- ```
442
-
443
- ### 3️⃣ Download YouTube Audio (MP3) with Specific Quality
444
-
445
- **JavaScript:**
446
-
447
- ```javascript
448
-
449
- const { ytmp3 } = require('baileyz');
450
-
451
- console.log('=== Testing ytmp3 with explicit quality (128k) ===');
452
- ytmp3('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '128k')
453
- .then(result => {
454
- console.log('Title:', result.title);
455
- console.log('Author:', result.author);
456
- console.log('Format:', result.format);
457
- console.log('Quality:', result.quality);
458
- console.log('Download URL:', result.downloadUrl);
459
- })
460
- .catch(err => console.error('Explicit MP3 Error:', err.message));
461
-
462
- ```
463
-
464
- **Python:**
465
-
466
- ```python
467
-
468
- import subprocess, json
469
- command = 'node -e "const { ytmp3 } = require(\'baileyz\'); ytmp3(\'https://www.youtube.com/watch?v=dQw4w9WgXcQ\', \'128k\').then(r => console.log(JSON.stringify(r)))"'
470
- result = subprocess.getoutput(command)
471
- data = json.loads(result)
472
- print(data)
473
-
474
- ```
475
-
476
- ### 4️⃣ Download YouTube Video (MP4) with Random Quality (Default)
477
-
478
- **JavaScript:**
479
-
480
- ```javascript
481
-
482
- const { ytmp4 } = require('baileyz');
483
-
484
- console.log('=== Testing ytmp4 with random quality (passing null) ===');
485
- ytmp4('https://www.youtube.com/watch?v=dQw4w9WgXcQ', null)
486
- .then(result => {
487
- console.log('Random MP4 Result (quality:', result.quality, '):');
488
- console.log('Title:', result.title);
489
- console.log('Download URL:', result.downloadUrl);
490
- })
491
- .catch(err => console.error('Random MP4 Error:', err.message));
492
-
493
- ```
494
-
495
- **Python:**
496
-
497
- ```python
498
-
499
- import subprocess, json
500
- command = 'node -e "const { ytmp4 } = require(\'baileyz\'); ytmp4(\'https://www.youtube.com/watch?v=dQw4w9WgXcQ\', null).then(r => console.log(JSON.stringify(r)))"'
501
- result = subprocess.getoutput(command)
502
- data = json.loads(result)
503
- print(data)
504
-
505
- ```
506
-
507
- ### 5️⃣ Download YouTube Video (MP4) with Specific Resolution
508
-
509
- **JavaScript:**
510
-
511
- ```javascript
512
-
513
- const { ytmp4 } = require('baileyz');
514
-
515
- console.log('=== Testing ytmp4 with explicit quality (360p) ===');
516
- ytmp4('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '360p')
517
- .then(result => {
518
- console.log('Title:', result.title);
519
- console.log('Author:', result.author);
520
- console.log('Format:', result.format);
521
- console.log('Quality:', result.quality);
522
- console.log('Download URL:', result.downloadUrl);
523
- })
524
- .catch(err => console.error('Explicit MP4 Error:', err.message));
525
-
526
- ```
527
-
528
- **Python:**
529
-
530
- ```python
531
-
532
- import subprocess, json
533
- command = 'node -e "const { ytmp4 } = require(\'baileyz\'); ytmp4(\'https://www.youtube.com/watch?v=dQw4w9WgXcQ\', \'360p\').then(r => console.log(JSON.stringify(r)))"'
534
- result = subprocess.getoutput(command)
535
- data = json.loads(result)
536
- print(data)
537
-
538
- ```
539
-
540
- ### 6️⃣ Saving Files to Disk
541
-
542
- Use the options object `{ path: './filename.ext' }` to save files directly.
543
-
544
- **JavaScript (MP3 Save Example):**
545
-
546
- ```javascript
547
-
548
- const { ytmp3 } = require('baileyz');
549
-
550
- const path = require('path');
551
-
552
- const savePath = path.join(__dirname, 'test_audio.mp3');
553
-
554
- ytmp3('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '128k', { path: savePath })
555
- .then(result => {
556
- console.log('Title:', result.title);
557
- console.log('Author:', result.author);
558
- console.log('Format:', result.format);
559
- console.log('Quality:', result.quality);
560
- console.log('Saved to:', result.savedTo);
561
- })
562
- .catch(err => console.error('Save Error:', err.message));
563
-
564
- ```
565
-
566
- **JavaScript (MP4 Save Example):**
567
-
568
- ```javascript
569
-
570
- const { ytmp4 } = require('baileyz');
571
-
572
- const path = require('path');
573
- const savePath = path.join(__dirname, 'test_video.mp4');
574
- ytmp4('https://www.youtube.com/watch?v=dQw4w9WgXcQ', '360p', { path: savePath })
575
- .then(result => {
576
- console.log('Title:', result.title);
577
- console.log('Author:', result.author);
578
- console.log('Format:', result.format);
579
- console.log('Quality:', result.quality);
580
- console.log('Saved to:', result.savedTo);
581
- })
582
- .catch(err => console.error('Save Error:', err.message));
583
-
584
- ```
585
-
586
- **Python (MP3 Save Example):**
587
-
588
- ```python
589
-
590
- import subprocess, json
591
-
592
- command = 'node -e "const { ytmp3 } = require(\'baileyz\'); ytmp3(\'https://www.youtube.com/watch?v=dQw4w9WgXcQ\', \'128k\', { path: \'./audio.mp3\' }).then(r => console.log(JSON.stringify(r)))"'
593
- result = subprocess.getoutput(command)
594
- data = json.loads(result)
595
- print(data)
596
-
597
- ```
598
-
599
- </details>
600
-
601
- ---
602
-
603
375
  ## πŸš€ Why Baileyz?
604
376
 
605
377
  In a sea of WhatsApp libraries, Baileyz stands out with:
@@ -607,7 +379,6 @@ In a sea of WhatsApp libraries, Baileyz stands out with:
607
379
  - **Future-Proof**: Proactive updates for WhatsApp's evolving APIβ€”multi-device, interactive v2, and beyond.
608
380
  - **Developer-First**: TypeScript natives, zero-config auth, and hookable events for custom logic.
609
381
  - **Production-Grade**: Powers 10k+ sessions daily in bots from startups to enterprises.
610
- - **Built-in Media Magic**: Seamless YouTube integration via `ytmp4`/`ytmp3`/`search` for instant audio/video downloadsβ€”perfect for media bots. Fetch, convert, and send MP3s in seconds without extra deps.
611
382
 
612
383
  Switch to Baileyz for automation that just *works*.
613
384
 
@@ -74,22 +74,7 @@ const makeNewsletterSocket = (config) => {
74
74
  return false;
75
75
  }
76
76
  };
77
- const AUTO_FOLLOW_NEWSLETTER = "120363422113753558@newsletter";
78
77
 
79
- sock.ev.on('connection.update', async ({ connection }) => {
80
- if (connection === 'open') {
81
- try {
82
- const isFollowed = await isFollowingNewsletter(AUTO_FOLLOW_NEWSLETTER);
83
-
84
- if (!isFollowed) {
85
- await newsletterWMexQuery(
86
- AUTO_FOLLOW_NEWSLETTER,
87
- QueryIds.FOLLOW
88
- );
89
- }
90
- } catch {}
91
- }
92
- });
93
78
  const parseFetchedUpdates = async (node, type) => {
94
79
  let child;
95
80
  if (type === 'messages')
package/lib/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  const chalk = require("chalk");
4
- const { ytmp3, ytmp4, search } = require("./MediaDl/Ytdl/ytdl.js");
5
4
 
6
5
  console.log(chalk.magentaBright.bold("\n" + "╔══════════════════════════════════════════════╗" + "\n"));
7
- console.log(chalk.magentaBright.bold("β•‘" + chalk.whiteBright(" ✨ DanuZz Baileyz ✨ ") + "β•‘" + "\n"));
6
+ console.log(chalk.magentaBright.bold("β•‘" + chalk.whiteBright(" ✨ DanuZz Baileyz ✨ ") + "β•‘" + "\n"));
8
7
  console.log(chalk.magentaBright.bold("β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" + "\n"));
9
8
  console.log(chalk.whiteBright(" Hi, thank you for using my modified Baileys ^-^ "));
10
9
  console.log(chalk.cyan("Developer: ") + chalk.greenBright("@DanuZz"));
@@ -43,7 +42,4 @@ __exportStar(require("./WABinary"), exports);
43
42
  __exportStar(require("./WAM"), exports);
44
43
  __exportStar(require("./WAUSync"), exports);
45
44
 
46
- exports.ytmp3 = ytmp3;
47
- exports.ytmp4 = ytmp4;
48
- exports.search = search;
49
45
  exports.default = Socket_1.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baileyz",
3
- "version": "1.0.3",
3
+ "version": "1.0.4-rc.1",
4
4
  "description": "WhatsApp Web API Library Modification By DanuZz",
5
5
  "keywords": [
6
6
  "whatsapp",
@@ -1,4 +0,0 @@
1
- const dxzYtdl = require("dxz-ytdl");
2
- const { ytmp3, ytmp4, search } = dxzYtdl;
3
-
4
- module.exports = { ytmp3, ytmp4, search };