mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-27 17:08:28 +00:00
api/soundcloud: add more metadata fields (#1313)
This commit is contained in:
parent
19c036494f
commit
170cf293bf
@ -113,9 +113,16 @@ export default async function(obj) {
|
|||||||
|
|
||||||
if (!file) return { error: "fetch.empty" };
|
if (!file) return { error: "fetch.empty" };
|
||||||
|
|
||||||
|
const artist = json.user?.username?.trim();
|
||||||
const fileMetadata = {
|
const fileMetadata = {
|
||||||
title: json.title.trim(),
|
title: json.title?.trim(),
|
||||||
artist: json.user.username.trim(),
|
album: json.publisher_metadata?.album_title?.trim(),
|
||||||
|
artist,
|
||||||
|
album_artist: artist,
|
||||||
|
composer: json.publisher_metadata?.writer_composer?.trim(),
|
||||||
|
genre: json.genre?.trim(),
|
||||||
|
date: json.display_date?.trim().slice(0, 10),
|
||||||
|
copyright: json.license?.trim(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -17,9 +17,12 @@ const ffmpegArgs = {
|
|||||||
|
|
||||||
const metadataTags = [
|
const metadataTags = [
|
||||||
"album",
|
"album",
|
||||||
|
"composer",
|
||||||
|
"genre",
|
||||||
"copyright",
|
"copyright",
|
||||||
"title",
|
"title",
|
||||||
"artist",
|
"artist",
|
||||||
|
"album_artist",
|
||||||
"track",
|
"track",
|
||||||
"date",
|
"date",
|
||||||
];
|
];
|
||||||
|
19
docs/api.md
19
docs/api.md
@ -129,14 +129,17 @@ the response will always be a JSON object containing the `status` key, which is
|
|||||||
#### output.metadata object
|
#### output.metadata object
|
||||||
all keys in this table are optional.
|
all keys in this table are optional.
|
||||||
|
|
||||||
| key | type | description |
|
| key | type | description |
|
||||||
|:------------|:---------|:-------------------------------------------|
|
|:---------------|:---------|:-------------------------------------------|
|
||||||
| `album` | `string` | album name or collection title |
|
| `album` | `string` | album name or collection title |
|
||||||
| `copyright` | `string` | copyright information or ownership details |
|
| `composer` | `string` | composer of the track |
|
||||||
| `title` | `string` | title of the track or media file |
|
| `genre` | `string` | track's genre(s) |
|
||||||
| `artist` | `string` | artist or creator name |
|
| `copyright` | `string` | copyright information or ownership details |
|
||||||
| `track` | `string` | track number or position in album |
|
| `title` | `string` | title of the track or media file |
|
||||||
| `date` | `string` | release date or creation date |
|
| `artist` | `string` | artist or creator name |
|
||||||
|
| `album_artist` | `string` | album's artist or creator name |
|
||||||
|
| `track` | `string` | track number or position in album |
|
||||||
|
| `date` | `string` | release date or creation date |
|
||||||
|
|
||||||
#### audio object
|
#### audio object
|
||||||
| key | type | value |
|
| key | type | value |
|
||||||
|
@ -45,9 +45,12 @@ type CobaltTunnelResponse = {
|
|||||||
|
|
||||||
export const CobaltFileMetadataKeys = [
|
export const CobaltFileMetadataKeys = [
|
||||||
'album',
|
'album',
|
||||||
|
'composer',
|
||||||
|
'genre',
|
||||||
'copyright',
|
'copyright',
|
||||||
'title',
|
'title',
|
||||||
'artist',
|
'artist',
|
||||||
|
'album_artist',
|
||||||
'track',
|
'track',
|
||||||
'date'
|
'date'
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user