soundcloud.ts
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -383,3 +383,3 @@ "use strict"; | ||
result = _b.sent(); | ||
dest = path.extname(dest) ? dest : path.join(dest, "".concat(track.title.replace(/\//g, ""), ".").concat(result.headers["x-amz-meta-file-type"])); | ||
dest = path.extname(dest) ? dest : path.join(dest, "".concat(track.title.replace(/[\\/:*?\"<>|]/g, ""), ".").concat(result.headers["x-amz-meta-file-type"])); | ||
return [4 /*yield*/, result.body.arrayBuffer()]; | ||
@@ -392,5 +392,5 @@ case 5: | ||
_a = _b.sent(); | ||
return [2 /*return*/, this.downloadTrackStream(track, track.title.replace(/\//g, ""), dest)]; | ||
return [2 /*return*/, this.downloadTrackStream(track, track.title.replace(/[\\/:*?\"<>|]/g, ""), dest)]; | ||
case 7: return [3 /*break*/, 9]; | ||
case 8: return [2 /*return*/, this.downloadTrackStream(track, track.title.replace(/\//g, ""), dest)]; | ||
case 8: return [2 /*return*/, this.downloadTrackStream(track, track.title.replace(/[\\/:*?\"<>|]/g, ""), dest)]; | ||
case 9: return [2 /*return*/]; | ||
@@ -511,3 +511,3 @@ } | ||
artwork = (track.artwork_url ? track.artwork_url : track.user.avatar_url).replace(".jpg", ".png").replace("-large", "-t500x500"); | ||
title = track.title.replace(/\//g, ""); | ||
title = track.title.replace(/[\\/:*?\"<>|]/g, ""); | ||
dest = path.extname(dest) ? dest : path.join(folder, "".concat(title, ".png")); | ||
@@ -514,0 +514,0 @@ return [4 /*yield*/, this.api.getClientId()]; |
@@ -215,3 +215,3 @@ import type {SoundcloudTrack, SoundcloudTranscoding} from "../types" | ||
const result = await request(downloadObj.redirectUri) | ||
dest = path.extname(dest) ? dest : path.join(dest, `${track.title.replace(/\//g, "")}.${result.headers["x-amz-meta-file-type"]}`) | ||
dest = path.extname(dest) ? dest : path.join(dest, `${track.title.replace(/[\\/:*?\"<>|]/g, "")}.${result.headers["x-amz-meta-file-type"]}`) | ||
const arrayBuffer = await result.body.arrayBuffer() as any | ||
@@ -221,6 +221,6 @@ fs.writeFileSync(dest, Buffer.from(arrayBuffer, "binary")) | ||
} catch { | ||
return this.downloadTrackStream(track, track.title.replace(/\//g, ""), dest) | ||
return this.downloadTrackStream(track, track.title.replace(/[\\/:*?\"<>|]/g, ""), dest) | ||
} | ||
} else { | ||
return this.downloadTrackStream(track, track.title.replace(/\//g, ""), dest) | ||
return this.downloadTrackStream(track, track.title.replace(/[\\/:*?\"<>|]/g, ""), dest) | ||
} | ||
@@ -289,3 +289,3 @@ } | ||
const artwork = (track.artwork_url ? track.artwork_url : track.user.avatar_url).replace(".jpg", ".png").replace("-large", "-t500x500") | ||
const title = track.title.replace(/\//g, "") | ||
const title = track.title.replace(/[\\/:*?\"<>|]/g, "") | ||
dest = path.extname(dest) ? dest : path.join(folder, `${title}.png`) | ||
@@ -292,0 +292,0 @@ const client_id = await this.api.getClientId() |
{ | ||
"name": "soundcloud.ts", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Soundcloud API v2 wrapper with typings.", | ||
@@ -5,0 +5,0 @@ "main": "dist/soundcloud.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172034