@realvare/based 2.6.22 → 2.6.24
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/lib/Utils/messages-media.js +15 -2
- package/package.json +5 -2
|
@@ -479,8 +479,21 @@ async function generateThumbnail(file, mediaType, options) {
|
|
|
479
479
|
};
|
|
480
480
|
}
|
|
481
481
|
const getHttpStream = async (url, options = {}) => {
|
|
482
|
-
const
|
|
483
|
-
|
|
482
|
+
const { retryRequestDelayMs, maxMsgRetryCount } = options;
|
|
483
|
+
let retries = 0;
|
|
484
|
+
while (retries < maxMsgRetryCount) {
|
|
485
|
+
try {
|
|
486
|
+
const fetched = await axios_1.default.get(url.toString(), { ...options, responseType: 'stream' });
|
|
487
|
+
return fetched.data;
|
|
488
|
+
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
retries++;
|
|
491
|
+
if (retries >= maxMsgRetryCount) {
|
|
492
|
+
throw error;
|
|
493
|
+
}
|
|
494
|
+
await (0, generics_1.delay)(retryRequestDelayMs || 1000);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
484
497
|
};
|
|
485
498
|
exports.getHttpStream = getHttpStream;
|
|
486
499
|
const prepareStream = async (media, mediaType, { logger, saveOriginalFileIfRequired, opts } = {}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realvare/based",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.24",
|
|
4
4
|
"description": "WhatsApp Web API by Sam",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"baileys",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"automation",
|
|
12
12
|
"multi-device",
|
|
13
13
|
"lid",
|
|
14
|
-
"
|
|
14
|
+
"based"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://github.com/realvare/based.git",
|
|
17
17
|
"repository": {
|
|
@@ -97,6 +97,9 @@
|
|
|
97
97
|
"jimp": {
|
|
98
98
|
"optional": true
|
|
99
99
|
},
|
|
100
|
+
"sharp": {
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
100
103
|
"link-preview-js": {
|
|
101
104
|
"optional": true
|
|
102
105
|
}
|