Small, dependency-free, fast Python package for removing tracking fields from URLs.
Find a file
2022-02-24 14:19:40 -03:00
.github/workflows Update python-version 2022-02-24 14:19:40 -03:00
external Update regex rules 2022-02-24 13:41:48 -03:00
tests Revert all commits made on Jan 4 2022-02-24 12:03:46 -03:00
unalix Update default configs 2022-02-24 13:46:42 -03:00
.gitignore update .gitignore 2021-06-11 20:46:01 -03:00
LICENSE Initial commit 2020-04-19 17:59:40 -03:00
README.md Update README 2022-02-24 12:39:51 -03:00
setup.py Revert all commits made on Jan 4 2022-02-24 12:03:46 -03:00

Unalix

Unalix is a library written in Python, it implements the specification used by the ClearURLs addon for removing tracking fields from URLs.

Installation

Install using pip:

python3 -m pip install --force-reinstall \
    --disable-pip-version-check \
    --upgrade \
    'unalix'

The version from git might be broken sometimes, but you can also install from it:

python3 -m pip install --force-reinstall \
    --disable-pip-version-check \
    --upgrade \
    'https://codeload.github.com/AmanoTeam/Unalix/tar.gz/refs/heads/master'

Note: Unalix requires Python 3.6 or higher.

Usage:

Removing tracking fields:

import unalix

url: str = "https://deezer.com/track/891177062?utm_source=deezer"
result: str = unalix.clear_url(url=url)

assert result == "https://deezer.com/track/891177062"

Resolving shortened URL:

import unalix

url: str = "https://bitly.is/Pricing-Pop-Up"
result: str = unalix.unshort_url(url=url)

assert result == "https://bitly.com/pages/pricing"

Tip: The unshort_url() method will strip tracking fields from any URL before following a redirect, so you don't need to manually call clear_url() for it's return value.

Contributing

If you have discovered a bug in this library and know how to fix it, fork this repository and open a Pull Request.

Third party software

Unalix includes some third party software in its codebase. See them below: