인프런 검색 추가
This commit is contained in:
@@ -350,6 +350,7 @@ class LogicInflearn(object):
|
|||||||
logger.error(traceback.format_exc())
|
logger.error(traceback.format_exc())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@yommi_logger(logging_type="debug")
|
||||||
def get_search_result(query):
|
def get_search_result(query):
|
||||||
try:
|
try:
|
||||||
# query = query.encode("utf-8")
|
# query = query.encode("utf-8")
|
||||||
@@ -359,8 +360,10 @@ class LogicInflearn(object):
|
|||||||
html_content = LogicInflearn.get_html(url)
|
html_content = LogicInflearn.get_html(url)
|
||||||
download_path = ModelSetting.get("download_path")
|
download_path = ModelSetting.get("download_path")
|
||||||
tree = html.fromstring(html_content)
|
tree = html.fromstring(html_content)
|
||||||
tmp_items = tree.xpath('//div[contains(class, "column")]')
|
tmp_items = tree.xpath(
|
||||||
# logger.info('tmp_items:::', tmp_items)
|
'//div[contains(@class, "courses_card_list_body")]/div[contains(@class, "column")]'
|
||||||
|
)
|
||||||
|
# logger.info(f"tmp_items::: {tmp_items}")
|
||||||
|
|
||||||
data = {"ret": "success", "query": query}
|
data = {"ret": "success", "query": query}
|
||||||
|
|
||||||
@@ -386,7 +389,9 @@ class LogicInflearn(object):
|
|||||||
entity["teacher"] = item.xpath('.//div[@class="instructor"]/text()')[
|
entity["teacher"] = item.xpath('.//div[@class="instructor"]/text()')[
|
||||||
0
|
0
|
||||||
].strip()
|
].strip()
|
||||||
entity["image_link"] = item.xpath('.//img[@class="photo"]/@src')[0]
|
entity["image_link"] = item.xpath('.//img[@class="swiper-lazy"]/@src')[
|
||||||
|
0
|
||||||
|
]
|
||||||
# logger.info('entity:::', entity['title'])
|
# logger.info('entity:::', entity['title'])
|
||||||
|
|
||||||
data["episode"].append(entity)
|
data["episode"].append(entity)
|
||||||
@@ -953,7 +958,7 @@ class LogicInflearn(object):
|
|||||||
)
|
)
|
||||||
# print(api_url)
|
# print(api_url)
|
||||||
# print('type::::', type(m3u8_url))
|
# print('type::::', type(m3u8_url))
|
||||||
logger.debug(m3u8_info)
|
# logger.debug(m3u8_info)
|
||||||
|
|
||||||
# temp1['title'] = title
|
# temp1['title'] = title
|
||||||
temp1["save_folder"] = Util.change_text_for_use_filename(data["save_folder"])
|
temp1["save_folder"] = Util.change_text_for_use_filename(data["save_folder"])
|
||||||
|
|||||||
@@ -36,12 +36,7 @@
|
|||||||
// console.log('current_data:: ', current_data)
|
// console.log('current_data:: ', current_data)
|
||||||
let now = Math.floor(new Date().getTime() / 1000)
|
let now = Math.floor(new Date().getTime() / 1000)
|
||||||
|
|
||||||
if (params.code === "") {
|
|
||||||
} else {
|
|
||||||
document.getElementById("code").value = params.code;
|
|
||||||
document.getElementById("analysis_btn").click();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("{{arg['current_code']}}" !== "") {
|
if ("{{arg['current_code']}}" !== "") {
|
||||||
if (current_data) {
|
if (current_data) {
|
||||||
@@ -59,6 +54,12 @@
|
|||||||
// {#$('[data-tooltip="true"]').tooltip();#}
|
// {#$('[data-tooltip="true"]').tooltip();#}
|
||||||
// {#$('.bootstrap-tooltip').tooltip();#}
|
// {#$('.bootstrap-tooltip').tooltip();#}
|
||||||
}
|
}
|
||||||
|
if (params.code === "") {
|
||||||
|
} else {
|
||||||
|
document.getElementById("code").value = params.code;
|
||||||
|
document.getElementById("analysis_btn").click();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('params.code:::> ', params.code)
|
// console.log('params.code:::> ', params.code)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user