aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-10-06 15:47:03 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:12:34 +0200
commita27c0ad520330db55bbb3822ac84a513d9bbd544 (patch)
tree450bc65686304861326424b3bd726904a7a25e52
parentc570fad666ae16f395e9c3b02907f6dc538113a5 (diff)
Check name
-rwxr-xr-xautomedia.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/automedia.py b/automedia.py
index a6f49c4..46c57df 100755
--- a/automedia.py
+++ b/automedia.py
@@ -267,6 +267,10 @@ def add_rss(name, url, rss_config_dir, start_after):
if not name:
name = feed["channel"]["title"].strip()
+ if not name or len(name) == 0:
+ print("Name not provided and name in rss is empty")
+ return False
+
found_start_after = False
for item in feed["items"]:
title = item["title"].strip()
@@ -327,6 +331,10 @@ def add_html(name, url, html_config_dir, start_after):
else:
print("Plugin doesn't exist: {}".format(domain))
return False
+
+ if not name or len(name) == 0:
+ print("Name not provided or empty")
+ return False
if start_after:
items = plugin_list(plugin_path, url, None)
@@ -619,8 +627,8 @@ def usage_add():
print(" --name\t\tThe display name to be used for the media. Optional for rss, in which case the name will be retries from rss TITLE, required for html")
print(" --start-after\t\tThe sync should start downloading media after this item (Optional, default is to start from the first item)")
print("EXAMPLES")
- print(" automedia.py add https://nyaa.si/?page=rss&q=Tejina-senpai+1080p&c=0_0&f=0&u=HorribleSubs")
- print(" automedia.py add html https://manganelo.com/manga/read_naruto_manga_online_free3 --name Naruto")
+ print(" automedia.py add rss 'https://nyaa.si/?page=rss&q=Tejina-senpai+1080p&c=0_0&f=0&u=HorribleSubs'")
+ print(" automedia.py add html 'https://manganelo.com/manga/read_naruto_manga_online_free3' --name Naruto")
exit(1)
def usage_sync():