From 67c1c5ec03d5b6c59463718670a2a58e3f795f17 Mon Sep 17 00:00:00 2001 From: Kayo Souza Date: Thu, 30 May 2024 00:10:58 -0300 Subject: [PATCH] Bug fix and update dependencies --- package.json | 4 ++-- pnpm-lock.yaml | 20 ++++++++++---------- src/Downloader.js | 7 +++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 095c95e..d42685f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "Kayo Souza", "name": "insta-downloader", - "version": "3.4.1", + "version": "3.4.2", "description": "An application to download content from Instagram", "main": "src/index.js", "scripts": { @@ -29,7 +29,7 @@ }, "devDependencies": { "@types/mime": "~3.0.4", - "@types/node": "^20.12.12", + "@types/node": "^20.12.13", "@types/sharp": "~0.31.1", "typescript": "^5.4.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fdd4ce2..bab099b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,8 +31,8 @@ importers: specifier: ~3.0.4 version: 3.0.4 '@types/node': - specifier: ^20.12.12 - version: 20.12.12 + specifier: ^20.12.13 + version: 20.12.13 '@types/sharp': specifier: ~0.31.1 version: 0.31.1 @@ -42,8 +42,8 @@ importers: packages: - '@emnapi/runtime@1.1.1': - resolution: {integrity: sha512-3bfqkzuR1KLx57nZfjr2NLnFOobvyS0aTszaEGCGqmYMVDRaGvgIZbjGSV/MHSSmLgQ/b9JFHQ5xm5WRZYd+XQ==} + '@emnapi/runtime@1.2.0': + resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} '@img/sharp-darwin-arm64@0.33.4': resolution: {integrity: sha512-p0suNqXufJs9t3RqLBO6vvrgr5OhgbWp76s5gTRvdmxmuv9E1rcaqGUsl3l4mKVmXPkTkTErXediAui4x+8PSA==} @@ -161,8 +161,8 @@ packages: '@types/mime@3.0.4': resolution: {integrity: sha512-iJt33IQnVRkqeqC7PzBHPTC6fDlRNRW8vjrgqtScAhrmMwe8c4Eo7+fUGTa+XdWrpEgpyKWMYmi2dIwMAYRzPw==} - '@types/node@20.12.12': - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + '@types/node@20.12.13': + resolution: {integrity: sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==} '@types/sharp@0.31.1': resolution: {integrity: sha512-5nWwamN9ZFHXaYEincMSuza8nNfOof8nmO+mcI+Agx1uMUk4/pQnNIcix+9rLPXzKrm1pS34+6WRDbDV0Jn7ag==} @@ -268,7 +268,7 @@ packages: snapshots: - '@emnapi/runtime@1.1.1': + '@emnapi/runtime@1.2.0': dependencies: tslib: 2.6.2 optional: true @@ -339,7 +339,7 @@ snapshots: '@img/sharp-wasm32@0.33.4': dependencies: - '@emnapi/runtime': 1.1.1 + '@emnapi/runtime': 1.2.0 optional: true '@img/sharp-win32-ia32@0.33.4': @@ -350,13 +350,13 @@ snapshots: '@types/mime@3.0.4': {} - '@types/node@20.12.12': + '@types/node@20.12.13': dependencies: undici-types: 5.26.5 '@types/sharp@0.31.1': dependencies: - '@types/node': 20.12.12 + '@types/node': 20.12.13 asynckit@0.4.0: {} diff --git a/src/Downloader.js b/src/Downloader.js index 3caab56..3d7fe15 100644 --- a/src/Downloader.js +++ b/src/Downloader.js @@ -222,11 +222,9 @@ export default class Downloader { try{ if(!userId) throw new Error(`Failed to get user ID: ${username}`) - const { is_private, friendship_status: { followed_by } } = await this.GetUser(userId, username) + const { is_private, friendship_status: { following } } = await this.GetUser(userId, username) - if(is_private && !followed_by){ - throw new Error(`You don't have access to a private account: ${username}`) - } + if(is_private && !following) throw new Error(`You don't have access to a private account: ${username}`) }catch(error){ Log(error) errored++ @@ -423,6 +421,7 @@ export default class Downloader { if(!feed){ const { errors } = /** @type {import("./typings/api.js").GraphAPIResponseError} */ (response.data) const error = errors?.[0] + console.log(response.data?.data ?? response.data) throw new Error(`Error downloading highlights ${error ? `(${error.severity}): ${error.message}` : ""}`) }