[common] simplify 'user' extractors by using 'Dispatch' mixin
This commit is contained in:
@@ -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((
|
||||
|
||||
Reference in New Issue
Block a user