Code Monkey home page Code Monkey logo

swiftyinsta's People

Contributors

akkayanill avatar anonrig avatar bariscck avatar canaksoy avatar floresrobles avatar j-gao avatar miguelios avatar mycroftcanner avatar pxrne avatar sbertix avatar them4hd1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftyinsta's Issues

Archived story media feed (archive/reel/day_shells/)

I added "archive/reel/day_shells/" but I cannot get /feed/reels_media/ with "user_ids" ([archiveDay:18014492728127***])

{ "timestamp": 1550275300, "media_count": 9, "id": "archiveDay:18014492728127***", "reel_type": "archive_day_reel", "latest_reel_media": 15503425** }

{"message": "Invalid reel id list", "status": "fail"}

Problem while getting handler.users.recentActivities

Hi,
I have got error while getting users.recentactivities response. I am using pod version 2.01 (latest for now)

I am new to the library may be I am doing something wrong or the response is not valid I am not sure yet so I decided to create an issue for that.

In short it says : Expected to decode Data but found a dictionary instead.

Do i need to make another variable different than result in completionhandler or response is not valid in the library?

Here is my code and the error I got ;
(I have already authenticated and I can get followers list without any problem)

handler.users.recentActivities(
                                   with: .init(maxPagesToLoad: .max),
                                   updateHandler: nil,
                                   completionHandler: {result, _ in
                                    
                                  print(result)
})

When i add breakpoint at print line I can see a failure and error ;

Printing description of result:
▿ Result<Array, Error>
▿ failure : DecodingError
▿ typeMismatch : 2 elements
- .0 : Foundation.Data
▿ .1 : Context
▿ codingPath : 4 elements
- 0 : CodingKeys(stringValue: "aymf", intValue: nil)
- 1 : CodingKeys(stringValue: "items", intValue: nil)
▿ 2 : _JSONKey(stringValue: "Index 0", intValue: 0)
- stringValue : "Index 0"
▿ intValue : Optional
- some : 0
- 3 : CodingKeys(stringValue: "user", intValue: nil)
- debugDescription : "Expected to decode Data but found a dictionary instead."
- underlyingError : nil

Adding Multiple Accounts

Ciao

I am trying to add multiple account feature.
What i am trying to do is basically: Save cookies with user defaults with the key userPk

But the problem is, when i am trying to add 2nd user, it brings back first user's cookies
(somehow and although i delete all cookies) it shows me first user's feed.... So i can't even login for the second user

Any idea on how to fix this?

User Followers

In new version you added second arguments in closure body.
What is for second one? And how can I call it?

When I try to call like this it gives error

try handler.getUserFollowers(userId: userId, maxId: "" , searchQuery: "", completion: { (result) in
print(result)

})

api gets followers very slowly

i try to get 4K - 5K followers via your api but it takes too long time.how can i speed this up ? can u have some way to give me all followers like bulk one time ?

Adding tags to GitHub repo page

I thought of maybe adding some tags to the repository for easier discoverability.
Something like #swift, #instagram, #api, #cocoapods or sth along these lines… idk.
What do you think? @TheM4hd1

And I would also consider moving the url to the README. It feels misplaced in the description, imho. But it's just an opinion though.

Stroy Url

I can get my stories with getUserStory.

How can I get story url to show in my app?

Get Followers Method gives error

When I call try handler.getUserFollowers(userId: userId, maxId: nextPageId, searchQuery: "", completion: { (result, maxId)

after 298 nd request its gaves error like:

Result(isSucceeded: false, info: SwiftyInsta.ResultInfo(error: SwiftyInsta.CustomErrors.noError, message: "The operation couldn’t be completed. (SwiftyInsta.CustomErrors error 9.)", responseType: SwiftyInsta.ResponseTypes.wrongRequest), value: nil)

PS: I already remove delay. With delay method it is working

Apple Watch Compatibility

Could you please make this compatible with the apple watch? It doesn't like the length of the user pk. Thanks :)

Missing Followers

When I call handler.getUser function it returns 12710 and it is correct but when I call
handler.getUserFollowers returns 12702. 8 user are missing.

getUserFollowers, getUserFollowing, getUserMedia doesn't return the correct user

Most of the functions like getUserFollowers, getUserFollowing, getUserMedia, etc. first searches for the specific username on the Instagram and then finds the first match and then returns it.

But the thing is, what happens if I have a commonly used username like "funny" where the search result doesn't bring the actual user with username "funny" but instead returns a different account?

This is an important issue that needs to be addressed. If you need further clarification, I can give full details.

/feed/reels_media/

Great repo.
Is there any way we could have story highlights added as well?

login failed

I tried to login and it failed. failed message is "too many HTTP redirects"

Sentry Block on login?

{"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)
                        }
                    }
                }
            }

Story Method

There is no method to view the history, so that it is marked as viewed. How I can do this?

WebLogin not working

After update the pod weblogin not compiled in ios 10 version.
When I change to 11.0 version of ios it says:

  • 'loginDelegate' is deprecated: use InstagramLoginWebView properties instead.
  • 'InstagramLoginWebViewDelegate' is deprecated: use InstagramLoginWebViewProtocol closure properties instead.

When I changed InstagramLoginWebViewDelegate to InstagramLoginWebViewProtocol:

  • 'InstagramLoginWebViewProtocol' requires that 'LoginViewController' inherit from 'UIView'

My Codes:

class LoginViewController: UIViewController {

var loginWebView: InstagramLoginWebView! = nil

override func viewDidLoad() {
    super.viewDidLoad()

    loginWebView = InstagramLoginWebView(frame: self.view.frame)
    self.view.addSubview(loginWebView!)
    loginWebView?.loginDelegate = self **-- Cannot assign value of type 'LoginViewController' to type 'InstagramLoginWebViewDelegate?'**
    self.loginWebView?.loadInstagramLogin(isNeedPreloadForCookieSync: true) **--Argument passed to call that takes no arguments**
}

}

extension LoginViewController : InstagramLoginWebViewProtocol { --'InstagramLoginWebViewProtocol' requires that 'LoginViewController' inherit from 'UIView'

func userLoggedSuccessfully() {
    print("User Logged Successfully")
    
    DispatchQueue.main.async {
        self.loginWebView.removeFromSuperview()
    }
         
}

Access getMediaLikers items

I am trying to get media likers . Function is working nice and I can see the results with breakpoint. But when I try to get items in model I can not access it.

my codes:

let users = result.value.map({ $0.users! }) -> It gives an error like 'users' is inaccessible due to 'internal' protection level

and I try to access it with:
result.value.users -> It says Value of type 'MediaLikersModel?' has no member 'users'

How can I get the users who like media?

Old Stories

Is there any way to see old stories which is not in story feed anymore?

On Instagram:
When I click to add story button instagram show the old stories which is sharing before.

Adding Travis CI support

I feel like implementing Travis CI might be a good idea, especially with all the changes that are being discussed for 2.0.
Just an opinion though.

Get User Media Return first page

Hi,

When I try to get user all media with getUserMedia method it returns only first page and it is not using nextid.

How can we fix it?
Thanks

getTimeline returning nothing

Result<Array>(isSucceeded: true, info: InstaWatch.ResultInfo(error: InstaWatch.CustomErrors.noError, message: "", responseType: InstaWatch.ResponseTypes.ok), value: Optional([]))

Tags Users on Photo upload.

I've seen this feature available for Instagram-API-Python on a PR. Maybe it could be done for Swift as well.

I tried several combinations of the payload like
usertags: [{ user_id: 0000, x: 0.1, y 0.1}]
usertags: [{ user_id: 0000, position: [0.1,0.1]}]

But none of my combinations work. Maybe it needs an extra step that I cannot see right now that I just starting using this library.

Road to `2.0`

Hey @TheM4hd1 😊 thanks for making this great library (and Siwa, which is even more impressive), you've done an amazing job thus far. And thanks for letting me tag along and help.

With 2.0 approaching I was wondering what was the great scheme of things, if there were milestones planned or particular features you were thinking of implementing. Cause after using this for a while I have some suggestions that might make it in a bigger update:

  1. in-code documentation
  2. easier permission handler, dropping the Singleton model and all the .shared, allowing users to run multiple accounts at the same time [I might start working on this today or tomorrow, if it's ok] ✓
  3. easier login, streamlining the process by creating accessories and hiding some boilerplate code behind private or internal
  4. a development branch where we can push approved pull requests in order to test everything better before pushing it to the master (2.0 is definitely a big deal 😊) ✓
  5. naming conventions, fixing the userId, pk, userPk... and uniforming parameters names (I know I made it worse with completionHandler vs completion, but I feel like UserReference kinda makes it even hahaha), as well making functions more "swift-y" (using named parameters, etc.) ✓
  6. Swift 5.1, anyone? 🤔 I feel like the some Protocol pattern would be great for solving most of the login "issues"

Just some ideas though. Please let me know what priorities you have and how to help you.
Peace ✌️

Story Viewers

Can we add the feature provides that reaching logged in user's stories' viewer list ?

Multiple Account Login Problem

@sbertix func isUserLoggedIn(instagramCookies : [HTTPCookie]?) recieves only 2 cookies. That's the reason why it doesn't login. And when it recieves 6 cookies, it works. It's just a matter of luck 😄

Here is my flow

var webView: InstagramLoginWebView? {
        didSet {
            oldValue?.removeFromSuperview()
            guard let webView = webView else { return }
            view.addSubview(webView)
            // always request log in page when setting a new web view.
            webView.loadInstagramLogin()
            webView.fillToSuperview()
        }
    }
override func viewDidLoad() {
        super.viewDidLoad()


         InstagramLoginWebView.create(with: self.view.bounds, didReachEndOfLoginFlow: nil, 
                  didSuccessfullyLogIn: {
                          self.showProfileVC()
                  }, completionHandler: { (cache, handlerProtocol) in
                           //do stuff
                 }, returnHandler: {[weak self] in self?.webView = $0 })

}

Rewriting `*Model`s

As suggested in #50, we should start considering a better approach for models, in time for 2.0
Right now they directly represent the parsed JSON response, which is especially uncomfortable when dealing with media and users (and all their different definitions inside the library).

I'm proposing the following, as an improvement of the current situation.
Any model should conform to ParsedResponse defined as following:

public protocol ParsedResponse {
  associatedtype RawResponse: Codable
  var rawResponse: RawResponse { get }
}

Where RawResponse might just as well represent the current models (or even a Dictionary tbh..., idk).
I would not enforce Codable on ParsedResponse but maybe add an init with the associated RawResponse as an argument, but I'm open to suggestions.

Every "parsed" attribute can therefore be achieved through accessories of the ParsedResponse, either as run-time read-only get vars or let constants computed on init (depending on their computational difficulty).
(bonus: No more UserModel, CurrentUserModel, UserShortModel, etc.)

Suggestions? Opinions?
I might start working on this tomorrow.

Need to upload video

I need to upload video to Instagram. Please let me know how can I do it.

Thanks
Alok

followUser not working anymore

func followUser(userId: Int, completion: @escaping (Result<FollowResponseModel>) -> ())
stopped working. There is no error. It just doesn't make us follow the user.

Login failed

Login failed if the password includes special characters like (+,-). But if it is not, works like a charm..

Fresh user login problem

try to login with a new registered fresh user. web login not completed sometimes randomly. Instagram shows a different user suggestion page. I try to follow 1 user, also 1 user followed me (it shows feed but not worked) mostly web login was not completed for this user. After trying 2-3 times to login it may work.

  • no 2FA - direct login with password

Merging `Siwa` into `SwiftyInsta`

[DONE IN SwiftyInsta v. 2.0]

The login mechanics used in Siwa are far superior to the ones in SwiftyInsta, yet SwiftyInsta still provides a way for headless login, only resulting in code duplication.

Instead of dropping support for authentication through username and password from SwiftyInsta (like I proposed in my draft for 2.0 now in the development branch), why not adding all of Siwa functionalities back to SwiftyInsta?

What's the reasoning behind having them as separate frameworks?

Timeline

The getTimeLineList(from:_,list:_,…) retrieves a 405 error code response, thus returning an empty list.

(Tested on iOS 13)

Search among users

Hey Mahdi,
I wonder about could you add the feature that provides search users. Like search keyword Mahdi returns many of people like instagram search ?
Thank you..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.