this post was submitted on 28 Nov 2026
22 points (95.8% liked)

Learn Programming

2310 readers
1 users here now

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.

  2. Provide everything up front. Don't make people fish for more details in the comments. Provide background information and examples.

  3. Be present for follow up questions. Don't ask for help and run away. Stick around to answer questions and provide more details.

  4. Ask about the problem you're trying to solve. Don't focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 3 years ago
MODERATORS
 

I don't know how reliable or practical this project is yet, but I wanted to build something useful after learning Python programming. I needed a real project to improve my skills and better understand how Python works, so I decided to create an Anti-AI blocklist using various external sources along with my own manually maintained denylist.

I also implemented dead-domain filtering. The script checks domains from external sources through DNS resolution. If a domain repeatedly fails across update runs and reaches 10 recorded failures, it gets added to a list of known dead domains and can be filtered out during subsequent updates.

Of course, there are limitations. A domain might fail to resolve because of a security firewall, DNS filtering, temporary network issues, or other reasons rather than actually being dead. From what I've researched, distinguishing these cases reliably isn't straightforward. I'll keep trying to improve this mechanism.

The update process runs through GitHub Actions. Initially, I used GitHub Actions' built-in scheduling, but it wasn't triggering reliably for me. After getting frustrated with that, I set up an external trigger through cron-job.org. That approach has been working reliably so far.

This is still a learning project, and I'm open to suggestions, criticism, and ideas for improvement.

top 2 comments
sorted by: hot top controversial new old
[โ€“] jtrek@startrek.website 4 points 6 days ago

Unsolicited feedback time!

You probably should write smaller functions that do one thing, instead of one long script.

It's helpful to use type annotations. So you can write like

def something(thing: int, name: str) -> int:

And then static analysis tools (eg: mypy, ty, pylance) can tell you when you messed up

Why not use requests library for network stuff?

You might want to include a pyproject.toml for requirements. uv is also popular for dependency management.

Maybe look into unit testing if this is going to live for a while

I don't understand who should use this project, or what it is doing, but you must wrap the global code (everything in list_sources.py except the function is_dead_domain) inside a "main function" like:

def main(): pass  
if __name__ == "__main__": main()