-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.py
30 lines (20 loc) · 915 Bytes
/
input.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import argparse
import find_path
def get_args():
dl_location = find_path.get_download_path()
parser = argparse.ArgumentParser(description="ultimate guitar chords scraper",
usage="ugs UG_link [-h] [--dl [DOWNLOAD_LOCATION]] [--hide]")
parser.add_argument("UG_link", help="ultimate guitar page link")
parser.add_argument("--dl", metavar="DOWNLOAD_LOCATION",
nargs="?",
const=dl_location,
help="download info to a .docx file")
parser.add_argument("--hide", help="hide tab info", action="store_true", default=False)
args = parser.parse_args()
main_ug_link = "tabs.ultimate-guitar.com/tab/"
# checks if link from ultimate guitar site
if main_ug_link in args.UG_link:
return args
else:
print("Must be valid ultimate guitar link.")
exit()