Skip to content

Commit

Permalink
Bug fix and update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphka committed May 30, 2024
1 parent 080dfc7 commit 67c1c5e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -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"
},
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/Downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down Expand Up @@ -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}` : ""}`)
}

Expand Down

0 comments on commit 67c1c5e

Please sign in to comment.