Notes
![]() ![]() Notes - notes.io |
import yaml
from bs4 import BeautifulSoup
from urllib.parse import urlparse, parse_qs
# Load prod_constants.yaml
with open('prod_constants.yaml') as file:
constants = yaml.load(file, Loader=yaml.FullLoader)
def make_request(method, url, headers=None, data=None):
session = requests.Session()
session.headers.update(constants['login_headers'])
if headers:
session.headers.update(headers)
if method == 'GET':
response = session.get(url)
elif method == 'POST':
response = session.post(url, data=data)
return response
def login_update_tokens():
response = make_request('GET', hostUrl)
print("HomePage -> " + str(response.status_code))
if response.status_code == 200:
soup = BeautifulSoup(response.content, "html.parser")
form = soup.find("form")
if form:
token = soup.find('input', {'name': '__RequestVerificationToken'})['value']
print("__RequestVerificationToken -> " + token)
with open("..DataHeadersRequestVerificationToken.txt", 'w') as file:
file.write(token)
domain_name = constants['authenticate_details']['domain_name']
user_name = constants['authenticate_details']['user_name']
hidden_pwd = constants['authenticate_details']['hidden_password']
pwd = constants['authenticate_details']['password']
post_body = "__RequestVerificationToken=" + token + "&DomainName=" + domain_name + "&UserName=" + user_name + "&HiddenPassword=" + hidden_pwd + "&password=" + pwd + "&Querystring=0"
headers = {
"Origin": hostUrl,
"Content-Type": "application/x-www-form-urlencoded"
}
response = make_request('POST', hostUrl + 'Home/AuthenticateUser', headers=headers, data=post_body)
print("AuthenticateUser -> " + str(response.status_code))
response = make_request('GET', hostUrl + 'Fileroom/Fileroom/taxCaddyRedirect?_=1692105206998r')
print("taxCaddyRedirect -> " + str(response.status_code))
print(response.text)
response = response.json()
print(response)
if "tokenUrl" in response:
tokenUrl = response["tokenUrl"]
print("tokenUrl -> " + tokenUrl)
pq = parse_qs(urlparse(tokenUrl).fragment)
fileroom = pq['/login?fileroom'][0]
taxcaddy_url = constants['url']['taxCaddy_url']
taxcaddy_origin_url = constants['url']['taxCaddy_origin_url']
url = taxcaddy_url + 'api/v1/sureprep/authenticate?temporarytoken=' + fileroom
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36",
"Content-Type": "application/json",
"Accept": "application/json",
"Origin": taxcaddy_origin_url,
"Referer": taxcaddy_origin_url,
"Accept-Language": "en-US,en;q=0.9"
}
response = make_request('POST', url, headers=headers)
print("sureprep/authenticate -> " + str(response.status_code))
response = response.json()
if "access_token" in response:
access_token = response["access_token"]
print("access_token -> " + access_token)
with open("..DataHeadersAuthorization.txt", 'w') as file:
file.write("Bearer " + access_token)
jwt = response["jwt"]
print("jwt -> " + jwt)
with open("..DataHeadersx-sp-authorization-jwt.txt", 'w') as file:
file.write(jwt)
else:
print("No form found on the page")
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team