Skip to main content

fake chrome, firefox, opera browser header anti header

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anti_header-0.0.6.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

anti_header-0.0.6-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file anti_header-0.0.6.tar.gz.

File metadata

  • Download URL: anti_header-0.0.6.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for anti_header-0.0.6.tar.gz
Algorithm Hash digest
SHA256 5164abca705fdcf46dc4b8607921606b8331c073dec9c33caeadae4637e0aa39
MD5 8031d0f229de7b24f03e8d42d74ac705
BLAKE2b-256 f67d9656632ddd8e740023836f8e28385448889af613f638cd1e95134f65722a

See more details on using hashes here.

Provenance

File details

Details for the file anti_header-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: anti_header-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for anti_header-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 210cf49ea627687b54a3cf136848502cdc0df86f208da835365668709ef08593
MD5 b59b6065b2b56e36c8c4956b8a4b0a3d
BLAKE2b-256 3421410634bb1a88ca015797ead67f4dee17276d5c7ac5c3d38fd67d1e52a4da

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page