mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-08 03:18:28 +03:00
Merge main into timestamping_enricher
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# this is a dummy class used to test importing a dropin in the
|
||||
# generic extractor by filename/path
|
||||
|
||||
|
||||
class Dropin:
|
||||
pass
|
||||
pass
|
||||
|
||||
11
tests/data/test_modules/example_extractor/__manifest__.py
Normal file
11
tests/data/test_modules/example_extractor/__manifest__.py
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
# Display Name of your module
|
||||
"name": "Example Extractor",
|
||||
# Optional version number, for your own versioning purposes
|
||||
"version": 2.0,
|
||||
# The type of the module, must be one (or more) of the built in module types
|
||||
"type": ["extractor"],
|
||||
# a boolean indicating whether or not a module requires additional user setup before it can be used
|
||||
# for example: adding API keys, installing additional software etc.
|
||||
"requires_setup": False,
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
from auto_archiver.core import Extractor
|
||||
|
||||
|
||||
class ExampleExtractor(Extractor):
|
||||
def download(self, item):
|
||||
print("download")
|
||||
@@ -1 +1 @@
|
||||
from .example_module import ExampleModule
|
||||
from .example_module import ExampleModule
|
||||
|
||||
@@ -16,14 +16,14 @@
|
||||
"dependencies": {
|
||||
"python": ["loguru"],
|
||||
"bin": ["bash"],
|
||||
},
|
||||
# configurations that this module takes. These are argparse-compliant dicationaries, that are
|
||||
},
|
||||
# configurations that this module takes. These are argparse-compliant dicationaries, that are
|
||||
# used to create command line arguments when the programme is run.
|
||||
# The full name of the config option will become: `module_name.config_name`
|
||||
"configs": {
|
||||
"csv_file": {"default": "db.csv", "help": "CSV file name"},
|
||||
"required_field": {"required": True, "help": "required field in the CSV file"},
|
||||
},
|
||||
"csv_file": {"default": "db.csv", "help": "CSV file name"},
|
||||
"required_field": {"required": True, "help": "required field in the CSV file"},
|
||||
},
|
||||
# A description of the module, used for documentation
|
||||
"description": "This is an example module",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from auto_archiver.core import Extractor, Enricher, Feeder, Database, Storage, Formatter, Metadata
|
||||
|
||||
|
||||
class ExampleModule(Extractor, Enricher, Feeder, Database, Storage, Formatter):
|
||||
def download(self, item):
|
||||
print("download")
|
||||
@@ -7,7 +8,6 @@ class ExampleModule(Extractor, Enricher, Feeder, Database, Storage, Formatter):
|
||||
def __iter__(self):
|
||||
yield Metadata().set_url("https://example.com")
|
||||
|
||||
|
||||
def done(self, result):
|
||||
print("done")
|
||||
|
||||
@@ -16,13 +16,12 @@ class ExampleModule(Extractor, Enricher, Feeder, Database, Storage, Formatter):
|
||||
|
||||
def get_cdn_url(self, media):
|
||||
return "nice_url"
|
||||
|
||||
|
||||
def save(self, item):
|
||||
print("save")
|
||||
|
||||
|
||||
def uploadf(self, file, key, **kwargs):
|
||||
print("uploadf")
|
||||
|
||||
|
||||
def format(self, item):
|
||||
print("format")
|
||||
|
||||
Reference in New Issue
Block a user