https://github.com/eltonchou/no-more-query-string
Clean unneccessary query-string from the URL. Especially fbclid.
https://github.com/eltonchou/no-more-query-string
fbclid
Last synced: about 1 month ago
JSON representation
Clean unneccessary query-string from the URL. Especially fbclid.
- Host: GitHub
- URL: https://github.com/eltonchou/no-more-query-string
- Owner: EltonChou
- License: mit
- Created: 2020-10-26T20:23:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-04T11:29:44.000Z (almost 5 years ago)
- Last Synced: 2025-07-07T06:04:48.556Z (3 months ago)
- Topics: fbclid
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pypi.org/project/no-more-query-string/)

[](https://pypi.org/project/no-more-query-string/)

# no-more-query-string
Remove *unneccessary* query-string from the URL given. Especially fbclid.## Changelog
+ [CHANGELOG](https://github.com/EltonChou/no-more-query-string/blob/main/CHANGELOG.md)
## Installation
```sh
pip install no-more-query-string
```## Usage
```py
from no_more_qs import NoMoreQSnmq = NoMoreQS()
url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia"nmq.clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'
```
or you just want to remove *fbclid*
```py
url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"NoMoreQs.remove_fbclid(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'
```
## Parameters
***fbclid* will be cleaned from all domains**
```py
# default
NoMoreQS(include_flds=[], exclude_flds=[], strict=True)
```
### include_flds ( `List[str] | Tuple[str]`=[] )first-level domains list which are allowed to clean query string.
```py
include_flds = ('youtube.com', 'google.com')url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"
NoMoreQS(include_flds=include_flds).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'
```
### exclude_flds ( `List[str] | Tuple[str]`=[] )first-level domains which are disallowed to clean query string.
```py
exclude_flds = ('youtube.com', 'google.com')url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"
NoMoreQS(exclude_flds=exclude_flds).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'```
### strict ( `bool`=True )
if the domain is not in `include_flds` or `exclude_flds`
+ True(default): Remove all unneccessary query string.
+ False: Only remove `fbclid` from query string.
```py
url = "https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia&fbclid=IwAR2NasdasdasdadasdfP58isTW-c3U"NoMoreQS(strict=True).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI'NoMoreQS(strict=False).clean(url)
# 'https://www.youtube.com/watch?v=h-RHH79hzHI&feature=emb_logo&ab_channel=Ceia'
```