pycloaker


Namepycloaker JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/0xe2d0/pycloaker
SummaryCloaking Module For Python
upload_time2023-05-08 20:42:49
maintainer
docs_urlNone
author0xe2d0
requires_python
licenseMIT
keywords claoker python-cloaking pycloaker cloaker cloaking seo python cloaking flask cloaking
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            #  PyCloaker - A Cloaking Module

**Cloaking Module For Python**

# Installation
```bash
pip install pycloaker
```

# What It Does ?

You can cloak your python based website with this module.<br/>
There is what does the module do :

* Checks User-Agent
* Checks ASN Company
* Blocks Cities You Determined
* Blocks Countries You Determined
* Blocks Ip Addresses You Determined


There is what you can do with this module :

* Block Ip Addresses
* Block Cities
* Block Countries


# Usage

```python
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:
```python
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. 


# Usage in Flask

```python
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)

```


# WARNING : THIS MODULE MADE FOR JUST TESTS AND EDUCATÄ°ONAL PURPOSE.
# DO NOT USE THAT IN A REAL WEBSITE

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/0xe2d0/pycloaker",
    "name": "pycloaker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "claoker,python-cloaking,pycloaker,cloaker,cloaking,seo,python cloaking,flask cloaking",
    "author": "0xe2d0",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/59/60/892553a85e4de8c9b11a25f66fa2a5899172af11269fb137e8b4b16016ca/pycloaker-0.0.4.tar.gz",
    "platform": null,
    "description": "#  PyCloaker - A Cloaking Module\r\n\r\n**Cloaking Module For Python**\r\n\r\n# Installation\r\n```bash\r\npip install pycloaker\r\n```\r\n\r\n# What It Does ?\r\n\r\nYou can cloak your python based website with this module.<br/>\r\nThere is what does the module do :\r\n\r\n* Checks User-Agent\r\n* Checks ASN Company\r\n* Blocks Cities You Determined\r\n* Blocks Countries You Determined\r\n* Blocks Ip Addresses You Determined\r\n\r\n\r\nThere is what you can do with this module :\r\n\r\n* Block Ip Addresses\r\n* Block Cities\r\n* Block Countries\r\n\r\n\r\n# Usage\r\n\r\n```python\r\nfrom pycloaker import *\r\n\r\nurl_is_humans_redirect = \"https://x.com\"\r\nurl_is_bots_redirect = \"https://a.com\"\r\n\r\nclients_ip = \"85.233.55.78\"\r\nclients_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\"\r\n\r\ncloaker = PyCloaker(\r\n    url_is_humans_redirect,\r\n    url_is_bots_redirect\r\n)\r\n\r\ncloaker.blockedCities([\"paris\",\"london\"])\r\ncloaker.blockedCountries([\"us\",\"ru\"])\r\ncloaker.blockedIpAddresses([\"85.233.97.58\"])\r\n\r\nurl = cloaker.cloak(clients_ip,clients_user_agent)\r\n\r\nprint(url)\r\n```\r\nIt's gonna print *https://x.com*. Because there isn't any match with determined rules.\r\n\r\nTrying another example:\r\n```python\r\nfrom pycloaker import *\r\n\r\nurl_is_humans_redirect = \"https://x.com\"\r\nurl_is_bots_redirect = \"https://a.com\"\r\n\r\nclients_ip = \"85.233.55.78\"\r\nclients_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\"\r\n\r\ncloaker = PyCloaker(\r\n    url_is_humans_redirect,\r\n    url_is_bots_redirect\r\n)\r\n\r\ncloaker.blockedIpAddresses([\"1.1.1.1\",\"85.233.55.78\"])\r\n\r\nurl = cloaker.cloak(clients_ip,clients_user_agent)\r\n\r\nprint(url)\r\n```\r\nIt's gonna print *https://a.com*. Because client's ip address is matches with determined ip address.\r\n\r\nYou can see its very easy and user friendly. \r\n\r\n\r\n# Usage in Flask\r\n\r\n```python\r\nfrom flask import Flask,url_for,redirect,request\r\nfrom pycloaker import PyCloaker\r\n\r\napp = Flask(__name__)\r\n\r\ncloaker = PyCloaker(\"/human-url\",\"/bot-url\")\r\ncloaker.blockedCountries([\"rus\",\"us\"])\r\n\r\n@app.route(\"/\")\r\ndef index():\r\n    #ip = request.headers['X-Forwarded-For'] # If its a real website you can use that\r\n    ip = \"85.214.122.50\" # We determined this statically. Just a random ip\r\n    userAgent = request.headers[\"User-Agent\"]\r\n\r\n    url = cloaker.cloak(ip,userAgent)\r\n\r\n    return redirect(url)\r\n\r\n\r\n@app.route(\"/human-url\")\r\ndef human():\r\n    return \"You're a human!\"\r\n\r\n@app.route(\"/bot-url\")\r\ndef bot():\r\n    return \"You're a bot :(\"\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    app.run(debug=True)\r\n\r\n```\r\n\r\n\r\n# WARNING : THIS MODULE MADE FOR JUST TESTS AND EDUCAT\u00c4\u00b0ONAL PURPOSE.\r\n# DO NOT USE THAT IN A REAL WEBSITE\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Cloaking Module For Python",
    "version": "0.0.4",
    "project_urls": {
        "Download": "https://github.com/0xe2d0/pyshield/tarball/master",
        "Homepage": "https://github.com/0xe2d0/pycloaker"
    },
    "split_keywords": [
        "claoker",
        "python-cloaking",
        "pycloaker",
        "cloaker",
        "cloaking",
        "seo",
        "python cloaking",
        "flask cloaking"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5960892553a85e4de8c9b11a25f66fa2a5899172af11269fb137e8b4b16016ca",
                "md5": "3c15bebb6a16367a52fe360857da9c16",
                "sha256": "5117a50acae5fb357b2ce20dc9871238ee8ac9b56f12cb13aaebc7614b03c859"
            },
            "downloads": -1,
            "filename": "pycloaker-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "3c15bebb6a16367a52fe360857da9c16",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4496,
            "upload_time": "2023-05-08T20:42:49",
            "upload_time_iso_8601": "2023-05-08T20:42:49.403482Z",
            "url": "https://files.pythonhosted.org/packages/59/60/892553a85e4de8c9b11a25f66fa2a5899172af11269fb137e8b4b16016ca/pycloaker-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-08 20:42:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "0xe2d0",
    "github_project": "pycloaker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pycloaker"
}
        
Elapsed time: 0.08587s