mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04:00
Add parser for Pocket API
Pass a url like `pocket://Username` to import that username's archived Pocket library. Tokens need to be stored in ArchveBox.conf with the following keys: ``` POCKET_CONSUMER_KEY = key-from-custom-pocket-app POCKET_ACCESS_TOKENS = {"YourUsername": "pocket-token-for-app"} ``` `POCKET_ACCESS_TOKENS` MUST be on a single line, or the JSON will be misinterpreted by the parser as a new key/value pair.
This commit is contained in:
parent
04291c4d47
commit
ac7ad9e942
4 changed files with 122 additions and 1 deletions
|
@ -159,6 +159,9 @@ CONFIG_DEFAULTS: Dict[str, ConfigDefaultDict] = {
|
|||
'YOUTUBEDL_BINARY': {'type': str, 'default': 'youtube-dl'},
|
||||
'NODE_BINARY': {'type': str, 'default': 'node'},
|
||||
'CHROME_BINARY': {'type': str, 'default': None},
|
||||
|
||||
'POCKET_CONSUMER_KEY': {'type': str, 'default': None},
|
||||
'POCKET_ACCESS_TOKENS': {'type': dict, 'default': {}},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -386,7 +389,7 @@ def load_config_val(key: str,
|
|||
raise ValueError(f'Invalid configuration option {key}={val} (expected an integer)')
|
||||
return int(val)
|
||||
|
||||
elif type is list:
|
||||
elif type is list or type is dict:
|
||||
return json.loads(val)
|
||||
|
||||
raise Exception('Config values can only be str, bool, int or json')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue