-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
47 additions
and
36 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,33 @@ | ||
import logging | ||
|
||
from module.downloader import DownloadClient | ||
from module.conf import settings | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def add_rss_feed(): | ||
with DownloadClient() as client: | ||
# Check Feed if exists | ||
add = True | ||
remove = False | ||
feeds = client.get_rss_feed() | ||
for item_path, value in feeds.items(): | ||
if value.url == settings.rss_link: | ||
add = False | ||
break | ||
elif item_path == "Mikan_RSS": | ||
remove = True | ||
if remove: | ||
client.remove_rss_feed("Mikan_RSS") | ||
logger.info("Remove Old RSS Feed: Mikan_RSS") | ||
# Add Feed | ||
if add: | ||
client.add_rss_feed(settings.rss_link) | ||
logger.info(f"Add RSS Feed: {settings.rss_link}") | ||
|
||
|
||
if __name__ == '__main__': | ||
from module.conf import setup_logger | ||
setup_logger() | ||
add_rss_feed() |
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