File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -167,11 +167,13 @@ def load_blacklist(self) -> None:
167167 for line in f :
168168 if len (line .strip ()) < 2 or line .strip ()[0 ] == '#' :
169169 continue
170- self .blocked .append (line .strip ().lower ())
170+ self .blocked .append (line .strip ().lower (). replace ( 'www.' , '' ) )
171171
172172 def is_blocked (self , domain : str ) -> bool :
173173 """Check if domain is in blacklist"""
174174
175+ domain = domain .replace ('www.' , '' )
176+
175177 if self .config .domain_matching == "loose" :
176178 for blocked_domain in self .blocked :
177179 if blocked_domain in domain :
@@ -212,7 +214,7 @@ def is_blocked(self, domain: str) -> bool:
212214 async def check_domain (self , domain : bytes ) -> None :
213215 """Automatically check if domain is blocked"""
214216
215- if domain in self .blocked or domain in self .whitelist :
217+ if domain . decode () in self .blocked or domain in self .whitelist :
216218 return
217219
218220 try :
You can’t perform that action at this time.
0 commit comments