|
|
|
@ -4,18 +4,18 @@
|
|
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
|
|
|
|
|
"""Extractors for https://jpg.pet/"""
|
|
|
|
|
"""Extractors for https://jpeg.pet/"""
|
|
|
|
|
|
|
|
|
|
from .common import Extractor, Message
|
|
|
|
|
from .. import text
|
|
|
|
|
|
|
|
|
|
BASE_PATTERN = r"(?:https?://)?jpg\.(?:pet|fish(?:ing)?|church)"
|
|
|
|
|
BASE_PATTERN = r"(?:https?://)?jpe?g\.(?:pet|fish(?:ing)?|church)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class JpgfishExtractor(Extractor):
|
|
|
|
|
"""Base class for jpgfish extractors"""
|
|
|
|
|
category = "jpgfish"
|
|
|
|
|
root = "https://jpg.pet"
|
|
|
|
|
root = "https://jpeg.pet"
|
|
|
|
|
directory_fmt = ("{category}", "{user}", "{album}",)
|
|
|
|
|
archive_fmt = "{id}"
|
|
|
|
|
|
|
|
|
@ -36,7 +36,7 @@ class JpgfishImageExtractor(JpgfishExtractor):
|
|
|
|
|
subcategory = "image"
|
|
|
|
|
pattern = BASE_PATTERN + r"/img/((?:[^/?#]+\.)?(\w+))"
|
|
|
|
|
test = (
|
|
|
|
|
("https://jpg.pet/img/funnymeme.LecXGS", {
|
|
|
|
|
("https://jpeg.pet/img/funnymeme.LecXGS", {
|
|
|
|
|
"pattern": r"https://simp3\.jpg\.church/images/funnymeme\.jpg",
|
|
|
|
|
"content": "098e5e9b17ad634358426e0ffd1c93871474d13c",
|
|
|
|
|
"keyword": {
|
|
|
|
@ -52,6 +52,7 @@ class JpgfishImageExtractor(JpgfishExtractor):
|
|
|
|
|
"pattern": r"https://simp2\.jpg\.church/hannahowo_00457\.jpg",
|
|
|
|
|
"keyword": {"album": "401-500"},
|
|
|
|
|
}),
|
|
|
|
|
("https://jpg.pet/img/funnymeme.LecXGS"),
|
|
|
|
|
("https://jpg.fishing/img/funnymeme.LecXGS"),
|
|
|
|
|
("https://jpg.fish/img/funnymeme.LecXGS"),
|
|
|
|
|
("https://jpg.church/img/funnymeme.LecXGS"),
|
|
|
|
@ -83,7 +84,7 @@ class JpgfishAlbumExtractor(JpgfishExtractor):
|
|
|
|
|
subcategory = "album"
|
|
|
|
|
pattern = BASE_PATTERN + r"/a(?:lbum)?/([^/?#]+)(/sub)?"
|
|
|
|
|
test = (
|
|
|
|
|
("https://jpg.pet/album/CDilP/?sort=date_desc&page=1", {
|
|
|
|
|
("https://jpeg.pet/album/CDilP/?sort=date_desc&page=1", {
|
|
|
|
|
"count": 2,
|
|
|
|
|
}),
|
|
|
|
|
("https://jpg.fishing/a/gunggingnsk.N9OOI", {
|
|
|
|
@ -95,6 +96,7 @@ class JpgfishAlbumExtractor(JpgfishExtractor):
|
|
|
|
|
("https://jpg.church/a/hannahowo.aNTdH/sub", {
|
|
|
|
|
"count": 606,
|
|
|
|
|
}),
|
|
|
|
|
("https://jpg.pet/album/CDilP/?sort=date_desc&page=1"),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def __init__(self, match):
|
|
|
|
@ -120,12 +122,13 @@ class JpgfishUserExtractor(JpgfishExtractor):
|
|
|
|
|
subcategory = "user"
|
|
|
|
|
pattern = BASE_PATTERN + r"/(?!img|a(?:lbum)?)([^/?#]+)(/albums)?"
|
|
|
|
|
test = (
|
|
|
|
|
("https://jpg.pet/exearco", {
|
|
|
|
|
("https://jpeg.pet/exearco", {
|
|
|
|
|
"count": 3,
|
|
|
|
|
}),
|
|
|
|
|
("https://jpg.church/exearco/albums", {
|
|
|
|
|
"count": 1,
|
|
|
|
|
}),
|
|
|
|
|
("https://jpg.pet/exearco"),
|
|
|
|
|
("https://jpg.fishing/exearco"),
|
|
|
|
|
("https://jpg.fish/exearco"),
|
|
|
|
|
("https://jpg.church/exearco"),
|
|
|
|
|