Skip to content

Instantly share code, notes, and snippets.

@0xEva
Created November 19, 2023 18:39
Show Gist options
  • Select an option

  • Save 0xEva/5a78ca432c2162a121c577b2dd798928 to your computer and use it in GitHub Desktop.

Select an option

Save 0xEva/5a78ca432c2162a121c577b2dd798928 to your computer and use it in GitHub Desktop.
njalla Add Token
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