[pixhost] force '.to' TLD (#8428)

This commit is contained in:
Mike Fährmann
2025-10-17 17:57:12 +02:00
parent e42030a3a6
commit 4072687b0b

View File

@@ -27,7 +27,10 @@ class ImagehostImageExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.page_url = f"http{'s' if self._https else ''}://{match[1]}"
if self.root:
self.page_url = f"{self.root}{match[1]}"
else:
self.page_url = f"http{'s' if self._https else ''}://{match[1]}"
self.token = match[2]
if self._params == "simple":
@@ -262,8 +265,9 @@ class ImgspiceImageExtractor(ImagehostImageExtractor):
class PixhostImageExtractor(ImagehostImageExtractor):
"""Extractor for single images from pixhost.to"""
category = "pixhost"
pattern = (r"(?:https?://)?((?:www\.)?pixhost\.(?:to|org)"
r"/show/\d+/(\d+)_[^/?#]+)")
root = "https://pixhost.to"
pattern = (r"(?:https?://)?(?:www\.)?pixhost\.(?:to|org)"
r"(/show/\d+/(\d+)_[^/?#]+)")
example = "https://pixhost.to/show/123/12345_NAME.EXT"
_cookies = {"pixhostads": "1", "pixhosttest": "1"}
@@ -277,8 +281,9 @@ class PixhostGalleryExtractor(ImagehostImageExtractor):
"""Extractor for image galleries from pixhost.to"""
category = "pixhost"
subcategory = "gallery"
pattern = (r"(?:https?://)?((?:www\.)?pixhost\.(?:to|org)"
r"/gallery/([^/?#]+))")
root = "https://pixhost.to"
pattern = (r"(?:https?://)?(?:www\.)?pixhost\.(?:to|org)"
r"(/gallery/([^/?#]+))")
example = "https://pixhost.to/gallery/ID"
def items(self):