whitelist valueless keys

pull/217/head
Aevann 2023-11-15 00:19:58 +02:00
parent 2eece5b33b
commit 995c2f2cc9
1 changed files with 1 additions and 3 deletions

View File

@ -716,8 +716,6 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
def is_whitelisted(domain, k):
if domain.endswith('pullpush.io'):
return True
if domain == 'www.c-span.org':
return True
if 'sort' in k.lower() or 'query' in k.lower():
return True
if k in {'_x_tr_hl','_x_tr_pto','_x_tr_sl','_x_tr_tl','abstract_id','after','article','bill_id','c','clip','commentID','comments','context','count','f','fbid','format','forum_id','i','ID','id','lb','list','oldid','p','page','post_id','postid','q','run','scrollToComments','search','sl','sp','story_fbid','tab','term','text','thread_id','threadid','ticket_form_id','time_continue','title','title_no','tl','token','topic','type','tz1','tz2','u','udca','url','v','vid','viewkey'}:
@ -784,7 +782,7 @@ def normalize_url(url):
netloc = 'youtube.com'
path = '/watch'
filtered |= {k: val for k, val in qd.items() if is_whitelisted(netloc, k)}
filtered |= {k: val for k, val in qd.items() if not val or is_whitelisted(netloc, k)}
if netloc == 'old.reddit.com' and reddit_comment_link_regex.fullmatch(url):
filtered['context'] = 8