Skip to content
7 changes: 7 additions & 0 deletions wplay/about_changer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time
import os
import sys
import win32gui, win32con

from newsapi.newsapi_client import NewsApiClient
import requests
Expand All @@ -17,6 +18,12 @@

async def about_changer():
page, _ = await browser_config.configure_browser_and_load_whatsapp()
#Waiting time for Login
time.sleep(8)
#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
query: str = str(input("What's the news theme? : "))

await page.waitForSelector(whatsapp_selectors_dict['profile_photo_element'], visible=True)
Expand Down
11 changes: 11 additions & 0 deletions wplay/broadcast_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from tkinter import Tk
from tkinter.filedialog import askopenfile
from pathlib import Path
import time
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils.target_search import search_target_by_number
Expand All @@ -22,6 +24,15 @@ class InvalidNumber(Exception):

def ProcessNumbers():
__logger.info("Processing numbers.")

#Waiting time for Login
time.sleep(8)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)

print("Choose a text file containing full numbers with country code, one number per line.")
Tk().withdraw()
filename = askopenfile(
Expand Down
6 changes: 6 additions & 0 deletions wplay/download_media.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# region Imports
from pathlib import Path
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils import target_search
Expand Down Expand Up @@ -32,6 +33,11 @@ async def download_media(target):
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)

count = int(input("Count of media you want to download: "))

# Click on the photo element of the target
Expand Down
7 changes: 7 additions & 0 deletions wplay/get_media.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# region Imports
import time
from pathlib import Path
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils.Logger import Logger
Expand All @@ -15,6 +16,12 @@

async def get_profile_photos():
page, _ = await browser_config.configure_browser_and_load_whatsapp()
#Waiting time for Login
time.sleep(8)
#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
total_contacts = int(input("Please provide total whatsapp contacts: "))
loop = round(total_contacts/7)
images_list = []
Expand Down
5 changes: 5 additions & 0 deletions wplay/get_news.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# region IMPORTS
from pathlib import Path
import time
import win32gui, win32con

from newsapi.newsapi_client import NewsApiClient

Expand Down Expand Up @@ -38,6 +39,10 @@ def fetch_news(country_code):
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
country = input("Enter your country code (ex: us or in): ")
while True:
try:
Expand Down
7 changes: 7 additions & 0 deletions wplay/message_blast.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# region IMPORTS
from pathlib import Path
from typing import List
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils import target_search
Expand All @@ -22,6 +23,12 @@ async def message_blast(target: str):
await target_search.search_and_select_target_all_ways(page, target)
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)

message: List[str] = io.ask_user_for_message_breakline_mode()
number_of_messages: int = int(input("Enter the number of messages to blast: "))
__logger.debug("Blasting messages")
Expand Down
7 changes: 6 additions & 1 deletion wplay/message_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import threading
import time
import json
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils.target_search import search_target_by_number
Expand Down Expand Up @@ -44,10 +45,15 @@

async def message_service():
page, _ = await browser_config.configure_browser_and_load_whatsapp()
#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
__logger.info("Message Service On.")
print("Message Service is ON, press CTRL+C to stop.")
print("Listening for messages in file 'messages.json' inside user/wplay/messagesJSON folder.")
# Initialize a instance of MessageStack

message_stack = MessageStack()
# Move all messages from open_messages.json to messages.json when the program starts
message_stack.move_all_messages(helpers.open_messages_json_path, helpers.messages_json_path)
Expand Down Expand Up @@ -79,6 +85,5 @@ async def message_service():
else:
__logger.debug('Internet is not available, trying again after 15 seconds.')
time.sleep(15)

# Move messages from open_messages.json to messages.json that wasn't sended.
message_stack.move_all_messages(helpers.open_messages_json_path, helpers.messages_json_path)
7 changes: 7 additions & 0 deletions wplay/message_timer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# region IMPORTS
import time
import random
import win32gui, win32con
from pathlib import Path

from wplay.utils import browser_config
Expand Down Expand Up @@ -28,6 +29,12 @@ async def message_timer(target):
await target_search.search_and_select_target_without_new_chat_button(page, target)
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)

# Region INPUTS
__logger.info("Input message information for message timer")
message_type_numbers: int = int(input("How many types of messages will you send? "))
Expand Down
5 changes: 5 additions & 0 deletions wplay/online_tracker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import time
import win32gui, win32con
from pathlib import Path
from datetime import datetime
from playsound import playsound
Expand Down Expand Up @@ -31,6 +32,10 @@ async def tracker(target):
else: # if target is none then it allow user to select target manually from browser
target_name = await target_select.manual_select_target(page, hide_groups=True)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
# opens status file of the target person
status_file: str = open(tracking_folder_path / f'status_{target_name}.txt', 'w').close()
status_file: str = open(tracking_folder_path / f'status_{target_name}.txt', 'a')
Expand Down
6 changes: 6 additions & 0 deletions wplay/schedule_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path
import time
import sys
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils import target_search
Expand All @@ -23,6 +24,11 @@ async def schedule_message(target):
await target_search.search_and_select_target(page, target)
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
time_ = input("Enter the schedule time in HH:MM:SS format-> ")
hour, minute, second = time_.split(':')
current_time = datetime.now()
Expand Down
6 changes: 6 additions & 0 deletions wplay/target_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from phonenumbers import timezone
import re
import sys
import win32gui, win32con
from pathlib import Path
from wplay.utils.Logger import Logger
# end IMPORTS
Expand Down Expand Up @@ -101,6 +102,11 @@ async def target_info(target):
await target_search.search_and_select_target_without_new_chat_button(page, target)
else:
await target_select.manual_select_target(page)

#Minimizing the Window after Target Select
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
"""
# to find location by ip address
print('Get you ipinfo token from https://ipinfo.io/account')
Expand Down
9 changes: 9 additions & 0 deletions wplay/terminal_chat.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# region IMPORTS
from pathlib import Path
import win32gui, win32con

from wplay.utils import browser_config
from wplay.utils import target_search
Expand All @@ -18,6 +19,7 @@


async def chat(target):
initial_minimize = True
__logger.info("Chatting with target")
page, _ = await browser_config.configure_browser_and_load_whatsapp()

Expand All @@ -34,6 +36,13 @@ async def chat(target):
print("\033[91m {}\033[00m".format("\nType '...' in a new line or alone in the message to change target person.\nType '#_FILE' to send Image/Video/Documentd etc.\n"))

while True:
#Minimizing the Window after Target Select
if (initial_minimize==True):
print("Browser Minimized")
Minimize = win32gui.GetForegroundWindow()
win32gui.ShowWindow(Minimize, win32con.SW_MINIMIZE)
initial_minimize = False

await getMessages(page, target)
message: list[str] = io.ask_user_for_message_breakline_mode()

Expand Down