-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
152aa20
commit e5f1b70
Showing
3 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from pathlib import Path | ||
from module.utils import json_config | ||
|
||
DEFAULT_PROVIDER = { | ||
"mikan": "https://mikanani.me/RSS/Search?searchstr=%s", | ||
"nyaa": "https://nyaa.si/?page=rss&q=%s&c=0_0&f=0", | ||
"dmhy": "http://dmhy.org/topics/rss/rss.xml?keyword=%s" | ||
} | ||
|
||
PROVIDER_PATH = Path("config/search_provider.json") | ||
|
||
|
||
def load_provider(): | ||
if PROVIDER_PATH.exists(): | ||
return json_config.load(PROVIDER_PATH) | ||
else: | ||
json_config.save(PROVIDER_PATH, DEFAULT_PROVIDER) | ||
return DEFAULT_PROVIDER | ||
|
||
|
||
SEARCH_CONFIG = load_provider() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters