Skip to content

fix(engines): add request headers to duckduckgo videos to avoid 403 - #482

Open
abhiramvsmg wants to merge 1 commit into
deedy5:mainfrom
abhiramvsmg:fix/videos-search-403
Open

fix(engines): add request headers to duckduckgo videos to avoid 403#482
abhiramvsmg wants to merge 1 commit into
deedy5:mainfrom
abhiramvsmg:fix/videos-search-403

Conversation

@abhiramvsmg

Copy link
Copy Markdown

Fix

DDGS().videos(...) returned "No results found." because the
DuckduckgoVideos engine requests https://duckduckgo.com/v.js without
browser-like headers, so DuckDuckGo responds with HTTP 403.

Added the headers_update block already used by DuckduckgoImages
(Accept, Accept-Language, Referer, Sec-*) to DuckduckgoVideos, so v.js
returns 200 with results.

Verified: test_videos_search now passes.

Fixes #481

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 test fails

1 participant