|
13 | 13 | # reddytt.py
|
14 | 14 | # https://github.com/johanbluecreek/reddytt
|
15 | 15 | #
|
16 |
| -__version__ = "1.4.6" |
| 16 | +__version__ = "1.4.7" |
17 | 17 | user_agent = "Reddytt v{}".format(__version__)
|
18 | 18 | #
|
19 | 19 | ################################################################################
|
@@ -146,7 +146,10 @@ def clean_yt(link_list):
|
146 | 146 | print('Reddytt: skipping URL without video label:', link)
|
147 | 147 | continue
|
148 | 148 | # 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])) |
150 | 153 | else:
|
151 | 154 | # Or just add the original link if not youtube
|
152 | 155 | new_list.append(link)
|
@@ -224,16 +227,20 @@ def reqlinks(link):
|
224 | 227 | args = parser.parse_args()
|
225 | 228 |
|
226 | 229 | 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: |
228 | 235 | print("Reddytt: No subreddit given, exiting. Try `reddytt --help`.")
|
229 | 236 | sys.exit()
|
230 | 237 |
|
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 | + |
234 | 243 |
|
235 |
| - depth = args.depth |
236 |
| - gen_input = args.gen_input |
237 | 244 |
|
238 | 245 | # ##
|
239 | 246 | # ###### # # ###### #### # # ##### # #####
|
|
0 commit comments