[noop] add 'noop' extractor
This commit is contained in:
@@ -201,6 +201,7 @@ modules = [
|
|||||||
"directlink",
|
"directlink",
|
||||||
"recursive",
|
"recursive",
|
||||||
"oauth",
|
"oauth",
|
||||||
|
"noop",
|
||||||
"ytdl",
|
"ytdl",
|
||||||
"generic",
|
"generic",
|
||||||
]
|
]
|
||||||
|
|||||||
27
gallery_dl/extractor/noop.py
Normal file
27
gallery_dl/extractor/noop.py
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# Copyright 2024 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.
|
||||||
|
|
||||||
|
"""noop extractor"""
|
||||||
|
|
||||||
|
from .common import Extractor, Message
|
||||||
|
|
||||||
|
|
||||||
|
class NoopExtractor(Extractor):
|
||||||
|
category = "noop"
|
||||||
|
pattern = r"(?i)noo?p$"
|
||||||
|
example = "noop"
|
||||||
|
|
||||||
|
def items(self):
|
||||||
|
# yield *something* to prevent a 'No results' message
|
||||||
|
yield Message.Version, 1
|
||||||
|
|
||||||
|
# Save cookies manually, since it happens automatically only after
|
||||||
|
# extended extractor initialization, i.e. Message.Directory, which
|
||||||
|
# itself might cause some unintended effects.
|
||||||
|
if self.cookies:
|
||||||
|
self.cookies_store()
|
||||||
@@ -441,6 +441,7 @@ IGNORE_LIST = (
|
|||||||
"test",
|
"test",
|
||||||
"ytdl",
|
"ytdl",
|
||||||
"generic",
|
"generic",
|
||||||
|
"noop",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
test/results/noop.py
Normal file
28
test/results/noop.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# 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 gallery_dl.extractor import noop
|
||||||
|
|
||||||
|
|
||||||
|
__tests__ = (
|
||||||
|
{
|
||||||
|
"#url" : "noop",
|
||||||
|
"#class" : noop.NoopExtractor,
|
||||||
|
"#urls" : (),
|
||||||
|
"#count" : 0,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "nop",
|
||||||
|
"#class" : noop.NoopExtractor,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "NOOP",
|
||||||
|
"#class" : noop.NoopExtractor,
|
||||||
|
},
|
||||||
|
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user