Skip to content

Commit 0dfadd4

Browse files
committed
fix handling of nested topic lists
1 parent cc44734 commit 0dfadd4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

duckduckgo.py

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def __init__(self, json):
8888
class Result(object):
8989

9090
def __init__(self, json):
91+
self.topics = json.get('Topics', [])
92+
if self.topics:
93+
self.topics = [Result(t) for t in self.topics]
94+
return
9195
self.html = json.get('Result')
9296
self.text = json.get('Text')
9397
self.url = json.get('FirstURL')

0 commit comments

Comments
 (0)