@ayush24k/telezipper 1.5.0 → 1.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/README.md CHANGED
@@ -45,28 +45,42 @@ telezipper ./my-folder -o ./output
45
45
  ```
46
46
 
47
47
  ### Chunking + Upload to Telegram (MTProto)
48
- This tool now uses **MTProto** (the Telegram Client Protocol) to support **large file uploads (up to 2GB or more)** and faster speeds.
48
+ This tool now uses **MTProto** (the Telegram Client Protocol) to support **large file uploads (up to 2GB)** and faster speeds.
49
49
 
50
50
  To use it, you need a `TELEGRAM_API_ID` and `TELEGRAM_API_HASH`. You can get these from [my.telegram.org](https://my.telegram.org).
51
51
 
52
- You can pass them as arguments:
52
+ You can pass them as arguments or set them in a `.env` file.
53
+
54
+ ### Usage Examples
55
+
56
+ #### 1. Basic Zip (No Password, No Telegram)
53
57
  ```bash
54
- telezipper ./my-folder --telegram --api-id 12345 --api-hash abcdef12345 --chat-id -100123456789
58
+ telezipper ./my-folder
59
+ # Output: ./output/chunk_1.zip
55
60
  ```
56
61
 
57
- Or set them in a `.env` file in your current directory:
58
- ```env
59
- TELEGRAM_API_ID=123456
60
- TELEGRAM_API_HASH=abcdef1234567890
61
- TELEGRAM_CHAT_ID=-1001234567890
62
-
62
+ #### 2. Zip with Password
63
+ ```bash
64
+ telezipper ./my-folder -p "secret123"
65
+ # Output: Encrypted zip files in ./output
63
66
  ```
64
67
 
65
- Then run:
68
+ #### 3. Zip + Upload to Telegram (Env Vars Set)
69
+ Assuming `.env` has credentials:
66
70
  ```bash
67
71
  telezipper ./my-folder --telegram
68
72
  ```
69
73
 
74
+ #### 4. Zip + Upload to Telegram (CLI Args)
75
+ ```bash
76
+ telezipper ./my-folder --telegram --api-id 12345 --api-hash abcdef123 --chat-id -100123456789
77
+ ```
78
+
79
+ #### 5. Password Protected Upload
80
+ ```bash
81
+ telezipper ./my-folder --telegram -p "mypassword"
82
+ ```
83
+
70
84
  ### Logging In
71
85
  - **User Login**: The tool will ask for your phone number and login code interactively. This session is saved locally in `.telegram_session`.
72
86
 
@@ -87,7 +101,7 @@ telezipper ./my-folder --telegram
87
101
  - šŸ” **Encrypted Zips**: Optional AES-256 password protection.
88
102
  - ⚔ **Parallel Chunking**: Zips chunks in parallel for faster processing.
89
103
  - āÆļø **Serial Uploads**: Uploads files one by one with a random delay (2-5s) to avoid flood limits.
90
- - šŸ’¾ **Smart Chunking**: Splits large folders into zip chunks (max 1.8GB each).
104
+ - šŸ’¾ **Smart Chunking**: Splits large folders into zip chunks (max 2GB each).
91
105
  - āœ… **MTProto Auth**: Support for User accounts with session persistence.
92
106
 
93
107
  ## How to Get Telegram Credentials
@@ -32,7 +32,7 @@ program
32
32
  const files = await (0, crawler_1.crawl)(source);
33
33
  console.log(`šŸ“‚ Found ${files.length} file${files.length !== 1 ? 's' : ''}`);
34
34
  const chunks = (0, chunking_1.chunkFiles)(files);
35
- console.log(`šŸ“¦ Created ${chunks.length} chunk${chunks.length !== 1 ? 's' : ''} (max 1.8GB each)${password ? ' šŸ”’ Password protected' : ''}\n`);
35
+ console.log(`šŸ“¦ Created ${chunks.length} chunk${chunks.length !== 1 ? 's' : ''} (max 2GB each)${password ? ' šŸ”’ Password protected' : ''}\n`);
36
36
  await (0, zipper_1.zipChunks)(chunks, outputDir, useTelegram, chatId, password, apiId, apiHash);
37
37
  console.log(`\nšŸŽ‰ All done! ${useTelegram ? 'Files uploaded to Telegram.' : `Zips saved to ${outputDir}`}`);
38
38
  })();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.chunkFiles = chunkFiles;
4
- const CHUNK_SIZE = 1.8 * 1024 * 1024 * 1024; // 1.8 GB
4
+ const CHUNK_SIZE = 1.9 * 1024 * 1024 * 1024; // 1.9 GB
5
5
  // groups files into chunks where the total size of each chunk does not exceed CHUNK_SIZE
6
6
  function chunkFiles(files) {
7
7
  const chunks = [];
@@ -9,7 +9,7 @@ function chunkFiles(files) {
9
9
  let currentChunkSize = 0;
10
10
  for (const file of files) {
11
11
  if (file.size > CHUNK_SIZE) {
12
- console.warn(`āš ļø Skipping file ${file.path} as it exceeds the maximum size of 1.8GB (${(file.size / (1024 * 1024 * 1024)).toFixed(2)} GB).`);
12
+ console.warn(`āš ļø Skipping file ${file.path} as it exceeds the maximum size of 1.9GB (${(file.size / (1024 * 1024 * 1024)).toFixed(2)} GB).`);
13
13
  continue;
14
14
  }
15
15
  if (currentChunkSize + file.size > CHUNK_SIZE) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ayush24k/telezipper",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Split folders into multiple 50MB zip files with optional Telegram upload made for personal use.",
5
5
  "files": [
6
6
  "dist"
@@ -45,4 +45,4 @@
45
45
  "@types/node": "^25.1.0",
46
46
  "typescript": "^5.9.3"
47
47
  }
48
- }
48
+ }