webcam only http -> need https

As discussed in multiple topics (f.i. webcam 2 ** Solved **) it is sometimes impossible to get a snapshot from a camera with a valid https-url.

I wrote a smal script, I could not find the previous topic where a similar script was posted.

Put it in your pwsWD/_my_settings/ folder .

Modify the line 8 from

$image_url_sml  = 'http://xxxxxxx:[email protected]:9999/auto.jpg';

to the exact link to your webcam snapshot.
Do not use the local-lan link such as http://192.168.xxx.yyy
This link is accessed from your webserver which is on the internet (normally) so you need the external link, which is passing through your router to the webcam.

The script will load the image from your camera and cache it.

In normal cases the same image can be used in the block-background as in the pop-up.
But to cater to all situations, you can have the script download two images (with a different size ?) .
The larger image link is set at line 12.

Easyweathersettings:
Tab => Devices
==> question Your weather-cams
====> Specify the link to your webcam image set to: _my_settings/imgcurl.php
If you use the second image, the link would be _my_settings/imgcurl.php?large

Support:
This is a private script, so there is no way to see the source.
If posting questions about it, make a copy and rename it to problem.txt

Please test carefully.

Wim

P.S. there is a similar script ( _redirect.php) to download but it does not cache the image.
http://discourse.weather-watch.com/p/547908

Edit 2021-02-14 new version to suppress the url in error messages


imgcurl.php.zip (1.97 KB)

Youahh !!!
Great, it works really well, I’m very happy and thank you very much because you did more than help me, you made our whole community happy by offering us this script.

Can you delete the 1st image showing my webcam because we can see my neighbor’s house?
The webcam was just put up for a test
You can check my site now everything is ok … :lol:

Now that everything is ok on my side thanks to you, do you have to hide the php files for security when you type the command “http: //www.xxxxxxxxxx/pws_settings.php? Sce = view” ??
because we see the ip and mdp

I know you don’t do it for that, but I’ll send you a paypal donation next month to thank you.

All files with API-keys, such as _my_settings/ settings.php twitter.php a.s.o.
can not be seen by others or by the internet, neither by me.
Only you can see them using a FTP program or cPanel.

PWS_settings.php has no important settings whatsoever, it process the settings and checks the settings.

Wim

Can you check for imgcurl because from my smartphone (wifi cut) I did the test and I see the ip and mdp

I do not understand. I can not find imgcurl.php on your website so I can not check anything.

For testing, please use a computer so you can make screenshots etc.
You can do that from your house as long as you test the https://www.neufchatel-hardelot-meteo.fr/_my_settings/imgcurl.php
If you set the link correct, it should display the image.

You can only see an error message including the link to http://90.45.100.155/. . . when there is a problem.
I put error messages in to test. It should display what the error is.

But again, I can not do anything without knowing where you put the script.

Will check tomorrow

Wim

yes I could be wrong but for safety I removed the file I will put it back tomorrow morning around 9am

little silly question, how can the site still display the webcam when the “imgcurl.php” file has been deleted ? #-o

You did not change the settings to use _my_settings/imgcurl.php

The old “/90.45.100.155/cgi-bin/” link is still set, either in the script itself or in your settings.

Wim

I gave the file if you want to go see security

This is not the file you downloaded.
With your modification it became a non php file. The first line with <?php is missing
Please throw it away.

Wim

I added a “non-display” url in the script so that even the error messages do not display the url.

But if you again remove the first line or change it, it will become a text html file again and will display as html-txt.
So leave the first line as is.

Only change line 8, no other change is needed for now.

Wim


imgcurl.php.zip (1.97 KB)

ok it’s good the modification is done everything is normal

But now please go to easyweathersetup and set the webcam1 as _my_settings/imgcurl.php
As described inn the first post.

Wim

it works, my ip address and mdp changed
Thank you

Very nice Wim, this is a very welcome script, thank you!