Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5abd758

Browse files
authored
Merge pull request#2106 from ppfeister/bugfix/skip-filter-2103
Skip content filter for explicitly chosen targets
2 parentsf6bb608 +d85c073 commit5abd758

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎sherlock/sherlock.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def main():
575575
action="append",
576576
metavar="SITE_NAME",
577577
dest="site_list",
578-
default=None,
578+
default=[],
579579
help="Limit analysis to just the listed sites. Add multiple options to specify more than one site.",
580580
)
581581
parser.add_argument(
@@ -725,13 +725,13 @@ def main():
725725
sys.exit(1)
726726

727727
ifnotargs.nsfw:
728-
sites.remove_nsfw_sites()
728+
sites.remove_nsfw_sites(do_not_remove=args.site_list)
729729

730730
# Create original dictionary from SitesInformation() object.
731731
# Eventually, the rest of the code will be updated to use the new object
732732
# directly, but this will glue the two pieces together.
733733
site_data_all= {site.name:site.informationforsiteinsites}
734-
ifargs.site_listisNone:
734+
ifargs.site_list== []:
735735
# Not desired to look at a sub-set of sites
736736
site_data=site_data_all
737737
else:

‎sherlock/sites.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def __init__(self, data_file_path=None):
179179

180180
return
181181

182-
defremove_nsfw_sites(self):
182+
defremove_nsfw_sites(self,do_not_remove:list= []):
183183
"""
184184
Remove NSFW sites from the sites, if isNSFW flag is true for site
185185
@@ -190,8 +190,9 @@ def remove_nsfw_sites(self):
190190
None
191191
"""
192192
sites= {}
193+
do_not_remove= [site.casefold()forsiteindo_not_remove]
193194
forsiteinself.sites:
194-
ifself.sites[site].is_nsfw:
195+
ifself.sites[site].is_nsfwandsite.casefold()notindo_not_remove:
195196
continue
196197
sites[site]=self.sites[site]
197198
self.sites=sites

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp