@drippy-music/soundcloud-api
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -34,3 +34,3 @@ declare class SoundCloud { | ||
*/ | ||
getTrackTranscodings(track: object): Promise<Array<string>>; | ||
getTrackTranscodings(track: object): Promise<string | undefined>; | ||
@@ -37,0 +37,0 @@ } |
11
index.js
@@ -47,7 +47,4 @@ const axios = require('axios').default; | ||
return [res.data['url']]; | ||
return res.data['url']; | ||
} else if (transcodings.some(e => e.format.protocol == 'hls' && e.format.mime_type == 'audio/mpeg')) { | ||
const chunks = []; | ||
const regex = /(^(?!#).+)/gm; | ||
const hls = transcodings.find(e => e.format.protocol == 'hls' && e.format.mime_type == 'audio/mpeg'); | ||
@@ -60,9 +57,7 @@ const res = await axios.get(hls['url'], { | ||
const m3u = await axios.get(res.data['url']); | ||
for (let match; (match = regex.exec(m3u.data));) chunks.push(match[0]); | ||
return chunks; | ||
return /(.+)\n#EXT-X-ENDLIST/.exec(m3u.data)[1] | ||
.replace(/\d+?\//, '0/'); | ||
} | ||
return []; | ||
} | ||
} |
{ | ||
"name": "@drippy-music/soundcloud-api", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "SoundCloud RESTful API for Node.JS", | ||
@@ -5,0 +5,0 @@ "main": "index.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
4863
80