Created
November 19, 2023 18:39
-
-
Save 0xEva/5a78ca432c2162a121c577b2dd798928 to your computer and use it in GitHub Desktop.
njalla Add Token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| def njalla(method, **params): | |
| url = 'https://njal.la/api/1/' | |
| #token = '' | |
| headers = { | |
| #'Authorization': 'Njalla ' + token | |
| 'Referer' : 'https://njal.la/domains/YOUR_DOMAIN/', | |
| 'X-CSRFToken' : 'GET_THIS_FROM_YOUR_COOKIES', | |
| "Cookie" : "csrftoken=GET_THIS_FROM_YOUR_COOKIES; sessionid=GET_THIS_FROM_YOUR_COOKIES" | |
| } | |
| response = requests.post(url, json={ | |
| 'method': method, | |
| 'params': params | |
| }, headers=headers).json() | |
| if 'result' not in response: | |
| raise Exception('API Error', response) | |
| return response['result'] | |
| print(njalla('add-token', **{'from':['ADD_AS_NEEDED']})) | |
| print(njalla('list-tokens')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment