Skip to content

Commit

Permalink
Filter out noisy video routing requests in console
Browse files Browse the repository at this point in the history
  • Loading branch information
user234683 committed Mar 27, 2022
1 parent 21fda2d commit 0a999b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,14 @@ def site_dispatch(env, start_response):

class FilteredRequestLog:
'''Don't log noisy thumbnail and avatar requests'''
filter_re = re.compile(r'"GET /https://(i\.ytimg\.com/|www\.youtube\.com/data/subscription_thumbnails/|yt3\.ggpht\.com/|www\.youtube\.com/api/timedtext).*" 200')
filter_re = re.compile(r'''(?x)
"GET\ /https://(
i[.]ytimg[.]com/|
www[.]youtube[.]com/data/subscription_thumbnails/|
yt3[.]ggpht[.]com/|
www[.]youtube[.]com/api/timedtext|
[-\w]+[.]googlevideo[.]com/).*"\ (200|206)
''')
def __init__(self):
pass
def write(self, s):
Expand Down

0 comments on commit 0a999b2

Please sign in to comment.