Skip to content

Commit

Permalink
Merge pull request #30 from ThaaoBlues/main
Browse files Browse the repository at this point in the history
V1.9.0
  • Loading branch information
ThaaoBlues authored Feb 20, 2023
2 parents 320d01a + 1aa9320 commit f2c218b
Show file tree
Hide file tree
Showing 16 changed files with 821 additions and 509 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ output
output/*
copypasta.exe
*.build
*.dist
*.dist
tmp/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
- you only needs to start CopyPasta once on your desktop, even if you close the browser window CopyPasta can still receive scans and notify you ! (You still need to restart it after each shutdown of your computer)
- If you have closed the browser window, you can reopen it by clicking on the shortcut like if you wanted to start copypasta or even just send your things and click on the notification toast ;D

## new feature in building : PC-to-PC copypasta !

## Installation :
- download "launcher.exe" from the releases section
- start the file once downloaded (let it make its things, it takes some time to download everything :D )
Expand Down
54 changes: 28 additions & 26 deletions client.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
import requests
from util import *

def send_text_scan(text):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "text", "content" : f"{text}"})
print(r.text)
def send_text_scan(text:str,ip_addr:str) -> bool:
"""
sends the specified text
to the instance of copypasta running on the specified address
"""
r = requests.post(f"http://{ip_addr}:21987/upload",json={"type" : "text", "content" : f"{text}"})

return r.status_code == 200

def send_file(file_path):
files = {'files': open(file_path,'rb')}
r = requests.post("http://127.0.0.1:21987/upload", files = files)
print(r.text)

def send_file(file_path:str,ip_addr:str):

"""
sends the specified file
to the instance of copypasta running on the specified address
"""

files = {'files': open(file_path,'rb')}

r = requests.post(f"http://{ip_addr}:21987/upload",files=files)
return r.status_code == 200

def send_keystrokes(text):
def send_keystrokes(text:str):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "keystrokes", "content" : {"text" : f"{text}"}})
print(r.text)
return r.status_code == 200

def send_barcode(text):
def send_barcode(text:str):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "isbn", "content" : f"{text}"})
print(r.text)
return r.status_code == 200


def send_wifi(ssid, encryption, key):
def send_wifi(ssid:str, encryption:str, key:str):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "wifi", "content" : {"ssid" : f"{ssid}", "encryption" : f"{encryption}", "key" : f"{key}"}})
print(r.text)
return r.status_code == 200


def send_email(dest_addr,subject,content):
def send_email(dest_addr:str,subject:str,content:str):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "email", "content" : {"address" : f"{dest_addr}", "subject" : f"{subject}", "content" : f"{content}"}})
print(r.text)
return r.status_code == 200

def send_url(url):
def send_url(url:str):
r = requests.post("http://127.0.0.1:21987/upload",json={"type" : "url", "content" : f"{url}"})
print(r.text)

#send_email("unrealsoft.dev@gmail.com","test","test of email body")
#send_barcode("test")
#send_file("static/qr.jpeg")
#send_text_scan("test of text scan")
#send_wifi("This_is_a_wifi_name","wpa","password")
#send_url("https://www.google.com")

check_templates_update()
return r.status_code == 200
22 changes: 19 additions & 3 deletions copypasta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
{
"optionDest": "filenames",
"value": "G:/Mon Drive/dev/projects/CopyPasta/copypasta.py"
"value": "C:/Users/thaao/OneDrive - insa-toulouse.fr/dev/projects/copypasta/copypasta.py"
},
{
"optionDest": "onefile",
Expand All @@ -19,7 +19,7 @@
},
{
"optionDest": "icon_file",
"value": "G:/Mon Drive/dev/projects/CopyPasta/static/favicon.ico"
"value": "C:/Users/thaao/OneDrive - insa-toulouse.fr/dev/projects/copypasta/favicon.ico"
},
{
"optionDest": "ascii",
Expand Down Expand Up @@ -69,9 +69,25 @@
"optionDest": "argv_emulation",
"value": false
},
{
"optionDest": "hiddenimports",
"value": "engineio.async_gevent"
},
{
"optionDest": "hiddenimports",
"value": "gevent"
},
{
"optionDest": "hiddenimports",
"value": "engineio.async_drivers.aiohttp"
},
{
"optionDest": "hiddenimports",
"value": "engineio.async_aiohttp"
},
{
"optionDest": "datas",
"value": "G:/Mon Drive/dev/projects/CopyPasta/version;."
"value": "C:/Users/thaao/OneDrive - insa-toulouse.fr/dev/projects/copypasta/version;."
}
],
"nonPyinstallerOptions": {
Expand Down
Loading

0 comments on commit f2c218b

Please sign in to comment.