[archivedmoe] add thread extractor

pull/30/head
Mike Fährmann 7 years ago
parent 30d3a5f9b2
commit 96e13604da
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -16,6 +16,7 @@ modules = [
"4chan", "4chan",
"4plebs", "4plebs",
"8chan", "8chan",
"archivedmoe",
"batoto", "batoto",
"danbooru", "danbooru",
"desuarchive", "desuarchive",

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Copyright 2017 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
# published by the Free Software Foundation.
"""Extract images from https://archived.moe/"""
from . import chan
class ArchivedmoeThreadExtractor(chan.FoolfuukaThreadExtractor):
"""Extractor for images from threads on archived.moe"""
category = "archivedmoe"
root = "https://archived.moe"
pattern = [r"(?:https?://)?archived\.moe/([^/]+)/thread/(\d+)"]
test = [
("https://archived.moe/gd/thread/309639/", {
"url": "fdd533840e2d535abd162c02d6dfadbc12e2dcd8",
"content": "c27e2a7be3bc989b5dd859f7789cc854db3f5573",
}),
("https://archived.moe/a/thread/159767162/", {
"url": "ffec05a1a1b906b5ca85992513671c9155ee9e87",
}),
]
def __init__(self, match):
chan.FoolfuukaThreadExtractor.__init__(self, match)
self.session.headers["User-Agent"] = "Mozilla 5.0"
self.session.headers["Referer"] = self.root
Loading…
Cancel
Save