Skip to content

Commit 45b1375

Browse files
Fixed a bug with --gen-input
1 parent 24c2d63 commit 45b1375

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

reddytt.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# reddytt.py
1414
# https://github.com/johanbluecreek/reddytt
1515
#
16-
__version__ = "1.4.6"
16+
__version__ = "1.4.7"
1717
user_agent = "Reddytt v{}".format(__version__)
1818
#
1919
################################################################################
@@ -146,7 +146,10 @@ def clean_yt(link_list):
146146
print('Reddytt: skipping URL without video label:', link)
147147
continue
148148
# Add the cleaned up link
149-
new_list.append(('https://www.youtube.com/watch?v=' + videolabel, link[1]))
149+
try:
150+
new_list.append(('https://www.youtube.com/watch?v=' + videolabel, link[1], link[2]))
151+
except IndexError:
152+
new_list.append(('https://www.youtube.com/watch?v=' + videolabel, link[1]))
150153
else:
151154
# Or just add the original link if not youtube
152155
new_list.append(link)
@@ -224,16 +227,20 @@ def reqlinks(link):
224227
args = parser.parse_args()
225228

226229
subreddit = args.subreddit
227-
if subreddit == None:
230+
231+
depth = args.depth
232+
gen_input = args.gen_input
233+
234+
if subreddit == None and not gen_input:
228235
print("Reddytt: No subreddit given, exiting. Try `reddytt --help`.")
229236
sys.exit()
230237

231-
if "?" in subreddit:
232-
print("Reddytt: Are you trying to manipulate the Reddit-api call? Stop that!")
233-
sys.exit()
238+
if not subreddit == None:
239+
if "?" in subreddit:
240+
print("Reddytt: Are you trying to manipulate the Reddit-api call? Stop that!")
241+
sys.exit()
242+
234243

235-
depth = args.depth
236-
gen_input = args.gen_input
237244

238245
# ##
239246
# ###### # # ###### #### # # ##### # #####

0 commit comments

Comments
 (0)