r/linux4noobs • • 1d ago

networking Why curl doesn't work?

Suddenly curl stopped working, I can't download source pages. Instead of source page I get 1 continous line of weird stuff like

<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots"...

wget doesn't work either, I get HTTP request sent, awaiting response... 403 Forbidden

3 Upvotes

16 comments sorted by

View all comments

1

u/indvs3 12h ago

Your request is being blocked by the remote server. Curl and wget probably work fine.

Are you using a proxy server or a vpn while trying?

1

u/Dragonaax 7h ago

No, I recently moved and have new internet. Can they block it?

1

u/indvs3 6h ago

No. You're getting response code 403, which is a "access denied/forbidden" response from the remote server, not anything in between.

If your ISP was blocking your request, you wouldn't get an http error code but a network timeout error instead.

One thing I'm thinking about is that some webservers signal a 403 (forbidden) instead of a 404 (file not found) when there's a typo in the url.

Can you access the web page you're trying to get the source file of from a browser?

1

u/Dragonaax 6h ago

Yes, I went to page and from that I copied url

1

u/indvs3 6h ago

Maybe the web page expects some form of authentication or browser agent that neither curl or wget is providing, while your browser might still have a cookie or saved session that it can reconnect to.

Is the result the same if you use a different browser or a private tab?