Can't download data from website no matter what

Website URL

https://www.androidnauka-nk.rf.gd/RealTime/time.php

Error Message

<?php
date_default_timezone_set("Europe/Warsaw");
$h=date("H", time());
$m=date("i", time());
$s=date("s", time());
$ciagJson=array();
$czas=[
    'godz'=>$h,
    'min'=>$m,
    'sek'=>$s
];

array_push($ciagJson, $czas);
echo json_encode($ciagJson);
?>

Other Information

Hello, I am runing the above code on my site, which URL is visible on top.
I have the issue, that no matter what - I am unable to fetch data (even the json string) on that website. Firstly - I get SSL error - that I just skip by always accepting the SSL errors (though i use free SSL certificate from google that infinityfree provides so i am unsure why this happens).
Then after I get rid of it - there’s no response from my site to my app.

I also tested my site with a json downloader tool.
When using “https://serwer2330516.home.pl/RealTime/time.php” url to load data (it’s not my site, though it runs the same code) - data gets imported just fine. Although when using my URL (the one from top) - I don’t see any data being downloaded.

I am going insane why this might be happening and I’d love to get some help with that. Thank you.

Hi and welcome to the forum! Please read this:

9 Likes

I tried to wget the data and it failed

lovebug@LoveByte:~/Downloads$ wget --no-check-certificate https://www.androidnauka-nk.rf.gd/RealTime/time.php/
--2023-12-03 18:54:29--  https://www.androidnauka-nk.rf.gd/RealTime/time.php/
Resolving www.androidnauka-nk.rf.gd (www.androidnauka-nk.rf.gd)... 185.27.134.130
Connecting to www.androidnauka-nk.rf.gd (www.androidnauka-nk.rf.gd)|185.27.134.130|:443... connected.
WARNING: cannot verify www.androidnauka-nk.rf.gd's certificate, issued by ‘CN=GTS CA 1P5,O=Google Trust Services LLC,C=US’:
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... No data received.
Retrying.

--2023-12-03 18:54:30--  (try: 2)  https://www.androidnauka-nk.rf.gd/RealTime/time.php/
Connecting to www.androidnauka-nk.rf.gd (www.androidnauka-nk.rf.gd)|185.27.134.130|:443... connected.
WARNING: cannot verify www.androidnauka-nk.rf.gd's certificate, issued by ‘CN=GTS CA 1P5,O=Google Trust Services LLC,C=US’:
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... No data received.
Retrying.

--2023-12-03 18:54:32--  (try: 3)  https://www.androidnauka-nk.rf.gd/RealTime/time.php/
Connecting to www.androidnauka-nk.rf.gd (www.androidnauka-nk.rf.gd)|185.27.134.130|:443... connected.
WARNING: cannot verify www.androidnauka-nk.rf.gd's certificate, issued by ‘CN=GTS CA 1P5,O=Google Trust Services LLC,C=US’:
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... No data received.
Retrying.

Yes, that’s normal. You can’t use non-browser devices to access pages on free hosting.

See the guide linked by @JxstErg1 above for more info.

7 Likes

yeah sorry I knew that, I must be half asleep :sleeping:

3 Likes

@Greenreader9 No, users can access free websites on infinityfree using the WGET method. I’ve successfully done it.

All you had to do was be more creative about it.:upside_down_face:

wget --no-check-certificate \
     --header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" \
     --header="Accept-Language: en-US,en;q=0.9" \
     --header="Cache-Control: max-age=0" \
     --header="Sec-Ch-Ua: \"Microsoft Edge\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"" \
     --header="Sec-Ch-Ua-Mobile: ?0" \
     --header="Sec-Ch-Ua-Platform: \"Linux\"" \
     --header="Sec-Fetch-Dest: document" \
     --header="Sec-Fetch-Mode: navigate" \
     --header="Sec-Fetch-Site: none" \
     --header="Sec-Fetch-User: ?1" \
     --header="Upgrade-Insecure-Requests: 1" \
     --header="User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0" \
     https://www.androidnauka-nk.rf.gd/RealTime/time.php

3 Likes

If you emulate a browser, then yes, it will work. But just sending a request will not.

6 Likes

True, but WGET can get it :slightly_smiling_face: :wink:

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.