[common] simplify 'user' extractors by using 'Dispatch' mixin

This commit is contained in:
Mike Fährmann
2025-05-23 21:26:13 +02:00
parent c3e8af945d
commit e199396872
16 changed files with 73 additions and 143 deletions

View File

@@ -8,7 +8,7 @@
"""Extractors for https://www.deviantart.com/"""
from .common import Extractor, Message
from .common import Extractor, Message, Dispatch
from .. import text, util, exception
from ..cache import cache, memcache
import collections
@@ -873,17 +873,11 @@ x2="45.4107524%" y2="71.4898596%" id="app-root-3">\
.replace("\\\\", "\\")
class DeviantartUserExtractor(DeviantartExtractor):
class DeviantartUserExtractor(Dispatch, DeviantartExtractor):
"""Extractor for an artist's user profile"""
subcategory = "user"
pattern = BASE_PATTERN + r"/?$"
example = "https://www.deviantart.com/USER"
def initialize(self):
pass
skip = Extractor.skip
def items(self):
base = "{}/{}/".format(self.root, self.user)
return self._dispatch_extractors((