Skip to main content

AdBlock Filter List Decoder

A set of tools for the decoding and conversion of AdBlock and filter lists. The decoder itself is part of the PyFunceble project.

Installation

$ pip install --user adblock-decoder

Update

$ pip install --user --upgrade adblock-decoder

Python API

If you want to use the decoder in your own Python modules or infrastructure, you may use the PyFunceble project to access the decoder.

from PyFunceble.converter.adblock_input_line2subject import AdblockInputLine2Subject

to_decode = ["||example.com^", "||example.net^"]

decoder = AdblockInputLine2Subject()
decoder.aggressive = False

decoded = set()

for line in to_decode:
    # One shot method.
    decoded.update(decoder.set_data_to_convert(line).get_converted())

    # Step by step method
    decoder.set_data_to_convert(line)
    decoded.update(decoder.get_converted())

print("Decoded:", decoded)

Tools

adblock2hosts

A tool to convert adblock or filter lists to hosts format.

Usage

usage: adblock2hosts [-h] [--aggressive] [--ip IP] [-o OUTPUT] input_file

An AdBlock2hosts converter.

positional arguments:
    input_file            The input file to work with.

optional arguments:
    -h, --help            show this help message and exit
    --aggressive          [USE AT YOUR OWN RISK AS IT IS EXPERIMENTAL] Activates the extraction of everything regardless of the interpretation of AdBlock/UBlock.
    --ip IP               Sets the IP to use while generating the hosts file.
    -o OUTPUT, --output OUTPUT
                            The file to write to.

Crafted with ♥ by Nissar Chababy (Funilrys)!

adblock2plain

A tool to convert adblock or filter lists to plain text format.

Usage

usage: adblock2plain [-h] [--aggressive] [-o OUTPUT] input_file

An AdBlock2plain (text) converter.

positional arguments:
    input_file            The input file to work with.

optional arguments:
    -h, --help            show this help message and exit
    --aggressive          [USE AT YOUR OWN RISK AS IT IS EXPERIMENTAL] Activates the extraction of everything regardless of the interpretation of AdBlock/UBlock.
    -o OUTPUT, --output OUTPUT
                            The file to write to.

Crafted with ♥ by Nissar Chababy (Funilrys)!

License

Copyright 2017, 2018, 2019, 2020, 2021, 2022 Nissar Chababy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Metadata

Release files for adblock-decoder 1.2.1

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

Source distribution (sdist)

Source distribution for adblock-decoder 1.2.1
File Size Uploaded Provenance
adblock-decoder-1.2.1.tar.gz 7.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for adblock-decoder 1.2.1
File Interpreter ABI Platform
adblock_decoder-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.5 kB

Release files / adblock-decoder-1.2.1.tar.gz

Download URL adblock-decoder-1.2.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f2f2aa2871a1d25f57b898f8777f6fbb57ca83821c11526fef910f02641153d0
BLAKE2b-256 checksum
How to use checksums
93cc880d77227dc2a2b2dab89248da06ba6885cc785fb4cbd9e10de31f526b58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release files / adblock_decoder-1.2.1-py3-none-any.whl

Download URL adblock_decoder-1.2.1-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e2d41eebc0211ea6344a6ab432554a9a9b96f282cf3fd4ed8e6395ceeb6b1d3
BLAKE2b-256 checksum
How to use checksums
63ed5dcdb87ccf90e153b242fb7121fa7dc39d38373e99d460f3d32e6df20d61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Security for adblock-decoder 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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