Skip to content

Commit c5bbf2f

Browse files
authored
feat: add ddg lite support
Closes #431
1 parent 317ca73 commit c5bbf2f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/generate.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def to_google(url):
5252
def to_duckduckgo(url):
5353
return f'duckduckgo.com##.react-results--main > li:has(a[href*="{regex_to_domain(url)}"])'
5454

55+
def to_duckduckgo_lite(url):
56+
return f'lite.duckduckgo.com##tbody > tr:has(> td > a[href*="{regex_to_domain(url)}"]):xpath(self::* | following-sibling::*[position() <= 3])'
57+
5558
def to_brave(url):
5659
return f'search.brave.com###results > div:has(a[href*="{regex_to_domain(url)}"])'
5760

@@ -155,6 +158,10 @@ def get_common_filters_header(name):
155158
"name": "DuckDuckGo",
156159
"formater": lambda url: to_duckduckgo(url) + LINE_SEP
157160
},
161+
"duckduckgo_lite": {
162+
"name": "DuckDuckGo Lite",
163+
"formater": lambda url: to_duckduckgo_lite(url) + LINE_SEP
164+
},
158165
"google_duckduckgo": {
159166
"name": "Google+DuckDuckGo",
160167
"formater": lambda url: to_google(url) + LINE_SEP + to_duckduckgo(url) + LINE_SEP
@@ -173,7 +180,7 @@ def get_common_filters_header(name):
173180
},
174181
"all_search_engines": {
175182
"name": "All Search Engines",
176-
"formater": lambda url: to_google(url) + LINE_SEP + to_duckduckgo(url) + LINE_SEP + to_brave(url) + LINE_SEP + to_startpage(url) + LINE_SEP + to_ecosia(url) + LINE_SEP
183+
"formater": lambda url: to_google(url) + LINE_SEP + to_duckduckgo(url) + LINE_SEP + to_duckduckgo_lite(url) + LINE_SEP + to_brave(url) + LINE_SEP + to_startpage(url) + LINE_SEP + to_ecosia(url) + LINE_SEP
177184
}
178185
}
179186

0 commit comments

Comments
 (0)