Created
January 30, 2024 08:45
-
-
Save mrhalix/2adfaa3d82696aba82a7380dc81cda88 to your computer and use it in GitHub Desktop.
Namecheap dump/export
This file contains 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 | |
import json | |
domains = open("Domains/api/getdomainsonly.json" ,"r") | |
jd = json.loads(domains.read()) | |
def get_domain_info(domain): | |
cookies = { | |
'ADD': 'YOUR_COOKIE_HERE' | |
} | |
headers = { | |
'ADD': 'YOUR_HEADER_HERE' | |
} | |
params = { | |
'domainName': domain, | |
} | |
response = requests.get( | |
'https://ap.www.namecheap.com/Domains/DomainDetails/GetDomainDetailsTabOverView', | |
params=params, | |
cookies=cookies, | |
headers=headers, | |
) | |
return response.json() | |
for domain_info in jd['Data']: | |
domain = domain_info['DomainName'] | |
print(domain) | |
d_in = get_domain_info(domain) | |
d_info_json = json.loads(d_in['Result']) | |
f = open("Domains/api/GetDomainDetailsTabOverView/"+domain+".json", "w") | |
f.write(json.dumps(d_info_json)) | |
f.close() | |
print("Done") | |
print("=========================================") |
This file contains 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 | |
import json | |
emails = open("GetSubscriptionListByOwnerName.json" ,"r") | |
jd = json.loads(emails.read()) | |
def get_email_info(subscription_id): | |
cookies = { | |
'ADD': 'YOUR_COOKIE_HERE' | |
} | |
headers = { | |
'ADD': 'YOUR_HEADER_HERE' | |
} | |
json_data = { | |
'request': { | |
'SubscriptionId': str(subscription_id), | |
}, | |
} | |
response = requests.post( | |
'https://ap.www.namecheap.com/api/v1/ncpl/privateemail/ui/GetInfo', | |
cookies=cookies, | |
headers=headers, | |
json=json_data, | |
) | |
return response.json() | |
for email_info in jd['Subscriptions']: | |
subscription_id = email_info['SubscriptionId'] | |
domain_name = email_info['DomainName'] | |
print(domain_name) | |
d_in = get_email_info(subscription_id) | |
print(d_in) | |
f = open("Info/"+domain_name+".json", "w") | |
f.write(json.dumps(d_in, indent=4)) | |
f.close() | |
print("Done") | |
print("=========================================") |
This file contains 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 | |
import json | |
emails = open("GetSubscriptionListByOwnerName.json" ,"r") | |
jd = json.loads(emails.read()) | |
def get_email_list(subscription_id): | |
cookies = { | |
'ADD': 'YOUR_COOKIE_HERE', | |
} | |
headers = { | |
'ADD': 'YOUR_HEADER_HERE' | |
} | |
json_data = { | |
'request': { | |
'SubscriptionId': str(subscription_id), | |
}, | |
} | |
response = requests.post( | |
'https://ap.www.namecheap.com/api/v1/ncpl/privateemail/ui/GetListBySubscription', | |
cookies=cookies, | |
headers=headers, | |
json=json_data, | |
) | |
return response.json() | |
for email_info in jd['Subscriptions']: | |
subscription_id = email_info['SubscriptionId'] | |
domain_name = email_info['DomainName'] | |
print(domain_name) | |
d_in = get_email_list(subscription_id) | |
print(d_in) | |
f = open("list/"+domain_name+".json", "w") | |
f.write(json.dumps(d_in, indent=4)) | |
f.close() | |
print("Done") | |
print("=========================================") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment