Disambiguate image from video servers
This commit is contained in:
@ -3,6 +3,7 @@ from os.path import splitext
|
|||||||
|
|
||||||
|
|
||||||
IMAGE_FORMATS = ["jpeg", "jpg", "png", "gif", "mp4", "webm"]
|
IMAGE_FORMATS = ["jpeg", "jpg", "png", "gif", "mp4", "webm"]
|
||||||
|
_VIDEO_FORMATS = ["mp4", "webm"]
|
||||||
|
|
||||||
|
|
||||||
class ViewURL:
|
class ViewURL:
|
||||||
@ -30,7 +31,8 @@ class ImageURL:
|
|||||||
self.format: str = image_format.lstrip(".")
|
self.format: str = image_format.lstrip(".")
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"https://wimg.rule34.xxx//images/{self.dir}/{self.id}.{self.format}"
|
server = "aws-mp4" if self.format in _VIDEO_FORMATS else "wimg"
|
||||||
|
return f"https://{server}.rule34.xxx//images/{self.dir}/{self.id}.{self.format}"
|
||||||
|
|
||||||
|
|
||||||
class SampleURL:
|
class SampleURL:
|
||||||
|
|||||||
Reference in New Issue
Block a user