From 01bbce691fcda2d7506147ec67f61c2421239f19 Mon Sep 17 00:00:00 2001 From: enduser420 Date: Thu, 30 Jun 2022 20:16:10 +0530 Subject: [PATCH] remove unrelated changes --- gallery_dl/extractor/2chen.py | 93 -------------------------------- gallery_dl/extractor/__init__.py | 1 - 2 files changed, 94 deletions(-) delete mode 100644 gallery_dl/extractor/2chen.py diff --git a/gallery_dl/extractor/2chen.py b/gallery_dl/extractor/2chen.py deleted file mode 100644 index f7cdb93a..00000000 --- a/gallery_dl/extractor/2chen.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright 2017-2021 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. - -from .common import Extractor, Message -from .. import text - - -class _2chenThreadExtractor(Extractor): - """Extractor for 2chen threads""" - category = "2chen" - subcategory = "thread" - directory_fmt = ("{category}", "{board}", "{thread} {title}") - filename_fmt = "{filename}" - pattern = (r"(?:https?://)?2chen\.moe" - r"/([^/]+)/(\d+)") - test = ("https://2chen.moe/jp/303786",) - - def __init__(self, match): - Extractor.__init__(self, match) - self.board, self.thread = match.groups() - - def items(self): - url = "https://2chen.moe/{}/{}".format(self.board, self.thread) - page = self.request(url, encoding="utf-8").text - data = self.metadata(page) - yield Message.Directory, data - for post in self.posts(page): - if post["url"] is None or post["filename"] is None: - continue - url = "https://2chen.moe{}".format(post["url"]) - yield Message.Url, url, post - - def metadata(self, page): - title = text.extract(page, "

", "

")[0] - return { - "board": self.board, - "thread": self.thread, - "title": title - } - - def posts(self, page): - posts = text.extract_iter( - page, '
', '
') - return [self.parse(post) for post in posts] - - def parse(self, post): - data = self._extract_post(post) - data["extension"] = str(data["filename"]).split(".")[-1] - return data - - @staticmethod - def _extract_post(post): - return text.extract_all(post, ( - ('url', '') diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index d63c7934..ebc2341a 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -10,7 +10,6 @@ import re modules = [ "2chan", - "2chen", "35photo", "3dbooru", "420chan",