Skip to content

Commit

Permalink
Merge pull request #34 from Udhayarajan/instagram-story-404
Browse files Browse the repository at this point in the history
Change user-agent for API call
  • Loading branch information
Udhayarajan authored Jul 19, 2023
2 parents ce27171 + 9a2ed03 commit b0a8468
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
}

group = "io.github.udhayarajan"
version = "5.6.5"
version = "5.6.6"
// Version Naming incremented if "<NEW_FEATURE_ADDED>.<WORKED_ON_BUG>.<BETA_VERSION_COUNT_OR_PRE_RELEASE>"
// Priority on incrementing Feature > BugFix > Beta

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,18 @@ class Instagram internal constructor(url: String) : Extractor(url) {
else -> extractInfoShared(res)
}
} else if (isHighlightsPost()) {
headers["User-Agent"] =
"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; 828x1792; 165586599)"
val highlightsId = getHighlightsId()
highlightsId?.let {
extractHighlights(it)
}
} else {
// possibly user url
headers["User-Agent"] =
"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; 828x1792; 165586599)"
val userId = getUserID()
userId?.let {
cookies =
"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Instagram 105.0.0.11.118 (iPhone11,8; iOS 12_3_1; en_US; en-US; scale=2.00; 828x1792; 165586599)"
extractStories(it)
}
}
Expand Down

0 comments on commit b0a8468

Please sign in to comment.