30 lines
1.0 KiB
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Copyright 2014, 2015 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 and videos from https://8ch.net/"""
2015-09-07 16:32:20 +02:00
from .chan import ChanExtractor
2014-10-12 21:56:44 +02:00
class InfinitychanThreadExtractor(ChanExtractor):
"""Extractor for images from threads from 8ch.net"""
2015-11-21 03:13:06 +01:00
category = "8chan"
subcategory = "thread"
2015-11-21 03:13:06 +01:00
pattern = [r"(?:https?://)?(?:www\.)?8ch\.net/([^/]+)/res/(\d+)"]
2016-09-19 16:15:27 +02:00
test = [("https://8ch.net/tg/res/175887.html", {
"url": "cb03fdc650ad8e796fdab553fbd5489f468d3f45",
2016-09-25 17:28:46 +02:00
"keyword": "c2a7f57422558dddaf3467b9a30018e847eb4fad",
2016-09-19 16:15:27 +02:00
"content": "9f51cdfee6942a18011996ca049baeb0a22f931b",
})]
2015-09-07 16:32:20 +02:00
api_url = "https://8ch.net/{board}/res/{thread}.json"
2015-11-05 00:18:36 +01:00
file_url = "https://8ch.net/{board}/src/{tim}{ext}"
2014-10-12 21:56:44 +02:00
def __init__(self, match):
2015-09-07 16:32:20 +02:00
ChanExtractor.__init__(
2015-11-21 03:13:06 +01:00
self, match.group(1), match.group(2)
2015-09-07 16:32:20 +02:00
)