mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-21 18:22:30 +01:00
[noop] add 'noop' extractor
This commit is contained in:
parent
76f855d87b
commit
5de8576ff6
@ -201,6 +201,7 @@ modules = [
|
||||
"directlink",
|
||||
"recursive",
|
||||
"oauth",
|
||||
"noop",
|
||||
"ytdl",
|
||||
"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",
|
||||
"ytdl",
|
||||
"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,
|
||||
},
|
||||
|
||||
)
|
Loading…
Reference in New Issue
Block a user