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

Fix the language check in the application #362

Closed
wants to merge 213 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
f9741a3
Fix follow (#109)
mastrolube Dec 1, 2020
531dd7e
🎁 adding --debug flag (#105)
philip-ulrich Dec 2, 2020
292b2fa
🐈 pause option when quitting (#115)
Dec 2, 2020
48997e3
🐈 improvements for hashtag-likers on older devices and memu (#112)
mastrolube Dec 2, 2020
ee84ffb
following and follower filter (#106)
philip-ulrich Dec 3, 2020
bb34564
Fix crash stories and private profile (#117)
mastrolube Dec 6, 2020
71361b0
Fix --analytics Bugs with Missing Session Data (#103)
philip-ulrich Dec 6, 2020
360cad9
Changing to Pypi for Release (#118)
philip-ulrich Dec 6, 2020
92f754f
fixing bio expand (#120)
philip-ulrich Dec 7, 2020
4de2abf
noice (#121)
philip-ulrich Dec 7, 2020
c128d1d
:memo: typo
philip-ulrich Dec 7, 2020
9b7570e
speed multiplier and scrolls limit (#124)
philip-ulrich Dec 7, 2020
8eb84cc
Create interact_hashtag_posts.py
mastrolube Dec 5, 2020
2112923
resolving conflicts
mastrolube Dec 6, 2020
c63e5a7
resolving conflicts
mastrolube Dec 6, 2020
bdf42e7
forget to remove old codes
mastrolube Dec 6, 2020
a5062a4
small cleanups
philip-ulrich Dec 7, 2020
c9574e6
changing reference to old arguemnt name
philip-ulrich Dec 7, 2020
18b09a8
:rage: linting
philip-ulrich Dec 7, 2020
9057d3c
switching to get_value for session_state total_limits (#132)
philip-ulrich Dec 7, 2020
61983a6
bugfixes + hashtag-post improve
mastrolube Dec 7, 2020
30c24b9
Merge branch 'hashtag-post-recent' of https://github.com/GramAddict/b…
mastrolube Dec 7, 2020
1c5acd5
--hashtag-posts-top
mastrolube Dec 8, 2020
0ad50a4
black by hands
mastrolube Dec 8, 2020
d89826c
Update interact_hashtag_posts.py
mastrolube Dec 8, 2020
3eb8f1e
Update interaction.py
mastrolube Dec 8, 2020
81c6739
Merge branch 'develop' into hashtag-post-recent
philip-ulrich Dec 8, 2020
7b9997b
Update interact_hashtag_posts.py
mastrolube Dec 8, 2020
ca8d54c
Merge branch 'hashtag-post-recent' of https://github.com/GramAddict/b…
mastrolube Dec 8, 2020
7ddbaf1
Update interact_hashtag_posts.py
mastrolube Dec 8, 2020
29b7482
update readme (#125)
philip-ulrich Dec 8, 2020
9033c60
add logic to handle unfollowing any-non-followers (#133)
philip-ulrich Dec 8, 2020
7b3c487
fixes and improvements
mastrolube Dec 8, 2020
4738422
- fix another bug if recent and top are used toghetter
mastrolube Dec 8, 2020
85f822f
Update interact_hashtag_likers.py
mastrolube Dec 8, 2020
f161bfd
bugfixes and improvements
mastrolube Dec 9, 2020
33dc6a4
Update interaction.py
mastrolube Dec 9, 2020
6fd1b8e
fixs
mastrolube Dec 10, 2020
a7c661d
Merge branch 'develop' into hashtag-post-recent
mastrolube Dec 10, 2020
590849d
Get rid of possible inifinite loops (#135)
arthurspa Dec 11, 2020
f9abc4c
fixes
mastrolube Dec 11, 2020
f596fd6
Merge branch 'develop' into hashtag-post-recent
philip-ulrich Dec 11, 2020
370ebf0
scrapping thing
mastrolube Dec 12, 2020
d3dc232
config file update / uia1 support (#136)
philip-ulrich Dec 12, 2020
20d4e5a
Merge branch 'develop' into hashtag-post-recent
mastrolube Dec 12, 2020
c767155
merge things
mastrolube Dec 12, 2020
67d543c
porting missing resources
mastrolube Dec 12, 2020
4d6c767
Update action_unfollow_followers.py
mastrolube Dec 12, 2020
408c3b3
cleaning and fixing things
mastrolube Dec 13, 2020
6be2ecf
Update views.py
mastrolube Dec 13, 2020
c5cb722
Merge branch 'develop' into scrap-usernames
mastrolube Dec 13, 2020
ab2b2a3
Update session_state.py
mastrolube Dec 13, 2020
cfc901a
Hashtag post recent (#129)
philip-ulrich Dec 13, 2020
97322bb
Merge branch 'develop' into scrap-usernames
philip-ulrich Dec 13, 2020
cee777f
Update interaction.py
philip-ulrich Dec 13, 2020
e6fc4bb
fixes (#143)
mastrolube Dec 13, 2020
c880fc3
minor fixes
philip-ulrich Dec 14, 2020
1998862
updating verbiage on fling
philip-ulrich Dec 14, 2020
d617e89
kill atx-agent and uia1
philip-ulrich Dec 14, 2020
b479c37
Create interact_usernames.py (#128)
philip-ulrich Dec 14, 2020
490caed
Merge branch 'develop' into scrap-usernames
philip-ulrich Dec 14, 2020
040d8fe
config updates (#145)
philip-ulrich Dec 14, 2020
1682af4
updating deployment info and file structure
philip-ulrich Dec 14, 2020
226589e
update varable name
philip-ulrich Dec 14, 2020
b2d47fb
Hashtag-likers improvement (#147)
mastrolube Dec 14, 2020
02b128e
Merge branch 'develop' into scrap-usernames
mastrolube Dec 15, 2020
e209b3c
extend scraping to other plugins
mastrolube Dec 15, 2020
269e9f6
Merge branch 'develop' into scrap-usernames
mastrolube Dec 15, 2020
5707e40
black
mastrolube Dec 15, 2020
0b3b030
adding additional instructions for deployment
philip-ulrich Dec 15, 2020
fe561a7
fixing parameters and deployment files
philip-ulrich Dec 15, 2020
90ff287
scraping-mode available
mastrolube Dec 15, 2020
0b691df
Update __init__.py
mastrolube Dec 15, 2020
7ef39d1
Merge branch 'develop' into scrap-usernames
mastrolube Dec 15, 2020
d4b7916
change username according to configuration file loaded (#149)
mastrolube Dec 15, 2020
da09043
Merge branch 'develop' into scrap-usernames
mastrolube Dec 16, 2020
b8d0955
updating version
philip-ulrich Dec 16, 2020
dcfe8d3
new core argument --delete-interacted-user (#150)
mastrolube Dec 17, 2020
2289bcb
fix a bug if profile is private
mastrolube Dec 17, 2020
7682df0
change the argumento to scrape-to-file
mastrolube Dec 17, 2020
871b9a8
typo
mastrolube Dec 17, 2020
b95ddbf
fixes and improvements
mastrolube Dec 17, 2020
59fc76e
Merge branch 'develop' into scrap-usernames
mastrolube Dec 19, 2020
f9730c2
fix lint
mastrolube Dec 19, 2020
5ec344c
fix lint
mastrolube Dec 19, 2020
b8da108
fix lint again lol
mastrolube Dec 19, 2020
0a9f43b
fix bug when in not scrape mode
mastrolube Dec 20, 2020
870bc6f
fix force_interact
mastrolube Dec 20, 2020
8c3b466
Update all-parameters.yml
philip-ulrich Dec 21, 2020
d434b76
Update all-parameters.yml
philip-ulrich Dec 21, 2020
f61ffd4
if check of private profile fails, swipe_to_fit_posts won't generate …
mastrolube Dec 21, 2020
ce84a83
fixes
mastrolube Dec 21, 2020
ce649ae
resolving conflicts
philip-ulrich Dec 22, 2020
cce1bcf
Merge branch 'develop' into scrap-usernames
mastrolube Dec 22, 2020
2b04b7d
Strange issue with shell dumpsys window, no mDreamingLockscreen string
Tkd-Alex Dec 28, 2020
b4b8578
:gift: As request in #131 implemented: Interact by location (place). …
Tkd-Alex Dec 28, 2020
7a7749b
:gift: As request in #131 implemented: Interact by location (place). …
Tkd-Alex Dec 28, 2020
584caa7
Create a single method handle_likers in core/interaction.py. And call…
Tkd-Alex Dec 30, 2020
1409e89
Single _search method, It can be helpfully also in interact posts and…
Tkd-Alex Dec 30, 2020
351d144
Create a single method handle_posts in core/interaction.py. And call …
Tkd-Alex Dec 30, 2020
1fa740f
Fix recent switch in search method
Tkd-Alex Dec 30, 2020
034f512
We don't need continue here
Tkd-Alex Jan 2, 2021
e31896c
:rage: pyflakes
Tkd-Alex Jan 2, 2021
93d8368
Merge branch 'develop' into interact-by-location
Tkd-Alex Jan 2, 2021
fe63fc0
:rage: After merge current develop in-to this branch i had to black f…
Tkd-Alex Jan 2, 2021
6a3b531
Merge branch 'master' into scrap-usernames
mastrolube Jan 5, 2021
0d92ace
fix merge
mastrolube Jan 5, 2021
0198786
fix lint
mastrolube Jan 5, 2021
ed4de71
Update like_from_urls.py
mastrolube Jan 5, 2021
b439a5a
move the kill agent (#176)
mastrolube Jan 17, 2021
ea908c0
:bug: :cat2: Check if recent tab exists and print the info box in cas…
Tkd-Alex Jan 17, 2021
dacad5e
🐛 Fix hashtags search on LowerDPI devices + Check if the keyboard is …
Tkd-Alex Jan 17, 2021
bb28539
🎁 More data in interacted_users.json - Add history_filters_users.json…
Tkd-Alex Jan 17, 2021
21cdd58
:gift: NEW FEATURE: COMMENT POSTS (#156)
mastrolube Jan 17, 2021
2761b9e
randomize jobs and truncate sources
mastrolube Jan 31, 2021
9c1df3d
porting in dev atx kill and classes remove
mastrolube Jan 31, 2021
bb9d896
fix filter location bug
mastrolube Feb 2, 2021
72d145b
Merge branch 'randomize-job-and-truncate-list' of https://github.com/…
mastrolube Feb 2, 2021
59dc0f8
do comments can be filtered by job nature
mastrolube Feb 2, 2021
55ac8a7
remove ms in time reports
mastrolube Feb 2, 2021
13ace09
change username fixes
mastrolube Feb 2, 2021
8704d2d
ups
mastrolube Feb 5, 2021
41c7f64
Merge branch 'randomize-job-and-truncate-list' of https://github.com/…
mastrolube Feb 5, 2021
1320402
Update interact_blogger_post_likers.py
mastrolube Feb 5, 2021
e10a1b1
Merge branch 'randomize-job-and-truncate-list' into scrap-usernames
mastrolube Feb 7, 2021
fb4e965
merged the more data and the truncate list to scrape
mastrolube Feb 7, 2021
f31f32e
black things
mastrolube Feb 7, 2021
27fcb9e
Update interact_blogger_post_likers.py
mastrolube Feb 7, 2021
198a755
Merge branch 'interact-by-location' into scap-usernames2
mastrolube Feb 8, 2021
b22a462
Merge branch 'scap-usernames2' of https://github.com/GramAddict/bot i…
mastrolube Feb 17, 2021
0f86196
merge and fixes
mastrolube Feb 17, 2021
00f370f
fixed the changing language
mastrolube Feb 17, 2021
9f5da5d
remove english exception
mastrolube Feb 18, 2021
c23a81a
Delete testatore.seriale directory
mastrolube Feb 18, 2021
2c3842f
fix end jobs etc
mastrolube Feb 18, 2021
09a359d
fix analytics
mastrolube Feb 18, 2021
7c2a5ea
some rewriting
mastrolube Feb 20, 2021
ecbad01
Add files via upload
mastrolube Feb 20, 2021
5caf281
fix interact-username
mastrolube Feb 20, 2021
91f5a0e
Delete requirements_screen_record.txt
mastrolube Feb 20, 2021
da22540
Merge branch 'scap-usernames2' of https://github.com/GramAddict/bot i…
mastrolube Feb 20, 2021
05ddea9
fix range percentage
mastrolube Feb 21, 2021
117f652
1.3.0b1
mastrolube Feb 21, 2021
958f45c
hotfix
mastrolube Feb 21, 2021
7c5809c
fix the session state couting the sleep as well
mastrolube Feb 22, 2021
e72106f
must be a list if only 1 par
mastrolube Feb 22, 2021
4d3a5a7
some fixes
mastrolube Feb 22, 2021
f061c60
hotfix and more
mastrolube Feb 23, 2021
9e334f7
fix navigation for old devices
mastrolube Feb 24, 2021
b7db910
v1.3.0b5
mastrolube Feb 25, 2021
cdcce8e
Merge remote-tracking branch 'origin/fix-navigation-for-old-devices' …
mastrolube Feb 26, 2021
05667d8
1.3.0b6
mastrolube Mar 6, 2021
1afbaee
return arguments for except fix
mastrolube Mar 6, 2021
c0780c0
1.3.0b6.1
mastrolube Mar 8, 2021
2022f35
Update utils.py
mastrolube Mar 9, 2021
5c2bc87
1.3.0b7
mastrolube Mar 12, 2021
127b8aa
typo .. :S
mastrolube Mar 14, 2021
14e34b5
1.3.0b8
mastrolube Mar 14, 2021
564e8eb
Update interaction.py
mastrolube Mar 16, 2021
dd6773a
v1.3.0b9
mastrolube Mar 18, 2021
a5819ca
reorganizing
mastrolube Mar 18, 2021
e64ff3e
rearrange code a little bit
mastrolube Mar 19, 2021
1aa07d4
forgot an argument
mastrolube Mar 19, 2021
9696d0d
fix parenthesis in comment check
mastrolube Mar 19, 2021
b88680d
1.3.0b9.1
mastrolube Mar 19, 2021
3446065
1.3.0b10
mastrolube Mar 19, 2021
1653cdc
1.3.0b10.1
mastrolube Mar 20, 2021
2dde800
ops
mastrolube Mar 20, 2021
9008152
bis
mastrolube Mar 20, 2021
9865343
Keyboard check fail test (#186)
mastrolube Mar 20, 2021
fc85c7b
typo
mastrolube Mar 20, 2021
3b24de1
subprocess fix for linux
mastrolube Mar 20, 2021
2d78399
v2.0
mastrolube Apr 15, 2021
12c3347
small fixes in tab awaiting
mastrolube Apr 16, 2021
b409613
post scroll inprovements
mastrolube Apr 19, 2021
d1a2527
fixes and improvements
mastrolube Apr 19, 2021
1a0c10f
Update session_state.py
mastrolube Apr 19, 2021
3c5a2d7
fixes
mastrolube Apr 19, 2021
f248c5c
Update interaction.py
mastrolube Apr 19, 2021
8491df9
fix lint + errors if things are not setting right
mastrolube Apr 19, 2021
c8ed972
fix lint
mastrolube Apr 19, 2021
e60ab6a
fix failing post open and follow limit blogger
mastrolube Apr 20, 2021
96317d3
v2.0.0b1
mastrolube Apr 21, 2021
7f2cd23
v2.0.0b2
mastrolube Apr 24, 2021
844caa2
2.0.0b3
mastrolube Apr 24, 2021
0a2afcb
v2.0.0b4
mastrolube Apr 26, 2021
dfb3cbe
fix lint
mastrolube Apr 26, 2021
c81158b
Update device_facade.py
mastrolube Apr 26, 2021
6dc9f78
2.0.0b5
mastrolube Apr 26, 2021
b15ea08
2.0.0b6
mastrolube Apr 27, 2021
5dabd0e
Tabproblem (#194)
mastrolube Apr 27, 2021
54ba3b1
ssd fix
mastrolube Apr 28, 2021
63383a1
v2.0.0b8
mastrolube Apr 28, 2021
f68566c
v2.0.0b9
mastrolube Apr 29, 2021
e96a201
v2.0.0b10
mastrolube Apr 29, 2021
5d02f67
v2.0.0b10
mastrolube Apr 30, 2021
2207834
v2.0.0b11
mastrolube Apr 30, 2021
86cd7a3
v2.0.0b12
mastrolube May 1, 2021
3953837
v2.0.0b13
mastrolube May 4, 2021
6b61042
v2
mastrolube May 4, 2021
8cb7fb9
Merge branch 'master' into develop
mastrolube May 4, 2021
c507289
Merge branch 'master' into develop
mastrolube May 6, 2021
7e0a450
Merge branch 'master' into develop
mastrolube May 7, 2021
64dc49a
Merge branch 'master' into develop
mastrolube Oct 24, 2021
218d136
fix: caseless comparison for app language checking
mastrolube Jan 12, 2024
8af7319
Merge pull request #356 from GramAddict/master
mastrolube Jan 12, 2024
a3ccb9d
Merge pull request #357 from GramAddict/355-checkifenglish-function
mastrolube Jan 12, 2024
ad51cd2
docs: more details on how to open a ticket
mastrolube Jan 12, 2024
41ff158
bump: update ig version
mastrolube Jan 12, 2024
2b02d81
fix: forgot to remove unused var
mastrolube Jan 23, 2024
7314197
fix: remove unused imports
mastrolube Jan 24, 2024
a26ed66
fix: extract navigate to main account from check language function
mastrolube Jan 24, 2024
02bf0d0
bump: update version
mastrolube Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ labels: kind/bug


Relevant Logs:

- activate debug mode in confing.yml if you want to paste from the console, otherwise attach the log file from the logs folder



Expand Down
4 changes: 2 additions & 2 deletions GramAddict/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Human-like Instagram bot powered by UIAutomator2"""
__version__ = "3.2.7"
__tested_ig_version__ = "226.1.0.16.117"
__version__ = "3.2.8"
__tested_ig_version__ = "263.2.0.19.104"

from GramAddict.core.bot_flow import start_bot

Expand Down
1 change: 1 addition & 0 deletions GramAddict/core/bot_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def start_bot(**kwargs):
account_view = AccountView(device)
tab_bar_view = TabBarView(device)
try:
account_view.navigate_to_main_account()
check_if_english(device)
if configs.args.username is not None:
success = account_view.changeToUsername(configs.args.username)
Expand Down
30 changes: 4 additions & 26 deletions GramAddict/core/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@

from GramAddict.core.device_facade import Timeout
from GramAddict.core.views import (
AccountView,
HashTagView,
LanguageView,
OptionsView,
PlacesView,
PostsGridView,
ProfileView,
SettingsView,
TabBarView,
UniversalActions,
)
Expand All @@ -21,36 +17,18 @@


def check_if_english(device):
logger.debug("Navigate to PROFILE.")
UniversalActions.close_keyboard(device)
ProfileView(device).click_on_avatar()
if ProfileView(device).getFollowingCount() is None:
ProfileView(device).click_on_avatar()
"""check if app is in English"""
logger.debug("Checking if app is in English..")
post, follower, following = ProfileView(device)._getSomeText()
if None in {post, follower, following}:
logger.warning(
"Failed to check your Instagram language. Be sure to set it to English or the bot won't work!"
)
elif post == "Posts" and follower == "Followers" and following == "Following":
elif post == "posts" and follower == "followers" and following == "following":
logger.debug("Instagram in English.")
else:
logger.info("Switching to English locale.", extra={"color": f"{Fore.GREEN}"})
try:
ProfileView(device).navigateToOptions()
OptionsView(device).navigateToSettings()
SettingsView(device).navigateToAccount()
AccountView(device).navigateToLanguage()
LanguageView(device).setLanguage("english")
logger.debug(
"After changing language, IG goes to feed. Let's go to profile view again."
)
ProfileView(device).click_on_avatar()
except Exception as ex:
logger.error(f"Please change the language manually to English! Error: {ex}")
sys.exit(1)
if ProfileView(device).getFollowingCount() is None:
ProfileView(device).click_on_avatar()
logger.error("Please change the language manually to English!")
sys.exit(1)
return ProfileView(device, is_own_profile=True)


Expand Down
12 changes: 10 additions & 2 deletions GramAddict/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,13 @@ def navigateToLanguage(self):
logger.error("Not able to set your app in English! Do it by yourself!")
exit(0)

def navigate_to_main_account(self):
logger.debug("Navigating to main account...")
profile_view = ProfileView(self.device)
profile_view.click_on_avatar()
if profile_view.getFollowingCount() is None:
profile_view.click_on_avatar()

def changeToUsername(self, username: str):
action_bar = ProfileView._getActionBarTitleBtn(self)
if action_bar is not None:
Expand Down Expand Up @@ -1449,7 +1456,8 @@ def _getActionBarTitleBtn(self, watching_stories=False):
)
return None

def _getSomeText(self):
def _getSomeText(self) -> Tuple[Optional[str], Optional[str], Optional[str]]:
"""Get some text from the profile to check the language"""
obj = self.device.find(
resourceIdMatches=ResourceID.ROW_PROFILE_HEADER_TEXTVIEW_POST_CONTAINER
)
Expand Down Expand Up @@ -1477,7 +1485,7 @@ def _getSomeText(self):
.child(index=1)
.get_text()
)
return post, followers, following
return post.casefold(), followers.casefold(), following.casefold()
except Exception as e:
logger.debug(f"Exception: {e}")
logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion GramAddict/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# that file is deprecated, current version is now stored in GramAddict/__init__.py
__version__ = "3.2.7"
__version__ = "3.2.8"