streamify-audio 2.2.7 → 2.2.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamify-audio",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "Dual-mode audio library: HTTP streaming proxy + Discord player (Lavalink alternative). Supports YouTube, Spotify, SoundCloud with audio filters.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -33,6 +33,7 @@ async function getInfo(url, config) {
33
33
  title: data.title,
34
34
  duration: data.duration || 0,
35
35
  author: data.uploader || data.artist,
36
+ authorUrl: data.uploader_url || null,
36
37
  thumbnail: data.thumbnail,
37
38
  uri: data.webpage_url,
38
39
  streamUrl: `/bandcamp/stream/${Buffer.from(url).toString('base64')}`,
@@ -33,6 +33,7 @@ async function getInfo(url, config) {
33
33
  title: data.title,
34
34
  duration: data.duration || 0,
35
35
  author: data.uploader || data.user?.username,
36
+ authorUrl: data.uploader_url || null,
36
37
  thumbnail: data.thumbnail,
37
38
  uri: data.webpage_url,
38
39
  streamUrl: `/mixcloud/stream/${Buffer.from(url).toString('base64')}`,
@@ -37,6 +37,7 @@ async function search(query, limit, config) {
37
37
  title: entry.title,
38
38
  duration: entry.duration,
39
39
  author: entry.uploader,
40
+ authorUrl: entry.uploader_url || null,
40
41
  thumbnail: entry.thumbnails?.[0]?.url,
41
42
  uri: entry.url || entry.webpage_url,
42
43
  streamUrl: `/soundcloud/stream/${entry.id}`,
@@ -82,6 +83,7 @@ async function getInfo(trackId, config) {
82
83
  title: data.title,
83
84
  duration: data.duration,
84
85
  author: data.uploader,
86
+ authorUrl: data.uploader_url || null,
85
87
  thumbnail: data.thumbnail,
86
88
  uri: data.webpage_url,
87
89
  streamUrl: `/soundcloud/stream/${data.id}`,
@@ -62,6 +62,7 @@ async function search(query, limit, config) {
62
62
  id: track.id,
63
63
  title: track.name,
64
64
  author: track.artists.map(a => a.name).join(', '),
65
+ authorUrl: track.artists[0]?.external_urls?.spotify || null,
65
66
  album: track.album.name,
66
67
  duration: Math.floor(track.duration_ms / 1000),
67
68
  thumbnail: track.album.images?.[0]?.url,
@@ -83,6 +84,7 @@ async function getInfo(trackId, config) {
83
84
  id: track.id,
84
85
  title: track.name,
85
86
  author: track.artists.map(a => a.name).join(', '),
87
+ authorUrl: track.artists[0]?.external_urls?.spotify || null,
86
88
  album: track.album.name,
87
89
  duration: Math.floor(track.duration_ms / 1000),
88
90
  thumbnail: track.album.images?.[0]?.url,
@@ -142,6 +144,7 @@ async function getPlaylist(playlistId, config) {
142
144
  id: item.track.id,
143
145
  title: item.track.name,
144
146
  author: item.track.artists.map(a => a.name).join(', '),
147
+ authorUrl: item.track.artists[0]?.external_urls?.spotify || null,
145
148
  album: item.track.album.name,
146
149
  duration: Math.floor(item.track.duration_ms / 1000),
147
150
  thumbnail: item.track.album.images?.[0]?.url,
@@ -171,6 +174,7 @@ async function getAlbum(albumId, config) {
171
174
  id: track.id,
172
175
  title: track.name,
173
176
  author: track.artists.map(a => a.name).join(', '),
177
+ authorUrl: track.artists[0]?.external_urls?.spotify || null,
174
178
  album: data.name,
175
179
  duration: Math.floor(track.duration_ms / 1000),
176
180
  thumbnail: data.images?.[0]?.url,
@@ -200,6 +204,7 @@ async function getRecommendations(trackId, limit, config) {
200
204
  id: track.id,
201
205
  title: track.name,
202
206
  author: track.artists.map(a => a.name).join(', '),
207
+ authorUrl: track.artists[0]?.external_urls?.spotify || null,
203
208
  album: track.album.name,
204
209
  duration: Math.floor(track.duration_ms / 1000),
205
210
  thumbnail: track.album.images?.[0]?.url,
@@ -28,11 +28,14 @@ async function getInfo(url, config) {
28
28
  }
29
29
  try {
30
30
  const data = JSON.parse(stdout);
31
+ const authorUrl = data.uploader_url || data.channel_url ||
32
+ (data.channel ? `https://www.twitch.tv/${data.channel}` : null);
31
33
  resolve({
32
34
  id: data.id,
33
35
  title: data.title,
34
36
  duration: data.duration || 0,
35
37
  author: data.uploader || data.channel,
38
+ authorUrl,
36
39
  thumbnail: data.thumbnail,
37
40
  uri: data.webpage_url,
38
41
  streamUrl: `/twitch/stream/${Buffer.from(url).toString('base64')}`,