Awaken-publishing 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- awaken_publishing-0.1.0/Awaken_publishing.egg-info/PKG-INFO +9 -0
- awaken_publishing-0.1.0/Awaken_publishing.egg-info/SOURCES.txt +6 -0
- awaken_publishing-0.1.0/Awaken_publishing.egg-info/dependency_links.txt +1 -0
- awaken_publishing-0.1.0/Awaken_publishing.egg-info/top_level.txt +1 -0
- awaken_publishing-0.1.0/PKG-INFO +9 -0
- awaken_publishing-0.1.0/init.py +59 -0
- awaken_publishing-0.1.0/setup.cfg +4 -0
- awaken_publishing-0.1.0/setup.py +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
init
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from selenium import webdriver
|
|
2
|
+
from selenium.webdriver.common.by import By
|
|
3
|
+
from selenium.webdriver.support.ui import WebDriverWait
|
|
4
|
+
from selenium.webdriver.support import expected_conditions as EC
|
|
5
|
+
from selenium.webdriver.chrome.service import Service
|
|
6
|
+
from webdriver_manager.chrome import ChromeDriverManager
|
|
7
|
+
from os import getcwd
|
|
8
|
+
|
|
9
|
+
chrome_options = webdriver.ChromeOptions()
|
|
10
|
+
chrome_options.add_argument("--use-fake-ui-for-media-stream")
|
|
11
|
+
|
|
12
|
+
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),options=chrome_options)
|
|
13
|
+
|
|
14
|
+
website = "https://allorizenproject1.netlify.app/"
|
|
15
|
+
|
|
16
|
+
driver.get(website)
|
|
17
|
+
|
|
18
|
+
rec_file = f"{getcwd()}\\input.txt"
|
|
19
|
+
|
|
20
|
+
def listen():
|
|
21
|
+
try:
|
|
22
|
+
start_button = WebDriverWait(driver, 20).until(
|
|
23
|
+
EC.element_to_be_clickable((By.ID, "startButton"))
|
|
24
|
+
)
|
|
25
|
+
start_button.click()
|
|
26
|
+
print("listening...")
|
|
27
|
+
|
|
28
|
+
output_text = ""
|
|
29
|
+
is_second_click = False
|
|
30
|
+
|
|
31
|
+
while True:
|
|
32
|
+
start_button = WebDriverWait(driver, 20).until(
|
|
33
|
+
EC.element_to_be_clickable((By.ID, "startButton"))
|
|
34
|
+
)
|
|
35
|
+
output_element = WebDriverWait(driver, 20).until(
|
|
36
|
+
EC.presence_of_element_located((By.ID, "output"))
|
|
37
|
+
)
|
|
38
|
+
current_text = output_element.text.strip()
|
|
39
|
+
|
|
40
|
+
if "Start Listening" in start_button.text and is_second_click:
|
|
41
|
+
if output_text:
|
|
42
|
+
is_second_click = False
|
|
43
|
+
elif "Listening..." in start_button.text:
|
|
44
|
+
is_second_click = True
|
|
45
|
+
if current_text and current_text != output_text:
|
|
46
|
+
output_text = current_text
|
|
47
|
+
with open(rec_file, "w", encoding="utf-8") as file:
|
|
48
|
+
file.write(output_text.lower())
|
|
49
|
+
print("USER : " + output_text)
|
|
50
|
+
except KeyboardInterrupt:
|
|
51
|
+
pass
|
|
52
|
+
except Exception as e:
|
|
53
|
+
print("ERROR:", e)
|
|
54
|
+
input("Press Enter to exit...")
|
|
55
|
+
|
|
56
|
+
listen()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="Awaken-publishing",
|
|
5
|
+
version="0.1.0",
|
|
6
|
+
author='ANUJ KUMAR',
|
|
7
|
+
author_email='anujdrawings@gmail.com',
|
|
8
|
+
description= ' This is a speech to text by Anuj Kumar'
|
|
9
|
+
)
|
|
10
|
+
packages = find_packages(),
|
|
11
|
+
install_requirements = [
|
|
12
|
+
'selenium',
|
|
13
|
+
'webdriver_manager'
|
|
14
|
+
]
|