Skip to content

Commit

Permalink
Add headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey committed May 13, 2024
1 parent 7db8b88 commit 348d115
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crawlers/mooncrawl/mooncrawl/metadata_crawler/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ def crawl_uri(metadata_uri: str) -> Any:
metadata_uri = metadata_uri.replace(
"ipfs://", "https://ipfs.io/ipfs/", 1
)
req = urllib.request.Request(
metadata_uri, headers={"User-Agent": "Mozilla/5.0"}
)

response = urllib.request.urlopen(metadata_uri, timeout=10)
response = urllib.request.urlopen(req, timeout=10)

if (
metadata_uri.startswith("data:application/json")
Expand Down

0 comments on commit 348d115

Please sign in to comment.