Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pre_login_flow & login_flow to simulate the real open/close application. #1008

Merged
merged 62 commits into from Aug 22, 2019

Conversation

@Tkd-Alex
Copy link
Contributor

commented Aug 16, 2019

Thanks to @maxdevblock .

maxdevblock and others added 4 commits Aug 16, 2019
Merge pull request #1 from maxdevblock/patch-1
Fix 'id', 'phone_id' and 'device_id'
@codecov-io

This comment has been minimized.

Copy link

commented Aug 17, 2019

Codecov Report

Merging #1008 into login-flow will increase coverage by 0.59%.
The diff coverage is 40.51%.

Impacted file tree graph

@@              Coverage Diff               @@
##           login-flow    #1008      +/-   ##
==============================================
+ Coverage        41.9%   42.49%   +0.59%     
==============================================
  Files              28       29       +1     
  Lines            3272     3339      +67     
  Branches          534      547      +13     
==============================================
+ Hits             1371     1419      +48     
- Misses           1771     1782      +11     
- Partials          130      138       +8
Impacted Files Coverage Δ
instabot/bot/bot_stats.py 21.21% <ø> (ø) ⬆️
instabot/bot/bot_unfollow.py 9.8% <0%> (ø) ⬆️
instabot/bot/bot_story.py 8.57% <0%> (ø) ⬆️
instabot/bot/bot_block.py 13.72% <0%> (ø) ⬆️
instabot/api/prepare.py 11.94% <0%> (ø) ⬆️
instabot/bot/bot_delete.py 14.28% <0%> (ø) ⬆️
instabot/bot/bot_archive.py 10.81% <0%> (ø) ⬆️
instabot/api/__init__.py 100% <100%> (ø) ⬆️
instabot/api/devices.py 100% <100%> (ø) ⬆️
instabot/api/config.py 100% <100%> (ø) ⬆️
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update deb55c0...b23239f. Read the comment docs.

@ohld

This comment has been minimized.

Copy link
Member

commented Aug 17, 2019

Looks great! Is it safe to merge this PR right now?

@maxdevblock

This comment has been minimized.

Copy link
Collaborator

commented Aug 17, 2019

Looks great! Is it safe to merge this PR right now?

There's some other work to do about android_device_id (that's called device_id during login and logout), but it's safe to merge, everything seems to work fine.

@lexan73

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

@maxdevblock

This comment has been minimized.

Copy link
Collaborator

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

device_id and phone_id
  - Fixed `device_id` generated from random UUID (and not from `username`, `password`)
  - Added `reinstall_app_simulation`
  - Added `change_device_simulation`
@lexan73

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

I did Pull Request with that fix

@maxdevblock

This comment has been minimized.

Copy link
Collaborator

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

I did Pull Request with that fix

I'm gonna test it now.

@maxdevblock

This comment has been minimized.

Copy link
Collaborator

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

I did Pull Request with that fix

I'm gonna test it now.

Good.

@Tkd-Alex we still need to fix the login_flow, it generates new phone_id and device_id everytime. It should read them from uuid_cookie json file and generate them only if json file doesn't exist.

@maxdevblock

This comment has been minimized.

Copy link
Collaborator

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

I did Pull Request with that fix

Push it here, so when everything will be fine, we'll merge a complete PR only. Ok?

@ohld

This comment has been minimized.

Copy link
Member

commented Aug 18, 2019

Yes, I think it will be much better if all RETHINKING OF LOGIN PIPELINE will be in one branch. You can merge pull requests into another pull request.

We can even call it a next instabot major update! Seems like a huge work done here

@ohld

This comment has been minimized.

Copy link
Member

commented Aug 18, 2019

One suggestion: since login flow consists of a lot of functions - maybe it is better to move all of them to separate file login.py

@lexan73

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

You're right...! We need to fix this.

I did Pull Request with that fix

Push it here, so when everything will be fine, we'll merge a complete PR only. Ok?

it seems I don't have permission to push even into a branch :( I did PR in this branch

@Tkd-Alex

This comment has been minimized.

Copy link
Contributor Author

commented Aug 18, 2019

One suggestion: since login flow consists of a lot of functions - maybe it is better to move all of them to separate file login.py

@ohld we can also split the api dedicated to direct endpoint
but, for this PR It's a god idea :)

ohld and others added 9 commits Aug 18, 2019
Fix signal if login is threaded
if login function is run threaded, for example in scheduled job, signal will fail because it 'only works in main thread'.
In this case, you may want to call login(is_threaded=True).
@basnijholt

This comment has been minimized.

Copy link
Collaborator

commented Aug 20, 2019

At the request of @ohld I've added my changes of #1014 on top of this PR.

@ohld

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Great changes! Thanks!

basnijholt and others added 5 commits Aug 20, 2019
Commented out open link simulation
commented out simulation of "open link in app"
@ohld
ohld approved these changes Aug 20, 2019
maxdevblock added 3 commits Aug 20, 2019
Fixed login
New defaults
  - use_cookie=True
  - is_threaded=False
temporary fix test_bot login
temporary fix for test_bo
login(use_cookie=False)

TODO: implement test_bot login with use_cookie=True
Load uuid and/or cookie
Separate load_uuid from load_cookie
@caffeinum
Copy link

left a comment

👀

maxdevblock and others added 3 commits Aug 21, 2019
pending threads update
1. fixed post data in approve_pending_thread
2. added endpoint for hide_pending_thread
3. added endpoint for decline_pending_thread
@ohld
ohld approved these changes Aug 22, 2019
@@ -46,7 +46,7 @@


class API(object):
def __init__(self, device=None, base_path=""):
def __init__(self, device=None, base_path="", save_logfile=True, log_filename=None):

This comment has been minimized.

Copy link
@reliefs

reliefs Aug 22, 2019

Member

is it possible to change path by doing
log_filename="path/instabot.log"
or is this only for filename change ?

This comment has been minimized.

Copy link
@Tkd-Alex

Tkd-Alex Aug 22, 2019

Author Contributor

also work with the path 😄

@ohld

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

I'll merge this PR now because it points to login-flow branch, not master. This is not a release yet

@ohld ohld merged commit be9d428 into instagrambot:login-flow Aug 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.