summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/imagefap.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2020-01-09 22:31:29 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2020-01-09 22:31:29 -0500
commitbc435e826dbe37969d9cbe280f58810d054932cc (patch)
tree4c12d1bd5d5fdaa4f6a65c38c85dd8f0ecdadc6b /gallery_dl/extractor/imagefap.py
parentf9a1a9dcb7df977eeac9544786df9c0b93795815 (diff)
New upstream version 1.12.2upstream/1.12.2
Diffstat (limited to 'gallery_dl/extractor/imagefap.py')
-rw-r--r--gallery_dl/extractor/imagefap.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/gallery_dl/extractor/imagefap.py b/gallery_dl/extractor/imagefap.py
index d6eea7f..fd97605 100644
--- a/gallery_dl/extractor/imagefap.py
+++ b/gallery_dl/extractor/imagefap.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2016-2019 Mike Fährmann
+# Copyright 2016-2020 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -13,6 +13,9 @@ from .. import text
import json
+BASE_PATTERN = r"(?:https?://)?(?:www\.|beta\.)?imagefap\.com"
+
+
class ImagefapExtractor(Extractor):
"""Base class for imagefap extractors"""
category = "imagefap"
@@ -29,8 +32,8 @@ class ImagefapExtractor(Extractor):
class ImagefapGalleryExtractor(ImagefapExtractor):
"""Extractor for image galleries from imagefap.com"""
subcategory = "gallery"
- pattern = (r"(?:https?://)?(?:www\.)?imagefap\.com/"
- r"(?:gallery\.php\?gid=|gallery/|pictures/)(\d+)")
+ pattern = BASE_PATTERN + r"/(?:gallery\.php\?gid=|gallery/|pictures/)(\d+)"
+
test = (
("https://www.imagefap.com/pictures/7102714", {
"pattern": r"https://cdn.imagefap.com/images/full/\d+/\d+/\d+.jpg",
@@ -42,6 +45,7 @@ class ImagefapGalleryExtractor(ImagefapExtractor):
"keyword": "3e24eace5b09639b881ebd393165862feb46adde",
}),
("https://www.imagefap.com/gallery.php?gid=7102714"),
+ ("https://beta.imagefap.com/gallery.php?gid=7102714"),
)
def __init__(self, match):
@@ -99,11 +103,14 @@ class ImagefapGalleryExtractor(ImagefapExtractor):
class ImagefapImageExtractor(ImagefapExtractor):
"""Extractor for single images from imagefap.com"""
subcategory = "image"
- pattern = r"(?:https?://)?(?:www\.)?imagefap\.com/photo/(\d+)"
- test = ("https://www.imagefap.com/photo/1369341772/", {
- "pattern": r"https://cdn.imagefap.com/images/full/\d+/\d+/\d+.jpg",
- "keyword": "8894e45f7262020d8d66ce59917315def1fc475b",
- })
+ pattern = BASE_PATTERN + r"/photo/(\d+)"
+ test = (
+ ("https://www.imagefap.com/photo/1369341772/", {
+ "pattern": r"https://cdn.imagefap.com/images/full/\d+/\d+/\d+.jpg",
+ "keyword": "8894e45f7262020d8d66ce59917315def1fc475b",
+ }),
+ ("https://beta.imagefap.com/photo/1369341772/"),
+ )
def __init__(self, match):
ImagefapExtractor.__init__(self, match)
@@ -143,8 +150,8 @@ class ImagefapUserExtractor(ImagefapExtractor):
"""Extractor for all galleries from a user at imagefap.com"""
subcategory = "user"
categorytransfer = True
- pattern = (r"(?:https?://)?(?:www\.)?imagefap\.com/"
- r"(?:profile(?:\.php\?user=|/)([^/?&#]+)"
+ pattern = (BASE_PATTERN +
+ r"/(?:profile(?:\.php\?user=|/)([^/?&#]+)"
r"|usergallery\.php\?userid=(\d+))")
test = (
("https://www.imagefap.com/profile/LucyRae/galleries", {
@@ -154,6 +161,7 @@ class ImagefapUserExtractor(ImagefapExtractor):
"url": "d941aa906f56a75972a7a5283030eb9a8d27a4fd",
}),
("https://www.imagefap.com/profile.php?user=LucyRae"),
+ ("https://beta.imagefap.com/profile.php?user=LucyRae"),
)
def __init__(self, match):