Skip to content

Commit

Permalink
fix:result prefer(#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guovin committed Oct 28, 2024
1 parent 247bdf3 commit 646e2a8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ def get_total_urls_from_info_list(infoList, ipv6=False):
for origin in origin_type_prefer:
for ipv_type in ipv_type_total:
if ipv_num[ipv_type] < ipv_limit[ipv_type]:
extra_urls = categorized_urls[origin][ipv_type][
source_limits[origin] :
]
extra_urls = (
categorized_urls[origin][ipv_type][source_limits[origin] :]
if ipv_type in ipv_type_prefer
else categorized_urls[origin][ipv_type][: source_limits[origin]]
)
total_urls.extend(extra_urls)
ipv_num[ipv_type] += len(extra_urls)
if len(total_urls) >= urls_limit:
Expand Down

0 comments on commit 646e2a8

Please sign in to comment.