Skip to content

Commit

Permalink
Merge pull request #46 from mediacloud/none_nk_error
Browse files Browse the repository at this point in the history
addressing no nk error
  • Loading branch information
rahulbot authored Nov 28, 2023
2 parents 72c4493 + 082ff26 commit 61bdb27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mcmetadata/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _remove_query_params(url: str) -> str:
# Additional parameters specifically for the google.[com,lt,...] host
parameters_to_remove += ['gws_rd', 'ei']
# Some Australian websites append the "nk" parameter with a tracking hash
if uri.query.params and 'nk' in uri.query.params:
if uri.query.params and 'nk' in uri.query.params and uri.query.params['nk'] is not None:
for nk_value in uri.query.params['nk']:
if re.search(r'^[0-9a-fA-F]+$', nk_value, re.I):
parameters_to_remove += ['nk']
Expand Down

0 comments on commit 61bdb27

Please sign in to comment.