Skip to content
This repository has been archived by the owner. It is now read-only.

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

@Tkd-Alex Tkd-Alex commented Aug 16, 2019

Thanks to @maxdevblock .

@codecov-io
Copy link

@codecov-io codecov-io 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
Copy link
Owner

@ohld ohld commented Aug 17, 2019

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

@maxdevblock
Copy link
Contributor

@maxdevblock maxdevblock 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
Copy link
Contributor

@lexan73 lexan73 commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

@maxdevblock
Copy link
Contributor

@maxdevblock maxdevblock commented Aug 18, 2019

wait a sec looks like we lost checkpoint at all

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

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

@lexan73 lexan73 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
Copy link
Contributor

@maxdevblock maxdevblock 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
Copy link
Contributor

@maxdevblock maxdevblock 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
Copy link
Contributor

@maxdevblock maxdevblock 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
Copy link
Owner

@ohld ohld 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
Copy link
Owner

@ohld ohld 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
Copy link
Contributor

@lexan73 lexan73 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
Copy link
Contributor Author

@Tkd-Alex Tkd-Alex 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 :)

instabot/bot/bot_like.py Outdated Show resolved Hide resolved
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
Copy link
Collaborator

@basnijholt basnijholt commented Aug 20, 2019

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

@ohld
Copy link
Owner

@ohld ohld commented Aug 20, 2019

Great changes! Thanks!

ohld
ohld approved these changes Aug 20, 2019
maxdevblock added 3 commits Aug 20, 2019
New defaults
  - use_cookie=True
  - is_threaded=False
temporary fix for test_bo
login(use_cookie=False)

TODO: implement test_bot login with use_cookie=True
Separate load_uuid from load_cookie
Copy link

@caffeinum caffeinum left a comment

👀

maxdevblock and others added 3 commits Aug 21, 2019
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):
Copy link
Contributor

@steffanjensen steffanjensen Aug 22, 2019

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

Copy link
Contributor Author

@Tkd-Alex Tkd-Alex Aug 22, 2019

also work with the path 😄

@ohld
Copy link
Owner

@ohld ohld 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 ohld:login-flow Aug 22, 2019
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants