podcast-dl 10.3.1 → 10.3.2
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/bin/async.js +6 -1
- package/package.json +1 -1
package/bin/async.js
CHANGED
|
@@ -28,6 +28,8 @@ import {
|
|
|
28
28
|
const pipeline = promisify(stream.pipeline);
|
|
29
29
|
|
|
30
30
|
const BYTES_IN_MB = 1000000;
|
|
31
|
+
const USER_AGENT =
|
|
32
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";
|
|
31
33
|
|
|
32
34
|
const download = async (options) => {
|
|
33
35
|
const {
|
|
@@ -67,6 +69,7 @@ const download = async (options) => {
|
|
|
67
69
|
responseType: "json",
|
|
68
70
|
headers: {
|
|
69
71
|
accept: "*/*",
|
|
72
|
+
"user-agent": USER_AGENT,
|
|
70
73
|
},
|
|
71
74
|
});
|
|
72
75
|
} catch (error) {
|
|
@@ -108,7 +111,9 @@ const download = async (options) => {
|
|
|
108
111
|
});
|
|
109
112
|
|
|
110
113
|
await pipeline(
|
|
111
|
-
got
|
|
114
|
+
got
|
|
115
|
+
.stream(url, { headers: { "user-agent": USER_AGENT } })
|
|
116
|
+
.on("downloadProgress", onDownloadProgress),
|
|
112
117
|
fs.createWriteStream(tempOutputPath)
|
|
113
118
|
);
|
|
114
119
|
} catch (error) {
|