Skip to main content

anti-header

info: fake chrome, firefox, opera browser header anti header

Features

  • more header params
  • more request method

Installation

pip install anti-header

Usage

import anti_header
from anti_header import Header
from pprint import pprint

hd = Header(platform='windows', min_version=90, max_version=100).base
hd = Header(platform='windows', min_version=90,max_version=100).random
print(anti_header.VERSION)

# must_header param useage
hd = Header(must_header={'aa': 'bb'}).random
hd = Header(must_header={'aa': 'bb'}).base

# rand_header param useage
hd = Header(rand_header={'cc': 'dd'}).random
hd = Header(rand_header={'cc': 'dd'}).base

# default_header param useage
for i in range(10):
    hd = Header(default_header={'ee': 'ff'}).base
    pprint(hd.to_unicode_dict())

"""
base example
{'cjito': 'azhbmf',
 'ee': 'ff',
 'referer': 'https://www.google.com/',
 'user-agent': 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.7.3455.76 Safari/537.36'}

random example
{'accept-encoding': 'gzip, deflate',
 'accept-type': 'utf-8',
 'ee': 'ff',
 'origin': 'https://www.google.com/',
 'referer': 'https://www.google.com/',
 'sec-ch-ua-mobile': '?0',
 'sec-fetch-mode': 'navigate',
 'te': 'Trailers',
 'upgrade-insecure-requests': '1',
 'user-agent': 'Mozilla/5.0 (SM-G3609 Build/KTU84P; WIFI) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.5.6492.87 Safari/537.36',
 'x-forwarded-for': '1',
 'xorsv': 'pvmcue'}
"""

If You want to requests method useage just:

# test.py
import requests
from anti_header import Header

_url = 'https://www.google.com/'
hd = Header(url=_url, platform='windows')
requests.get(_url, header=hd.random.to_unicode_dict())

If You want to scrapy downloadmiddleware method useage just:

# random_header.py
from anti_header import Header


class RandomHeaderMiddleware(object):
    def __init__(self):
        pass

    def process_request(request, spider):
       request.headers = Headers(url=request.url).random

    def process_response(request, response, spider):
        return response

If You want to specify param just:

from anti_header import Header
hd = Header(logger=True)

# the default install loguru
try:
    from loguru import logger
except:
    install("loguru")
    from loguru import logger

# close default singleton
hd = Header(dry=True)

Make sure that You using latest version

pip install -U anti-header

Check version via python console:

import anti_header

print(anti_header.VERSION)

Metadata

Release files for anti-header 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anti-header 0.0.6
File Size Uploaded
anti_header-0.0.6.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anti-header 0.0.6
File Interpreter ABI Platform
anti_header-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / anti_header-0.0.6.tar.gz

Download URL anti_header-0.0.6.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5164abca705fdcf46dc4b8607921606b8331c073dec9c33caeadae4637e0aa39
BLAKE2b-256 checksum
How to use checksums
f67d9656632ddd8e740023836f8e28385448889af613f638cd1e95134f65722a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release files / anti_header-0.0.6-py3-none-any.whl

Download URL anti_header-0.0.6-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
210cf49ea627687b54a3cf136848502cdc0df86f208da835365668709ef08593
BLAKE2b-256 checksum
How to use checksums
3421410634bb1a88ca015797ead67f4dee17276d5c7ac5c3d38fd67d1e52a4da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page