Swiftyinsta: Sentry Block on login?

Created on 23 Apr 2019  ·  18Comments  ·  Source: TheM4hd1/SwiftyInsta

{"message": "Sorry, there was a problem with your request.", "status": "fail", "error_type": "sentry_block"}

[-] Login failed: unExpected("sentry_block")

is there something im doing wrong thats causing the sentry block, is there something i can do to prevent the sentry block?

let user = SessionStorage.create(username: "\(String(username!))", password: "\(String(password!))")
            let userAgent = CustomUserAgent(apiVersion: "89.0.0.0", osName: "iOS", osVersion: "12", osRelease: "1.4", dpi: "458", resolution: "2688x1242", company: "Apple", model: "iPhone10,3", modem: "intel", locale: "en_US", fbCode: "95414346")
            HttpSettings.shared.addValue(userAgent.toString(), forHTTPHeaderField: Headers.HeaderUserAgentKey)
            let urlSession = URLSession(configuration: .default)
            let handler = try! APIBuilder().createBuilder().setHttpHandler(urlSession: urlSession).setRequestDelay(delay: .default).setUser(user: user).build()
            var _error: Error?
            do {
                try handler.login { (result, cache) in
                    if result.isSucceeded {
                        DispatchQueue.main.async {
                            self.statusLabel!.text = "logged in"
                            self.bubbleColor!.image = UIImage(named: "bubble_green")
                            self.statusText!.textColor = UIColor(red:0.22, green:0.64, blue:0.04, alpha:1.0)
                        }
                        print("[+]: logged in")
                    } else {
                        print("[-] Login failed: \(result.info.error)")
                        _error = result.info.error
                        DispatchQueue.main.async {
                            self.statusLabel!.text = "login failed"
                            self.errorLabel!.text = "\(_error!)"
                            self.bubbleColor!.image = UIImage(named: "bubble_red")
                            self.statusText!.textColor = UIColor(red:0.91, green:0.06, blue:0.06, alpha:1.0)
                        }
                    }
                }
            }
help wanted question

All 18 comments

Your account or ip-address temporary blocked by this API.
according to the mgp25:

This is Instagram's response when your account has been banned from the API for detected spam/bot behavior.
"sentry block" means that Instagram has blocked your account's ability to use this PHP API library (and all other reverse-engineered libraries like it), because of either:

Spamming or otherwise abusing (such as mass-following)
Or repeatedly and heavily misusing APIs, in a way humans would never call them.
People using this library like a normal person don't get sentry blocked. Which means that you've had to do something bad to get blocked by Instagram.

NOTE: You can use web login method for authentication.

i appreciate the fast response i'll give that a go thanks!

your welcome
if there is no other questions, close the issue.

hi, im getting sentry block even with new account. are you sure they not blocking default user-agent?

you can change the default user-agent #10
but I can login with default user-agent, I don't have any problem.
the second way is using Web-Login feature.

hi
I try default code to login my account , but failed.
plz help me.

{"message": "Sorry, there was a problem with your request.", "status": "fail", "error_type": "sentry_block"}

[-] Login failed: unExpected("sentry_block")

@freedevcoder Hello, use web login feature.
I'm working on a second way to login.
for now web login should solve your problem.

thanks

do you have sample for web login solution?

thanks .
do you help me for save SessionCache to file and use again after run app?

سلام مهدی عزیز
بعد از اینکه مقدار سشن را در فایل ذخیره کردم - در کجا و چگونه از ان استفاده کنم.؟
لطفا به من کمک کن.

@freedevcoder

try? handler.login(cache: sessionCache) { (resLogin) in
    if resLogin.isSucceeded {
        // you're logged in now.
    }
}

ممنون مهدی عزیز

Use Siwa to fix login problems.
it's a new framework to fix login issues.
https://github.com/TheM4hd1/Siwa

@TheM4hd1

Use Siwa to fix login problems.
it's a new framework to fix login issues.
https://github.com/TheM4hd1/Siwa

SessionCache.from(cookeis: cookeis) is not a function in the latest commit of SwiftyInsta

@RealOlympusDev
feature added, use the latest version 1.0.1

@RealOlympusDev
feature added, use the latest version 1.0.1

Thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sbertix picture sbertix  ·  27Comments

sbertix picture sbertix  ·  3Comments

rmelnik7777 picture rmelnik7777  ·  19Comments

canaksoy picture canaksoy  ·  6Comments

anonrig picture anonrig  ·  3Comments