From 178c7e81da59a72fb81e1435f5f18ffab7213e51 Mon Sep 17 00:00:00 2001 From: Timothy Date: Sat, 10 May 2025 19:47:33 +0100 Subject: [PATCH] use the `https` module (#41) iTunes now throws a 302 for the http URL redirecting to https. Upgrading to https stops the response breaking the parser. --- util/load_sample_tracks.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/load_sample_tracks.js b/util/load_sample_tracks.js index 8427a5b..4c2564b 100644 --- a/util/load_sample_tracks.js +++ b/util/load_sample_tracks.js @@ -1,7 +1,7 @@ 'use strict'; const artistIds = require('./artist-ids'); -const http = require('http'); +const https = require('https'); const JSONStream = require('JSONStream'); const limit = 7; // The number of songs to retrieve for each artist const parser = JSONStream.parse(['results', true]); @@ -24,7 +24,7 @@ const options = { popIds.concat(rapIds, rockIds).join() + '&entity=song&limit=' + limit, - port: 80 + port: 443 }; /** @@ -92,7 +92,7 @@ rc.del(rooms, function(err) { throw err; } process.stdout.write('Loading sample tracks... '); - http.get(options, function(res) { + https.get(options, function(res) { res.pipe(parser); }); }); -- 2.54.0