Commit 4d1b2f94 authored by Georg Teufelberger's avatar Georg Teufelberger
Browse files

Move print usage into its own function

parent ba8f17bd
......@@ -590,6 +590,17 @@ def setup_arg_parser():
)
return parser
def print_usage():
"""Prints basic usage of parser and gives examples"""
print_information("You haven't added any lecture links! To download a lecture video you need to pass a link to the lecture, e.g.:")
print_information(" \"python3 vo-scraper.py https://video.ethz.ch/lectures/d-infk/2019/spring/252-0028-00L.html\"")
print_information("")
print_information("You can also pass optional arguments. For example, the following command downloads all lectures of \"Design of Digital Circuits\" from the year 2019 in low quality:")
print_information(" \"python3 vo-scraper.py --quality low --all https://video.ethz.ch/lectures/d-infk/2019/spring/252-0028-00L.html\"")
print_information("")
print_information("To see all possible arguments run \"python3 vo-scraper.py --help\"")
# ===============================================================
# __ __ _
# | \/ | __ _ (_) _ __
......@@ -636,13 +647,7 @@ lecture_objects += [tuple((link.split(' ') + ['',''])[:3]) for link in links] #
# Print basic usage and exit if no lecture links are passed
if not links:
print_information("You haven't added any lecture links! To download a lecture video you need to pass a link to the lecture, e.g.:")
print_information(" \"python3 vo-scraper.py https://video.ethz.ch/lectures/d-infk/2019/spring/252-0028-00L.html\"")
print_information("")
print_information("You can also pass optional arguments. For example, the following command downloads all lectures of \"Design of Digital Circuits\" from the year 2019 in low quality:")
print_information(" \"python3 vo-scraper.py --quality low --all https://video.ethz.ch/lectures/d-infk/2019/spring/252-0028-00L.html\"")
print_information("")
print_information("To see all possible arguments run \"python3 vo-scraper.py --help\"")
print_usage()
sys.exit()
# Run scraper for every link provided
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment