Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2. 参数可调
  • Loading branch information
rachpt committed Feb 18, 2020
1 parent 01c8a4c commit 25b5cd5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lanzou/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def _name_format(name):
return name

@staticmethod
def _time_format(time_str) -> str:
def time_format(time_str) -> str:
"""输出格式化时间 %Y-%m-%d"""
if '秒前' or '分钟前' in time_str:
if ('秒前' in time_str) or ('分钟前' in time_str):
return datetime.today().strftime('%Y-%m-%d')
elif '昨天' in time_str:
return (datetime.today() - timedelta(days=1)).strftime('%Y-%m-%d')
Expand Down Expand Up @@ -128,6 +128,18 @@ def is_folder_url(share_url) -> bool:
pat = 'https?://www.lanzous.com/b[a-z0-9]{7,}/?'
return True if re.fullmatch(pat, share_url) else False

def set_guise_suffix(self, suffix):
self._guise_suffix = suffix

def set_rar_part_name(self, part_name):
self._rar_part_name = part_name

def set_timeout(self, timeout):
self._timeout = timeout

def set_max_size(self, max_size):
self._max_size = max_size

def set_rar_tool(self, bin_path) -> int:
"""设置解压工具路径"""
if os.path.isfile(bin_path):
Expand Down

0 comments on commit 25b5cd5

Please sign in to comment.