Explore Make a boiled down version of streamrip with Javascript for a web Qobuz downloader. I… Save Share Download ▾ ReportMake a boiled down version of streamrip with Javascript for a web Qobuz downloader. I want it to download tracks in their maximum quality from Qobuz and to write all the metadata appropriately.
My config:
[downloads]
Folder where tracks are downloaded to
folder = "C:\Users\Joshua\Desktop\Audio"
Put Qobuz albums in a 'Qobuz' folder, Tidal albums in 'Tidal' etc.
source_subdirectories = false
Download (and convert) tracks all at once, instead of sequentially.
If you are converting the tracks, or have fast internet, this will
substantially improve processing speed.
concurrency = true
The maximum number of tracks to download at once
If you have very fast internet, you will benefit from a higher value,
A value that is too high for your bandwidth may cause slowdowns
Set to -1 for no limit
max_connections = 20
Max number of API requests per source to handle per minute
Set to -1 for no limit
requests_per_minute = 60
[[Redacted Person]]
1: 320kbps MP3, 2: 16/44.1, 3: 24/<=96, 4: 24/>=96
quality = 4
This will download booklet pdfs that are included with some albums
download_booklets = true
Authenticate to Qobuz using auth token? Value can be true/false only
use_auth_token = true
Enter your userid if the above use_auth_token is set to true, else enter your email
email_or_userid = "515522"
Enter your auth token if the above use_auth_token is set to true, else enter the md5 hash of your plaintext password
password_or_token = "[redacted possible key]"
Do not change
app_id = "[Redacted PhoneNumber]"
Do not change
secrets = ["[Redacted InternationalBankingAccountNumber]"]
[tidal]
0: 256kbps AAC, 1: 320kbps AAC, 2: 16/44.1 "HiFi" FLAC, 3: 24/44.1 "MQA" FLAC
quality = 3
This will download videos included in Video Albums.
download_videos = true
Do not change any of the fields below
user_id = ""
country_code = ""
access_token = ""
refresh_token = ""
Tokens last 1 week after refresh. This is the Unix timestamp of the expiration
time. If you haven't used streamrip in more than a week, you may have to log
in again using rip config --tidal
token_expiry = ""
[deezer]
0, 1, or 2
This only applies to paid Deezer subscriptions. Those using deezloader
Show full message · 193 lines AssistantCopy response Copy first prompt
Details
Provider anthropic
Model provenance As recorded by source dataset
Turns 1 (2 messages)
Language Not recorded
Added to archive Nov 26, 2026
ID 01m8bcpm7wapnrdjfsgmmd65e5Source & license Imported from RepoChat Arena (4K preferences) (source ). Imported records earn no Research Points.
Upstream record: repochat_battles.json:870:b
lmarena-ai/repochat-arena-preference-4k, revision 72adb77b23e41d2a0e5e5a5783c3cec3dfe14dd5
License: CC-BY-4.0 (prompts); model outputs under provider terms
Dataset releases Not yet included in a published release.
are automatically limited to quality = 1
An authentication cookie that allows streamrip to use your Deezer account
for instructions on how to find this
This allows for free 320kbps MP3 downloads from Deezer
If an arl is provided, deezloader is never used
This warns you when the paid deezer account is not logged in and rip falls
back to deezloader, which is unreliable deezloader_warnings = true
Only 0 is available for now
This changes periodically, so it needs to be updated client_id = ""
app_version = ""
Only 0 is available for now
Download the video along with the audio
The path to download the videos to video_downloads_folder = "C:\Users\Joshua\Desktop\Audio\YouTubeVideos"
Create a database that contains all the track IDs downloaded so far
Any time a track logged in the database is requested, it is skipped
This can be disabled temporarily with the --no-db flag downloads_enabled = false
Path to the downloads database downloads_path = "C:\Users\Joshua\AppData\Roaming\streamrip\downloads.db"
If a download fails, the item ID is stored here. Then, rip repair can be
called to retry the downloads failed_downloads_enabled = false
failed_downloads_path = "C:\Users\Joshua\AppData\Roaming\streamrip\failed_downloads.db"
Convert tracks to a codec after downloading them. [conversion]
enabled = false
FLAC, ALAC, OPUS, MP3, VORBIS, or AAC
In Hz. Tracks are downsampled if their sampling rate is greater than this.
Value of 48000 is recommended to maximize quality and minimize space
Only 16 and 24 are available. It is only applied when the bit depth is higher
than this value.
Only applicable for lossy codecs
Filter a Qobuz artist's discography. Set to 'true' to turn on a filter.
This will also be applied to other sources, but is not guaranteed to work correctly
Remove Collectors Editions, live recordings, etc.
Picks the highest quality out of albums with identical titles.
Remove EPs and Singles
Remove albums whose artist is not the one requested
Skip non studio albums non_studio_albums = false
Only download remastered albums
Write the image to the audio file
The size of the artwork to embed. Options: thumbnail, small, large, original.
"original" images can be up to 30MB, and may fail embedding.
Using "large" is recommended.
If this is set to a value > 0, max(width, height) of the embedded art will be set to this value in pixels
Proportions of the image will remain the same
Save the cover image at the highest quality as a seperate jpg file
If this is set to a value > 0, max(width, height) of the saved art will be set to this value in pixels
Proportions of the image will remain the same
Sets the value of the 'ALBUM' field in the metadata to the playlist's name.
This is useful if your music library software organizes tracks based on album name. set_playlist_to_album = true
If part of a playlist, sets the tracknumber field in the metadata to the track's
position in the playlist instead of its position in its album renumber_playlist_tracks = true
The following metadata tags won't be applied
Changes the folder and file names generated by streamrip.
Create folders for single tracks within the downloads directory using the folder_format
template add_singles_to_folder = false
Available keys: "albumartist", "title", "year", "bit_depth", "sampling_rate",
"id", and "albumcomposer" folder_format = "{albumartist} - {title} [{bit_depth}bits-{sampling_rate}kHz {container}]"
Available keys: "tracknumber", "artist", "albumartist", "composer", "title",
and "albumcomposer", "explicit" track_format = "{tracknumber:02}. {title}{explicit}"
Only allow printable ASCII characters in filenames. restrict_characters = false
Truncate the filename if it is greater than this number of characters
Setting this to false may cause downloads to fail on some systems
Last.fm playlists are downloaded by searching for the titles of the tracks
The source on which to search for the tracks. source = "[Redacted Person]"
If no results were found with the primary source, the item is searched for
on this one.
Print "Downloading {Album name}" etc. to screen
Show resolve, download progress bars
The maximum number of search results to show in the interactive menu
Metadata to identify this config file. Do not change.
Print a message if a new version of streamrip is available I'll help you create a simplified JavaScript version of streamrip focused on Qobuz downloads with metadata handling. Based on your config, I'll create a solution that:
Downloads tracks at maximum quality (24-bit)
Writes appropriate metadata
Uses your provided credentials
Follows your file naming patterns
Here's a boiled down version:
javascript Copy code
const axios = require('axios');
const fs = require('fs');
const path = require('path');
const music_metadata = require('music-metadata-browser');
class QobuzDownloader {
constructor(config) {
this.config = config;
this.baseUrl = 'https://www.qobuz.com/api.json/0.2';
this.headers = {
'X-App-Id': config.qobuz.app_id,
'X-User-Auth-Token': config.qobuz.password_or_token
};
}
async getTrackMetadata(trackId) {
const response = await axios.get(`${this.baseUrl}/track/get`, {
params: {
track_id: trackId,
app_id: this.config.qobuz.app_id
},
headers: this.headers
});
return response.data;
}
async getFileUrl(trackId) {
const quality = 27; // Corresponds to quality=4 (max quality)
const timestamp = Math.floor(Date.now() / 1000);
const secret = this.config.qobuz.secrets[0];
const sig = md5(`trackgetFileUrlformat_id${quality}intentstreamtrack_id${trackId}${timestamp}${secret}`);
const response = await axios.get(`${this.baseUrl}/track/getFileUrl`, {
params: {
track_id: trackId,
format_id: quality,
intent: 'stream',
request_ts: timestamp,
request_sig: sig
},
headers: this.headers
});
return response.data.url;
}
formatTrackPath(metadata) {
const trackFormat = this.config.filepaths.track_format;
return trackFormat
.replace('{tracknumber:02}', String(metadata.track_number).padStart(2, '0'))
.replace('{title}', metadata.title)
.replace('{explicit}', metadata.explicit ? ' (Explicit)' : '');
}
async downloadTrack(trackId) {
try {
// Get metadata
const metadata = await this.getTrackMetadata(trackId);
// Get download URL
const fileUrl = await this.getFileUrl(trackId);
// Format filename
const filename = this.formatTrackPath(metadata);
const filepath = path.join(this.config.downloads.folder, `${filename}.flac`);
// Download file
const response = await axios({
method: 'GET',
url: fileUrl,
responseType: 'stream'
});
// Create write stream
const writer = fs.createWriteStream(filepath);
response.data.pipe(writer);
return new Promise((resolve, reject) => {
writer.on('finish', async () => {
// Write metadata
await this.writeMetadata(filepath, metadata);
resolve();
});
writer.on('error', reject);
});
} catch (error) {
console.error(`Error downloading track ${trackId}:`, error);
throw error;
}
}
async writeMetadata(filepath, metadata) {
const tags = {
title: metadata.title,
artist: metadata.performer.name,
album: metadata.album.title,
track: metadata.track_number,
disc: metadata.media_number,
composer: metadata.composer?.name,
year: metadata.album.release_date_original.split('-')[0],
genre: metadata.album.genre.name
};
// Write metadata using music-metadata or another ID3 tagging library
// Implementation depends on chosen metadata library
}
}
// Usage example:
const downloader = new QobuzDownloader(config);
downloader.downloadTrack('[Redacted PhoneNumber]'); // Replace with actual track ID
To use this code, you'll need to:
Install dependencies:
bash Copy code
npm install axios music-metadata-browser md5
Create a helper function for MD5 hashing:
javascript Copy code
const crypto = require('crypto');
function md5(str) {
return crypto.createHash('md5').update(str).digest('hex');
}
Key features implemented:
Authentication using your app ID and auth token
Maximum quality downloads (24-bit)
File naming following your format: {tracknumber:02}. {title}{explicit}
Downloads to your specified folder
Basic metadata writing capability
Things to note:
Error handling should be added for production use
You may want to add rate limiting based on your requests_per_minute config
For concurrent downloads, you could use Promise.all() with your max_connections limit
The metadata writing section needs to be implemented with your chosen metadata library
For production use, you should add:
Rate limiting
Better error handling
Retry logic
Progress tracking
Concurrent download handling
Would you like me to expand on any of these aspects?
Copy first response