Add output flushing after each print so that the output appears in journal
Signed-off-by: MK13 <marius@kleberonline.de>
This commit is contained in:
@@ -5,6 +5,7 @@ import subprocess
|
||||
import argparse
|
||||
from notifypy import Notify
|
||||
import os
|
||||
import sys
|
||||
|
||||
feedparser.USER_AGENT = "anime-rss/1.0"
|
||||
|
||||
@@ -48,12 +49,14 @@ with open(args.c, "r") as config:
|
||||
|
||||
for feed in feeds["Feeds"]:
|
||||
print(BOLD + "Checking feed: " + feed["ID"] + RESET)
|
||||
sys.stdout.flush()
|
||||
NewsFeed = feedparser.parse(feed["URL"])
|
||||
|
||||
for anime in feed["Animes"]:
|
||||
print(
|
||||
"Checking anime: " + BOLD_RED + anime["Title"] + RESET + " - Airing every " + UNDERLINE + anime["Airing"] +
|
||||
RESET + " " + anime["Local"] + "/x")
|
||||
sys.stdout.flush()
|
||||
|
||||
entries = NewsFeed.entries
|
||||
|
||||
@@ -70,6 +73,7 @@ for feed in feeds["Feeds"]:
|
||||
|
||||
if int(episodeNumber[0]) > int(anime["Local"]):
|
||||
print(BOLD_GREEN + "NEW NEW NEW " + anime["Title"] + " " + episodeNumber[0] + RESET)
|
||||
sys.stdout.flush()
|
||||
|
||||
if subprocess.run(["transmission-remote", "-a", entry.link, "-w", build_target_folder()]).returncode == 0:
|
||||
anime["Local"] = str(int(anime["Local"]) + 1).zfill(2)
|
||||
|
||||
Reference in New Issue
Block a user