/TikTop-Bot

Unofficial API for TikTop-free and TikTok

Primary LanguagePython

TikTop-Bot

This is a bot for automatically completing tasks on the TikTop-free

Quick Start

  • Add in file config.py your chrome version (None = Latest Stable)

  • You need to add the email and password from the TikTop-free account in the file config.py

    • To authorize with cookies, you need
      • Run file create_cookie.py
      • Write 1 in console
      • Press enter and login manually in the browser that appears
      • Then write email which you used to login in console
      • The email must be written as in file config.py
      • ! Cookie authorization will activate if normal authorization fails
      • ! If normal authorization is success then cookies is saved
  • You must add the usernames(without '@') and passwords of the TikTok accounts that will be used for farming in file config.py

    • To authorize with cookies, you need
      • Run file create_cookie.py
      • Write 2 in console
      • Press enter and login manually in the browser that appears
      • Then write username(without '@') which you used to login in console
      • The cookie name must be a username written as in file tiktok_accounts.py
      • ! Cookie authorization will activate if normal authorization fails
      • ! If normal authorization is success then cookies is saved
  • Install requirements

  • Run main.py

Short documentation

src/api/tiktok.api

  • class TikTokApi:
    • __init__(driver) - Accepts the selenium driver object
    • is_logged_in() - Checks if the user is logged in, returns boolean value
    • login_with_username() - Allows to log into account, accepts arguments username and password from tiktok account
    • login_with_cookies() - Allows to log into account with cookies, accepts filename of cookie
    • save_cookies() - Allows to save cookies, accepts filename for cookie
    • is_video_liked() - Checks if the video is liked, accepts url of this video
    • like_the_video() - Allows to like the video (needed to be logged), accepts url of this video, if already liked - skips
    • is_user_following() - Checks if the user is followed, returns boolean value
    • follow_user() - Allows to subscribe to a user (needed to be logged), accepts url of this video, if already subscribed - skips

src/api/tiktop.api

  • class TikTopApi:
    • __init__(driver, login, password) - Accepts the selenium driver object and task type
    • wait_progressbar_loading() - Looks for Progress Bar in html, if present, waits until it disapear. This is necessary for the site to load to the end.
    • get_toast_message() - Returns notification message. It appears at the top right when logging in, completing tasks, adding accounts, etc.
    • is_logged_in() - Checks if the user is logged in, returns boolean value
    • login_with_email() - Allows to log into account, accepts arguments email and password from TikTop-free account
    • login_with_cookies() - Allows to log into account with cookies, accepts filename of cookie
    • save_cookies() - Allows to save cookies, accepts filename for cookie
    • change_tiktok_account() - Selects TikTok account on the TikTop-free. Accepts username(without '@') of TikTok account to be selected
    • get_task_url() - Returns current task url to be completed (depends of the value of the task_type. Ex.: if task_type = 'like' then it returns video to be liked)
    • check_task() - Clicks on the check task button and return toast message
    • close_task() - Clicking on the close task button (skip task)