Miniget 410 when checking for updates
bboynton97 opened this issue · comments
Braelyn Boynton commented
When i try to use ytdl-core or any package that depends on it, it fails with the following error:
199 | Date.now() - exports.lastUpdateCheck >= UPDATE_INTERVAL) {
200 | exports.lastUpdateCheck = Date.now();
201 | return miniget('https://api.github.com/repos/fent/node-ytdl-core/releases/latest', {
202 | headers: { 'User-Agent': 'ytdl-core' },
203 | }).text().then(response => {
204 | if (JSON.parse(response).tag_name !== `v${pkg.version}`) {
^
SyntaxError: JSON Parse error: Unrecognized token 'ߋ'
at /Users/braelynboynton/Developer/spotlight/services/api/node_modules/ytdl-core/lib/utils.js:204:10
at processTicksAndRejections (:1:2602)
11 | // `request`, `response`, `abort`, left out, miniget will emit these.
12 | const requestEvents = ['connect', 'continue', 'information', 'socket', 'timeout', 'upgrade'];
13 | const responseEvents = ['aborted'];
14 | Miniget.MinigetError = class MinigetError extends Error {
15 | constructor(message, statusCode) {
16 | super(message);
^
error: Status code: 410
at new MinigetError (/Users/braelynboynton/Developer/spotlight/services/api/node_modules/miniget/dist/index.js:16:8)
at /Users/braelynboynton/Developer/spotlight/services/api/node_modules/miniget/dist/index.js:206:26
at node:http:865:28
at processTicksAndRejections (:1:2602)
Braelyn Boynton commented
I bypassed this by setting YTDL_NO_UPDATE
but I'm still running into other 410 issues with miniget in this library