Follow the `Following` of given users
(
self,
usernames: list,
amount: int = 10,
randomize: bool = False,
interact: bool = False,
sleep_delay: int = 600,
)
| 3821 | return self |
| 3822 | |
| 3823 | def follow_user_following( |
| 3824 | self, |
| 3825 | usernames: list, |
| 3826 | amount: int = 10, |
| 3827 | randomize: bool = False, |
| 3828 | interact: bool = False, |
| 3829 | sleep_delay: int = 600, |
| 3830 | ): |
| 3831 | """Follow the `Following` of given users""" |
| 3832 | if self.aborting: |
| 3833 | return self |
| 3834 | |
| 3835 | message = "Starting to follow user `Following`.." |
| 3836 | highlight_print(self.username, message, "feature", "info", self.logger) |
| 3837 | |
| 3838 | if not isinstance(usernames, list): |
| 3839 | usernames = [usernames] |
| 3840 | |
| 3841 | followed_all = 0 |
| 3842 | followed_new = 0 |
| 3843 | not_valid_users = 0 |
| 3844 | |
| 3845 | # hold the current global values for differentiating at the end |
| 3846 | already_followed_init = self.already_followed |
| 3847 | liked_init = self.liked_img |
| 3848 | already_liked_init = self.already_liked |
| 3849 | commented_init = self.commented |
| 3850 | inap_img_init = self.inap_img |
| 3851 | |
| 3852 | # below, can use a static value instead of from random range.. |
| 3853 | relax_point = random.randint(7, 14) |
| 3854 | self.quotient_breach = False |
| 3855 | |
| 3856 | for index, user in enumerate(usernames): |
| 3857 | if self.quotient_breach: |
| 3858 | break |
| 3859 | |
| 3860 | self.logger.info( |
| 3861 | "User '{}' [{}/{}]".format((user), index + 1, len(usernames)) |
| 3862 | ) |
| 3863 | try: |
| 3864 | person_list, simulated_list = get_given_user_following( |
| 3865 | self.browser, |
| 3866 | self.username, |
| 3867 | user, |
| 3868 | amount, |
| 3869 | self.dont_include, |
| 3870 | randomize, |
| 3871 | self.blacklist, |
| 3872 | self.follow_times, |
| 3873 | self.simulation, |
| 3874 | self.jumps, |
| 3875 | self.logger, |
| 3876 | self.logfolder, |
| 3877 | ) |
| 3878 | |
| 3879 | except (TypeError, RuntimeWarning) as err: |
| 3880 | if isinstance(err, RuntimeWarning): |
nothing calls this directly
no test coverage detected