RecNetLogin is a Python library that allows you to acquire your RecNet access token and more!
Project description
This is a Python package that allows you to acquire your RecNet access token and more with your cookie! 🍪
Features
- Automatically renewing token
- Supports 2FA accounts
- Decoding the bearer token
- Detailed exceptions
Installation
Download the recnetlogin folder and place it in your project.
pip installation once this is stable.
Setup
Gathering your session token
- Login to RecNet. While logging in, make sure you toggle on "Remember me / my machine".
- Open your browser's DevTools (Inspect Element)
- Open the
StorageorApplicationtab on the top - Locate
Cookies>https://rec.neton the directory - Search for
__Secure-next-auth.session-tokenby filtering the cookies - Double click the value and copy it
Option 1/2: Storing it in your environment variables (Windows)
- Search for environment variables and open the first result
- Click
Environment Variables...
- Click
Newunder System Variables
- Name the variable
RN_COOKIEand paste the copied value
-
Press OK on all the opened tabs
-
Restart your computer for it to take effect
Option 2/2: Storing it in a .env.secret file
- Make a new file named
.env.secretin your project's directory - Type
RN_SESSION_TOKEN=in the file and paste the copied value
- If the file is not in your project's directory, make sure to specify it
rnl = RecNetLogin(env_path=".env.secret") # Env path defaults to local directory
Usage
Getting your token
from RecNetLogin import RecNetLogin
rnl = RecNetLogin()
token = rnl.get_token()
decoded_token = rnl.get_decoded_token() # JWT decoded
print(token, decoded_token)
Making authorized calls
from recnetlogin import RecNetLogin
rnl = RecNetLogin(env_path=".env.secret")
# Fetch using RecNetLogin's HTTPX client
r = rnl.client.get("https://accounts.rec.net/account/me")
for key, value in r.json().items():
print(key, value)
# Close the client once done
rnl.close()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recnetlogin-0.1.0.tar.gz.
File metadata
- Download URL: recnetlogin-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
814ac247c912df94e2e1f4da96932559443faaad0f649c7904c386e816356972
|
|
| MD5 |
6bea8d0059144cbdd4d9751537d81c59
|
|
| BLAKE2b-256 |
fc4085caaf94d39263da0eaebbd445fae2cb7836af39d229824fd3c874b067eb
|
File details
Details for the file recnetlogin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: recnetlogin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6270e8ad370523410e9913dfcaeaeadb4fef1eca72db6077675af5838f3ec189
|
|
| MD5 |
aaf26fc271e987e0c293cbaa3000b04b
|
|
| BLAKE2b-256 |
67b0ffb3dbe7582f7ebe663d1b71724d34f42acbb5b2f393eb4ed6b2d8626df7
|