summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/imagebam.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-10-03 18:31:58 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2023-10-03 18:31:58 -0400
commitb8758ecd073910ce3220b2e68399147b425c37b8 (patch)
treed6aee20213508c8f425cbacb3d714367eca904c5 /gallery_dl/extractor/imagebam.py
parente2f67519f8c1750a71aab3dc56b8345fff21bac5 (diff)
New upstream version 1.26.0.upstream/1.26.0
Diffstat (limited to 'gallery_dl/extractor/imagebam.py')
-rw-r--r--gallery_dl/extractor/imagebam.py48
1 files changed, 7 insertions, 41 deletions
diff --git a/gallery_dl/extractor/imagebam.py b/gallery_dl/extractor/imagebam.py
index f993db8..68360e9 100644
--- a/gallery_dl/extractor/imagebam.py
+++ b/gallery_dl/extractor/imagebam.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2022 Mike Fährmann
+# Copyright 2014-2023 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
@@ -9,7 +9,7 @@
"""Extractors for https://www.imagebam.com/"""
from .common import Extractor, Message
-from .. import text, exception
+from .. import text
import re
@@ -21,7 +21,9 @@ class ImagebamExtractor(Extractor):
def __init__(self, match):
Extractor.__init__(self, match)
self.path = match.group(1)
- self.session.cookies.set("nsfw_inter", "1", domain="www.imagebam.com")
+
+ def _init(self):
+ self.cookies.set("nsfw_inter", "1", domain="www.imagebam.com")
def _parse_image_page(self, path):
page = self.request(self.root + path).text
@@ -44,26 +46,7 @@ class ImagebamGalleryExtractor(ImagebamExtractor):
archive_fmt = "{gallery_key}_{image_key}"
pattern = (r"(?:https?://)?(?:www\.)?imagebam\.com"
r"(/(?:gallery/|view/G)[a-zA-Z0-9]+)")
- test = (
- ("https://www.imagebam.com/gallery/adz2y0f9574bjpmonaismyrhtjgvey4o", {
- "url": "76d976788ae2757ac81694736b07b72356f5c4c8",
- "keyword": "b048478b1bbba3072a7fa9fcc40630b3efad1f6c",
- "content": "596e6bfa157f2c7169805d50075c2986549973a8",
- }),
- ("http://www.imagebam.com/gallery/op9dwcklwdrrguibnkoe7jxgvig30o5p", {
- # more than 100 images; see issue #219
- "count": 107,
- "url": "32ae6fe5dc3e4ca73ff6252e522d16473595d1d1",
- }),
- ("http://www.imagebam.com/gallery/gsl8teckymt4vbvx1stjkyk37j70va2c", {
- "exception": exception.HttpError,
- }),
- # /view/ path (#2378)
- ("https://www.imagebam.com/view/GA3MT1", {
- "url": "35018ce1e00a2d2825a33d3cd37857edaf804919",
- "keyword": "3a9f98178f73694c527890c0d7ca9a92b46987ba",
- }),
- )
+ example = "https://www.imagebam.com/view/GID"
def items(self):
page = self.request(self.root + self.path).text
@@ -108,24 +91,7 @@ class ImagebamImageExtractor(ImagebamExtractor):
archive_fmt = "{image_key}"
pattern = (r"(?:https?://)?(?:\w+\.)?imagebam\.com"
r"(/(?:image/|view/M|(?:[0-9a-f]{2}/){3})[a-zA-Z0-9]+)")
- test = (
- ("https://www.imagebam.com/image/94d56c502511890", {
- "url": "5e9ba3b1451f8ded0ae3a1b84402888893915d4a",
- "keyword": "2a4380d4b57554ff793898c2d6ec60987c86d1a1",
- "content": "0c8768055e4e20e7c7259608b67799171b691140",
- }),
- ("http://images3.imagebam.com/1d/8c/44/94d56c502511890.png"),
- # NSFW (#1534)
- ("https://www.imagebam.com/image/0850951366904951", {
- "url": "d37297b17ed1615b4311c8ed511e50ce46e4c748",
- }),
- # /view/ path (#2378)
- ("https://www.imagebam.com/view/ME8JOQP", {
- "url": "4dca72bbe61a0360185cf4ab2bed8265b49565b8",
- "keyword": "15a494c02fd30846b41b42a26117aedde30e4ceb",
- "content": "f81008666b17a42d8834c4749b910e1dc10a6e83",
- }),
- )
+ example = "https://www.imagebam.com/view/MID"
def items(self):
path = self.path