Parse MP3 (ID3v2.4 tags) stream with music-metadata
const fetch = require('node-fetch');
const musicMetadata = require('music-metadata');
const url = 'https://test-audio.netlify.app/' + encodeURI('Various Artists - 2008 - netBloc Vol 13 - Color in a World of Monochrome [AAC-40]') + '/' + encodeURI('1.01. Sweet Man Like Me.m4a');
console.log(`Fetching audio from: ${url}`);
(async () => {
const response = await fetch(url); // Read HTTP headers
const contentType = response.headers.get('content-type'); // Extract the content-type
const metadata = await musicMetadata.parseStream(response.body, {mimeType: contentType}); // Parse and read the remainder of the HTTP body
console.log(metadata.common);
})();
no comments