TracklessURL is a Python-based tool that automatically cleans URLs copied to the clipboard by removing tracking parameters. It leverages a local SQLite database to manage tracking rules.
- Monitors clipboard for copied URLs.
- Automatically cleans URLs by removing tracking tokens such as
utm_source,utm_medium, etc. - Supports global tracking rules (for example, to match
utm_*parameters across any domain). - Manage custom rules for specific domains via a local SQLite database.
git clone https://github.com/Confiqure/TracklessURL.git
cd TracklessURLTo keep dependencies isolated, use a virtual environment:
python3 -m venv venv
source venv/bin/activate # On macOS/Linux
# On Windows: venv\Scripts\activatepip install -r requirements.txtOnce everything is set up, you can start the clipboard monitor:
python main.py-
Clipboard Monitoring:
- The program continuously monitors your clipboard for copied URLs.
- If a URL is detected, it is cleaned by removing unwanted tracking tokens.
-
Rule Management:
- Rules for specific domains and global parameters (like
utm_*) are stored in a SQLite database (tracking_params.db). - You can add, view, or delete rules to customize the cleaning process.
- Rules for specific domains and global parameters (like
You can easily add new rules to remove parameters from URLs using the script. For example:
add_rule('*', 'utm_source') # Global rule for utm_source
add_rule('open.spotify.com', 'si') # Rule for a specific domainTo view existing rules, simply call the function:
view_rules()To delete a rule by its ID:
delete_rule(rule_id)TracklessURL provides two command-line scripts to easily manage tracking rules:
- add_rule.py: Adds a new rule to the SQLite database.
- remove_rule.py: Removes an existing rule by its ID.
To make the scripts executable, run the following commands:
chmod +x add_rule.py
chmod +x remove_rule.pyYou can add a rule by specifying the domain and the parameter you want to remove. Use the add_rule.py script as follows:
./add_rule.py <domain> <parameter>./add_rule.py "open.spotify.com" "si"This will add a rule to remove the si parameter from URLs under the domain open.spotify.com.
You can remove a rule by its ID using the remove_rule.py script. First, view the existing rules using the view_rules() function, then use the ID of the rule you want to remove:
./remove_rule.py <rule_id>./remove_rule.py 1This will remove the rule with ID 1.
If you'd like to run these commands from anywhere in your terminal, you can add the project directory to your $PATH. Add the following line to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):
export PATH="$PATH:/path/to/TracklessURL"After updating your shell configuration, run source ~/.bashrc (or source ~/.zshrc) to apply the changes.
This project is licensed under the MIT License. See the LICENSE file for details.