Skip to content

Commit 7ac8dd8

Browse files
author
yasht01
committed
Add command line argument to setup custom API key
1 parent e348213 commit 7ac8dd8

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
help="Save answer to a file",
3535
action="store_true")
3636

37+
parser.add_argument("-c",
38+
"--custom",
39+
help="Set a custom API key",
40+
action="store_true")
41+
3742
ARGV = parser.parse_args()
3843

3944
search_flag = Search(ARGV)

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ requests==2.24.0
55
termcolor==1.1.0
66
urllib3==1.25.10
77
rich==9.9.0
8+
oauthlib==3.1.0
9+
requests-oauthlib==1.3.0

src/arguments/search.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def search_args(self):
3939
webbrowser.open(f"{url}?title={self.arguments.new}")
4040
else:
4141
webbrowser.open(url)
42+
elif self.arguments.custom:
43+
self.utility_object.setCustomKey()
4244

4345
def search_for_results(self, save=False):
4446
queries = ["What do you want to search", "Tags"]

0 commit comments

Comments
 (0)