인프런 파일명 변경 테스트

This commit is contained in:
2022-05-15 17:39:57 +09:00
parent cc4e4e422b
commit 492611a15f

View File

@@ -863,7 +863,7 @@ class LogicInflearn(object):
LogicInflearn.season = "1"
# logger.debug(api_url)
m3u8_info = LogicInflearn.getM3u8_info(
api_url, LogicInflearn.season, idx
api_url, LogicInflearn.season, idx, main_title
)
# print(api_url)
# print('type::::', type(m3u8_url))
@@ -933,7 +933,7 @@ class LogicInflearn(object):
return data
@staticmethod
def getM3u8_info(url, season, idx):
def getM3u8_info(url, season, idx, main_title):
data_id = ""
m3u8_url = ""
name = ""
@@ -953,7 +953,9 @@ class LogicInflearn(object):
title = res_data["course"]["_"]["current_unit"]["title"]
if res_data["newBOX"]["video"]["name"] is not None:
name = res_data["newBOX"]["video"]["name"]
filename = f"{title} - S{season.zfill(2)}.E{str(idx).zfill(3)} - {name.split('.')[0]}.{name.split('.')[-1]}"
# filename = f"{title} - S{season.zfill(2)}E{str(idx).zfill(3)} - {name.split('.')[0]}.{name.split(
# '.')[-1]}"
filename = f"{main_title} - S{season.zfill(2)}E{str(idx).zfill(3)} - {title}.{name.split('.')[-1]}"
if res_data["newBOX"]["video"]["vod_info"]["hlsUrl"] is not None:
# logger.debug(res_data["newBOX"]["video"]["vod_info"]["hlsUrl"])
m3u8_url = res_data["newBOX"]["video"]["vod_info"]["hlsUrl"]