File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11
22from typing import Dict
3-
43from gdcli .helpers .browser import open_browser
54from gdcli .utils .query import builder
65from gdcli .utils .cli_arguments .args import Init
@@ -20,6 +19,8 @@ def __call__(self):
2019 url = self .__query_build_insta__ (vars (self .args ))
2120 elif (self .args .option == 3 ):
2221 url = self .__query_build_phone__ (vars (self .args ))
22+ elif (self .args .option == 4 ):
23+ url = self .__query_build_file__ (vars (self .args ))
2324 else :
2425 raise Exception ("Invalid option specified" )
2526
@@ -29,7 +30,6 @@ def __call__(self):
2930 self .parser .print_usage ()
3031 exit ()
3132 if url is not None :
32-
3333 open_browser (url = url )
3434
3535 def __query_build_general__ (self , args : Dict ) -> str :
@@ -82,3 +82,15 @@ def __query_build_phone__(self, args: Dict) -> str:
8282 sys .stdout .write (str (e ))
8383 self .parser .print_usage ()
8484 return None
85+
86+ def __query_build_file__ (args ) -> str :
87+ try :
88+ if (args .get ("search_query" )):
89+ return f'https://google.com/search?q={ args .get ("search_query" )} filetype:{ args .get ("file_type" )} '
90+ else :
91+ raise Exception (
92+ "search query is not found,pls provide search query" )
93+ except Exception as e :
94+ print (e )
95+ exit (0 )
96+ return None
Original file line number Diff line number Diff line change 1-
21from gdcli .commands .cli import Cli
3-
4-
52cli = Cli ()
63def start ():
74 cli ()
8-
95start ()
Original file line number Diff line number Diff line change @@ -6,15 +6,19 @@ class Init():
66 def _initialise_args__ (self ):
77 self .parser = argparse .ArgumentParser (
88 '''Commamd line tool for Google dorks\n
9+
910 1) -op 1 for general query \n
1011 >> gd -op 1 -q ninja -s instagram -e gamer \n
12+
1113 2) -op 2 for instagram user finding
1214 >> gd -op 2 -q ninja -b gamer -l usa
13-
14-
15+
16+ 3) -op to for specific filetype
17+ >> gd -op 3 -q python -f docx
18+
1519 ''' )
1620 self .parser .add_argument (
17- CLI_OPTIONS [4 ], dest = DISPLAY_OPTIONS [0 ], type = int , help = "Option [1 2 3]" )
21+ CLI_OPTIONS [4 ], dest = DISPLAY_OPTIONS [0 ], type = int , help = "Option [1 2 3 4 ]" )
1822 self .parser .add_argument (
1923 CLI_OPTIONS [0 ], dest = DISPLAY_OPTIONS [1 ], type = str , help = "Search Query " )
2024 self .parser .add_argument (
You can’t perform that action at this time.
0 commit comments