![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Cloaking Module For Python
pip install pycloaker
You can cloak your python based website with this module.
There is what does the module do :
There is what you can do with this module :
from pycloaker import *
url_is_humans_redirect = "https://x.com"
url_is_bots_redirect = "https://a.com"
clients_ip = "85.233.55.78"
clients_user_agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_2_9) AppleWebKit/533.39 (KHTML, like Gecko) Chrome/47.0.2873.193 Safari/537"
cloaker = PyCloaker(
url_is_humans_redirect,
url_is_bots_redirect
)
cloaker.blockedCities(["paris","london"])
cloaker.blockedCountries(["us","ru"])
cloaker.blockedIpAddresses(["85.233.97.58"])
url = cloaker.cloak(clients_ip,clients_user_agent)
print(url)
It's gonna print https://x.com. Because there isn't any match with determined rules.
Trying another example:
from pycloaker import *
url_is_humans_redirect = "https://x.com"
url_is_bots_redirect = "https://a.com"
clients_ip = "85.233.55.78"
clients_user_agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_2_9) AppleWebKit/533.39 (KHTML, like Gecko) Chrome/47.0.2873.193 Safari/537"
cloaker = PyCloaker(
url_is_humans_redirect,
url_is_bots_redirect
)
cloaker.blockedIpAddresses(["1.1.1.1","85.233.55.78"])
url = cloaker.cloak(clients_ip,clients_user_agent)
print(url)
It's gonna print https://a.com. Because client's ip address is matches with determined ip address.
You can see its very easy and user friendly.
from flask import Flask,url_for,redirect,request
from pycloaker import PyCloaker
app = Flask(__name__)
cloaker = PyCloaker("/human-url","/bot-url")
cloaker.blockedCountries(["rus","us"])
@app.route("/")
def index():
#ip = request.headers['X-Forwarded-For'] # If its a real website you can use that
ip = "85.214.122.50" # We determined this statically. Just a random ip
userAgent = request.headers["User-Agent"]
url = cloaker.cloak(ip,userAgent)
return redirect(url)
@app.route("/human-url")
def human():
return "You're a human!"
@app.route("/bot-url")
def bot():
return "You're a bot :("
if __name__ == "__main__":
app.run(debug=True)
FAQs
Cloaking Module For Python
We found that pycloaker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.