02/05/22 - 11h30 - before change algo

master
ChérifBALDE 2022-05-02 11:31:07 +02:00 committed by cherif
parent 9ecac8909f
commit 4bb423f5de
2 changed files with 11 additions and 5 deletions

View File

@ -477,13 +477,11 @@ def Get_Extended_Result(sentence=None):
if( status is False):
return True, list_extended
return True, external_code_prefixe
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, ""
return False, []
'''
@ -520,13 +518,20 @@ def RunSearchAPI(search_text=None, external_code_prefixe=None):
print("Title = "+str(val['title']))
print("url = " + str(val['link']))
print("description = " + str(val['snippet']))
print("mot_cles = " + str(val['snippet_highlighted_words']))
if ("snippet_highlighted_words" in val.keys()):
if val['snippet_highlighted_words']:
print("mot_cles = " + str(val['snippet_highlighted_words']))
mydata['external_code'] = external_code_prefixe+"_"+str(cmpt)
mydata['title'] = str(val['title'])
mydata['url'] = str(val['link'])
mydata['description'] = str(val['snippet'])
mydata['tags'] = str(val['snippet_highlighted_words'])
if ("snippet_highlighted_words" in val.keys()):
if val['snippet_highlighted_words']:
mydata['tags'] = str(val['snippet_highlighted_words'])
mydata['update_daye'] = str(datetime.now())
mydata['rang'] = str(val['position'])
mydata['orign_search_text'] = str(search_text)

View File

@ -567,6 +567,7 @@ def recherche_text_simple(diction):
ext_status, external_code_prefixe = mycommon.Get_Extended_Result(search_text)
if(ext_status is True):
exten_coll = MYSY_GV.YTUBES_dbname['mysyserpapi']
for x in exten_coll.find({'external_code': {'$regex': re.compile(r".*" + str(external_code_prefixe) + ".*")}},