Repository: joke2k/faker

Issue:
image_url provider lorempixel is down 
* Faker version: all
* OS: all

Provider image_url lorempixel is down

### Steps to reproduce

Enter in lorempixel.com

### Expected behavior

The provider should be online

### Actual behavior

lorempixel.com is down

### Proposal change

I propose changed by http://picsum.photos



Discussion:
Hi, thank you for the report @Virako.

https://lorempixel.com is currently working for me. Can you confirm?


Hi, today is working but is very slow, 90 seconds in load one image (100x100) and other times timeout and error. Yesterday, I was looking at similar projects and I found these discussion in other similar repositories:
* https://github.com/Marak/faker.js/issues/641
* https://github.com/fzaninotto/Faker/issues/1884
It's down for me as well.
https://lorempixel.com is down :(

Resolving patch:
diff --git a/faker/providers/internet/__init__.py b/faker/providers/internet/__init__.py
--- a/faker/providers/internet/__init__.py
+++ b/faker/providers/internet/__init__.py
@@ -155,7 +155,7 @@ class Provider(BaseProvider):
         "{{url}}{{uri_path}}/{{uri_page}}{{uri_extension}}",
     )
     image_placeholder_services: ElementsType = (
-        "https://www.lorempixel.com/{width}/{height}",
+        "https://picsum.photos/{width}/{height}",
         "https://dummyimage.com/{width}x{height}",
         "https://placekitten.com/{width}/{height}",
         "https://placeimg.com/{width}/{height}/any",
@@ -637,14 +637,27 @@ def slug(self, value: Optional[str] = None) -> str:
             value = self.generator.text(20)
         return value
 
-    def image_url(self, width: Optional[int] = None, height: Optional[int] = None) -> str:
+    def image_url(
+        self,
+        width: Optional[int] = None,
+        height: Optional[int] = None,
+        placeholder_url: Optional[str] = None,
+    ) -> str:
         """
         Returns URL to placeholder image
         Example: http://placehold.it/640x480
+
+        :param width: Optional image width
+        :param height: Optional image height
+        :param placeholder_url: Optional template string of image URLs from custom
+            placeholder service. String must contain ``{width}`` and ``{height}``
+            placeholders, eg: ``https:/example.com/{width}/{height}``.
+        :rtype: str
         """
         width_ = width or self.random_int(max=1024)
         height_ = height or self.random_int(max=1024)
-        placeholder_url: str = self.random_element(self.image_placeholder_services)
+        if placeholder_url is None:
+            placeholder_url = self.random_element(self.image_placeholder_services)
         return placeholder_url.format(width=width_, height=height_)
 
     def iana_id(self) -> str:


Test patch:
diff --git a/tests/providers/test_internet.py b/tests/providers/test_internet.py
--- a/tests/providers/test_internet.py
+++ b/tests/providers/test_internet.py
@@ -80,6 +80,8 @@ def test_image_url(self, faker):
         assert f"https://dummyimage.com/{my_width}x{my_height}" == url
         url = faker.image_url()
         assert "https://dummyimage.com/" in url
+        url = faker.image_url(placeholder_url="https://example.com/{width}/height")
+        assert url.startswith("https://example.com/")
 
     def test_hostname(self, faker):
         hostname_1_level = faker.hostname(levels=1)