인프런 파일명 변경 테스트
This commit is contained in:
@@ -863,7 +863,7 @@ class LogicInflearn(object):
|
|||||||
LogicInflearn.season = "1"
|
LogicInflearn.season = "1"
|
||||||
# logger.debug(api_url)
|
# logger.debug(api_url)
|
||||||
m3u8_info = LogicInflearn.getM3u8_info(
|
m3u8_info = LogicInflearn.getM3u8_info(
|
||||||
api_url, LogicInflearn.season, idx
|
api_url, LogicInflearn.season, idx, main_title
|
||||||
)
|
)
|
||||||
# print(api_url)
|
# print(api_url)
|
||||||
# print('type::::', type(m3u8_url))
|
# print('type::::', type(m3u8_url))
|
||||||
@@ -933,7 +933,7 @@ class LogicInflearn(object):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getM3u8_info(url, season, idx):
|
def getM3u8_info(url, season, idx, main_title):
|
||||||
data_id = ""
|
data_id = ""
|
||||||
m3u8_url = ""
|
m3u8_url = ""
|
||||||
name = ""
|
name = ""
|
||||||
@@ -953,7 +953,9 @@ class LogicInflearn(object):
|
|||||||
title = res_data["course"]["_"]["current_unit"]["title"]
|
title = res_data["course"]["_"]["current_unit"]["title"]
|
||||||
if res_data["newBOX"]["video"]["name"] is not None:
|
if res_data["newBOX"]["video"]["name"] is not None:
|
||||||
name = res_data["newBOX"]["video"]["name"]
|
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:
|
if res_data["newBOX"]["video"]["vod_info"]["hlsUrl"] is not None:
|
||||||
# logger.debug(res_data["newBOX"]["video"]["vod_info"]["hlsUrl"])
|
# logger.debug(res_data["newBOX"]["video"]["vod_info"]["hlsUrl"])
|
||||||
m3u8_url = res_data["newBOX"]["video"]["vod_info"]["hlsUrl"]
|
m3u8_url = res_data["newBOX"]["video"]["vod_info"]["hlsUrl"]
|
||||||
|
|||||||
Reference in New Issue
Block a user