Merge branch 'main' into patch-1

This commit is contained in:
Satvik Gaikwad
2023-09-24 15:13:20 +05:30
committed by GitHub
32 changed files with 378 additions and 11 deletions
+26
View File
@@ -0,0 +1,26 @@
name: URL Validation
on:
schedule:
- cron: '0 0 * * 1' # At 00:00 on Monday
workflow_dispatch:
jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install requests
- run: python tests/url-validation.py
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: URL Validiation Result
path: url-validation-result.json
retention-days: 7
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "FIRSTB0SS",
"email": "abhiwa6@protonmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "abhinavcool42",
"email": "abhinavcool42@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+3 -4
View File
@@ -1,11 +1,10 @@
{
"owner": {
"username": "NotJack173",
"email": "NotJack137@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
"CNAME": "lyrastudios.github.io"
}
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "akshy3",
"email": "akshayashok209@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "AsminGiri",
"email": "asmingiriofficial@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+14
View File
@@ -0,0 +1,14 @@
{
"owner": {
"username": "alephdfilms",
"email": "alephdiallo@mail.com"
},
"record": {
"A": [
"185.199.108.153",
"185.199.109.153",
"185.199.110.153",
"185.199.111.153"
]
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "Thedogecraft",
"email": "dantaealt@gmail.com"
},
"record": {
"CNAME": "nativegames.net"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "denizak",
"email": "denizakya@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "denizbee",
"email": "denizbayramoglu@proton.me"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "dew-mortal",
"email": "dewmortal.cod@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+10
View File
@@ -0,0 +1,10 @@
{
"repo": "https://github.com/Enoughsdv/Enoughsdv.github.io",
"owner": {
"username": "Enoughsdv",
"email": "enoughsdv@gmail.com"
},
"record": {
"CNAME": "enoughsdv.github.io"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "FinnyMarigold58",
"email": "teganherring2016@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "FIRSTB0SS",
"email": "abhiwa6@protonmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+8 -1
View File
@@ -5,6 +5,13 @@
"discord": "758617912566087681"
},
"record": {
"CNAME": "jadebetty.github.io"
"A": [
"185.199.108.153",
"185.199.109.153",
"185.199.110.153",
"185.199.111.153"
],
"MX": ["mx1.improvmx.com", "mx2.improvmx.com"],
"TXT": "v=spf1 include:spf.improvmx.com ~all"
}
}
+2 -4
View File
@@ -4,8 +4,6 @@
"email": "madhuchutiya.unhinge650@silomails.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
"CNAME": "heyjumanji.pages.dev"
}
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sujandeb",
"email": "work@sujandeb.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sujandeb",
"email": "work@sujandeb.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+4 -2
View File
@@ -4,6 +4,8 @@
"email": "saqlainbrawl@gmail.com"
},
"record": {
"CNAME": "fb2fcda5-aed5-45b1-8aa4-31bc49356ffa.id.repl.co"
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "satyaidk",
"email": "nikadisatyanarayana@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "shubham-kumar-2004",
"email": "shubham04122004@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sujandeb",
"email": "work@sujandeb.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sujandeb",
"email": "work@sujandeb.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sujandeb",
"email": "work@sujandeb.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "singhutsav5502",
"email": "singhutsavofficial@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "vishwa2001911",
"email": "vprabhath937@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "wang-on-top",
"email": "Real.Shid.999@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "FIRSTB0SS",
"email": "abhiwa6@protonmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "BaseParody",
"email": "baseparody@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "DarknessRisesFromBelow",
"email": "spam.me.please.do.it@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+60
View File
@@ -0,0 +1,60 @@
import os
import json
import requests
import concurrent.futures
repository_directory = os.getcwd()
domains_directory = os.path.join(repository_directory, "domains")
def has_url_field(file_path):
with open(file_path, "r") as file:
data = json.load(file)
record = data.get("record")
if record and "URL" in record:
return record["URL"]
return None
def is_url_reachable(url: str):
try:
response = requests.head(url, allow_redirects=True)
return response.status_code // 100 in [1, 2, 3] # Check if status code is in the 1xx or 2xx or 3xx range (success)
except requests.exceptions.RequestException:
return False
urls_data = {
"valid": {},
"invalid": {},
"non-http": {}
}
def handle_url_validation(file_path):
url: str = has_url_field(file_path)
if url:
if url.startswith("http://") or url.startswith("https://"):
if is_url_reachable(url):
urls_data["valid"][file_path] = url
print(f"URL '{url}' in file '{file_path}' is reachable.")
else:
urls_data["invalid"][file_path] = url
print(f"URL '{url}' in file '{file_path}' is not reachable.")
else:
urls_data["non-http"][file_path] = url
print(f"URL '{url}' in file '{file_path}' is neither HTTP nor HTTPS.")
max_threads = 20
with concurrent.futures.ThreadPoolExecutor(max_workers=max_threads) as executor:
file_paths = []
for root, _, files in os.walk(domains_directory):
for filename in files:
file_paths.append(os.path.join(root, filename))
for file_path in file_paths:
future = executor.submit(handle_url_validation, file_path)
result_file_path = os.path.join(repository_directory, "url-validation-result.json")
with open(result_file_path, "w") as result_file:
json.dump(urls_data, result_file, indent=4)
print(f"Results saved to {result_file_path}")