Skip to content

Commit e8c0dea

Browse files
committed
IDEV-2063: Implement domainhotlist
1 parent ee1e3f5 commit e8c0dea

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

domaintools/api.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,3 +1113,20 @@ def noh(self, **kwargs) -> FeedsResults:
11131113
cls=FeedsResults,
11141114
**kwargs,
11151115
)
1116+
1117+
def domainhotlist(self, **kwargs) -> FeedsResults:
1118+
"""Returns back list of domain hotlist feed"""
1119+
validate_feeds_parameters(kwargs)
1120+
endpoint = kwargs.pop("endpoint", Endpoint.FEED.value)
1121+
source = ENDPOINT_TO_SOURCE_MAP.get(endpoint).value
1122+
if endpoint == Endpoint.DOWNLOAD.value or kwargs.get("output_format", OutputFormat.JSONL.value) != OutputFormat.CSV.value:
1123+
# headers param is allowed only in Feed API and CSV format
1124+
kwargs.pop("headers", None)
1125+
1126+
return self._results(
1127+
f"domain-hotlist-feed-({source})",
1128+
f"v1/{endpoint}/domainhotlist/",
1129+
response_path=(),
1130+
cls=FeedsResults,
1131+
**kwargs,
1132+
)

domaintools/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class OutputFormat(Enum):
3030
"newly-observed-domains-feed-(s3)",
3131
"newly-observed-hosts-feed-(api)",
3232
"newly-observed-hosts-feed-(s3)",
33+
"domain-hotlist-feed-(api)",
34+
"domain-hotlist-feed-(s3)",
3335
"domain-registration-data-access-protocol-feed-(api)",
3436
"domain-registration-data-access-protocol-feed-(s3)",
3537
"real-time-domain-discovery-feed-(api)",

0 commit comments

Comments
 (0)