Skip to content

Commit

Permalink
sort script still not running
Browse files Browse the repository at this point in the history
  • Loading branch information
spirillen committed Jan 19, 2025
1 parent 9683561 commit 556f91c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/sort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Print sort_lists version
run: |
python -c "import tools.sort_lists; print(f'Sort Lists Version: {tools.sort_lists.VERSION}')"
- name: Check for changes in source folder
id: changed_files
run: |
Expand Down
8 changes: 6 additions & 2 deletions tools/sort_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import dns.resolver
import dns.query

VERSION = "0.2b22" # Incremented beta version
VERSION = "0.2b23" # Incremented beta version

def find_files_by_name(directory, filenames):
matches = []
Expand Down Expand Up @@ -122,12 +122,16 @@ def test_domain_connectivity(domain, proxy):

def dns_lookup(domain):
resolver = dns.resolver.Resolver()
resolver.nameservers = ['tls://dns10.quad9.net'] # Updated DNS to use tls
resolver.nameservers = ['tls://dns10.quad9.net'] # Updated DNS to use TLS
try:
resolver.resolve(domain)
return True
except (dns.resolver.NXDOMAIN, dns.resolver.Timeout, dns.exception.DNSException) as e:
print(f"DNS lookup error for domain {domain}: {e}")
# Fallback to DoH
response = requests.get(f"https://dns10.quad9.net/dns-query?name={domain}&type=A", headers={"accept": "application/dns-json"})
if response.status_code == 200 and "Answer" in response.json():
return True
return False

def sort_file_alphanum(file_path, valid_tlds, proxy):
Expand Down

0 comments on commit 556f91c

Please sign in to comment.