release of version 0.4.7 added html reporting, added logging, reordered libraries, added experimental xmp meta data, fixed bug introduced due xmp meta data, added todo list
This commit is contained in:
30
libs/libgoogle.py
Normal file
30
libs/libgoogle.py
Normal file
@@ -0,0 +1,30 @@
|
||||
import googlesearch as gs
|
||||
import urllib
|
||||
from libs.libhelper import *
|
||||
|
||||
def get_random_agent():
|
||||
return (gs.get_random_user_agent())
|
||||
|
||||
def search_pdf(search, args):
|
||||
''' the function where googlesearch from mario vilas
|
||||
is called
|
||||
'''
|
||||
|
||||
search_stop = args.search_stop
|
||||
|
||||
query = '%s filetype:pdf' % search
|
||||
# print(query)
|
||||
urls = []
|
||||
|
||||
try:
|
||||
for url in gs.search(query, num=20, stop=search_stop, user_agent=gs.get_random_user_agent()):
|
||||
#print(url)
|
||||
urls.append(url)
|
||||
|
||||
except urllib.error.HTTPError as e:
|
||||
print('Error: %s' % e)
|
||||
return -1
|
||||
|
||||
|
||||
return urls
|
||||
|
||||
Reference in New Issue
Block a user