duck-duck-scrape
Advanced tools
Comparing version 2.2.4 to 2.2.5
@@ -8,2 +8,5 @@ # Changelog | ||
## [Unreleased] | ||
## [2.2.5] - 2023-12-04 | ||
### Fixed: | ||
- Added request anomaly detection ([#135](https://github.com/Snazzah/duck-duck-scrape/issues/135)) | ||
## [2.2.4] - 2023-05-11 | ||
@@ -60,3 +63,3 @@ ### Fixed: | ||
[Unreleased]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.2.4...HEAD | ||
[Unreleased]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.2.5...HEAD | ||
[1.0.3]: https://github.com/Snazzah/duck-duck-scrape/releases/tag/v1.0.3 | ||
@@ -76,1 +79,2 @@ [2.0.0]: https://github.com/Snazzah/duck-duck-scrape/compare/v1.0.3...v2.0.0 | ||
[2.2.4]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.2.3...v2.2.4 | ||
[2.2.5]: https://github.com/Snazzah/duck-duck-scrape/compare/v2.2.4...v2.2.5 |
@@ -79,2 +79,4 @@ "use strict"; | ||
throw new Error('A server error occurred!'); | ||
if (response.body.toString().includes('DDG.deep.anomalyDetectionBlock')) | ||
throw new Error('DDG detected an anomaly in the request, you are likely making requests too quickly.'); | ||
const searchResults = JSON.parse(SEARCH_REGEX.exec(response.body)[1].replace(/\t/g, ' ')); | ||
@@ -81,0 +83,0 @@ // check for no results |
{ | ||
"name": "duck-duck-scrape", | ||
"version": "2.2.4", | ||
"version": "2.2.5", | ||
"description": "Search from DuckDuckGo and use it's spice APIs.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -165,2 +165,4 @@ import { decode } from 'html-entities'; | ||
if ((response.body as string).includes('DDG.deep.is506')) throw new Error('A server error occurred!'); | ||
if (response.body.toString().includes('DDG.deep.anomalyDetectionBlock')) | ||
throw new Error('DDG detected an anomaly in the request, you are likely making requests too quickly.'); | ||
@@ -167,0 +169,0 @@ const searchResults = JSON.parse(SEARCH_REGEX.exec(response.body)![1].replace(/\t/g, ' ')) as (CallbackSearchResult | CallbackNextSearch)[]; |
155584
4208