mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
add favicon and archivedotorg plugins
This commit is contained in:
parent
c950271bc3
commit
446b38dc41
2 changed files with 58 additions and 0 deletions
28
archivebox/plugins_extractor/archivedotorg/apps.py
Normal file
28
archivebox/plugins_extractor/archivedotorg/apps.py
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
__package__ = 'archivebox.plugins_extractor.archivedotorg'
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
from plugantic.base_plugin import BasePlugin
|
||||||
|
from plugantic.base_configset import BaseConfigSet
|
||||||
|
from plugantic.base_hook import BaseHook
|
||||||
|
|
||||||
|
###################### Config ##########################
|
||||||
|
|
||||||
|
|
||||||
|
class ArchivedotorgConfig(BaseConfigSet):
|
||||||
|
SAVE_ARCHIVE_DOT_ORG: bool = True
|
||||||
|
|
||||||
|
|
||||||
|
ARCHIVEDOTORG_CONFIG = ArchivedotorgConfig()
|
||||||
|
|
||||||
|
|
||||||
|
class ArchivedotorgPlugin(BasePlugin):
|
||||||
|
app_label: str = 'archivedotorg'
|
||||||
|
verbose_name: str = 'Archive.org'
|
||||||
|
|
||||||
|
hooks: List[BaseHook] = [
|
||||||
|
ARCHIVEDOTORG_CONFIG
|
||||||
|
]
|
||||||
|
|
||||||
|
PLUGIN = ArchivedotorgPlugin()
|
||||||
|
DJANGO_APP = PLUGIN.AppConfig
|
30
archivebox/plugins_extractor/favicon/apps.py
Normal file
30
archivebox/plugins_extractor/favicon/apps.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
__package__ = 'archivebox.plugins_extractor.favicon'
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
from plugantic.base_plugin import BasePlugin
|
||||||
|
from plugantic.base_configset import BaseConfigSet
|
||||||
|
from plugantic.base_hook import BaseHook
|
||||||
|
|
||||||
|
###################### Config ##########################
|
||||||
|
|
||||||
|
|
||||||
|
class FaviconConfig(BaseConfigSet):
|
||||||
|
SAVE_FAVICON: bool = True
|
||||||
|
|
||||||
|
FAVICON_PROVIDER: str = 'https://www.google.com/s2/favicons?domain={}'
|
||||||
|
|
||||||
|
|
||||||
|
FAVICON_CONFIG = FaviconConfig()
|
||||||
|
|
||||||
|
|
||||||
|
class FaviconPlugin(BasePlugin):
|
||||||
|
app_label: str = 'favicon'
|
||||||
|
verbose_name: str = 'Favicon'
|
||||||
|
|
||||||
|
hooks: List[BaseHook] = [
|
||||||
|
FAVICON_CONFIG
|
||||||
|
]
|
||||||
|
|
||||||
|
PLUGIN = FaviconPlugin()
|
||||||
|
DJANGO_APP = PLUGIN.AppConfig
|
Loading…
Add table
Add a link
Reference in a new issue