Commit 7a510943 authored by liyang's avatar liyang

fix:youtube视频发布日期处理

parent b757e70a
......@@ -41,6 +41,12 @@ def reptile(browser=None, search_word=""):
url = f'https://www.youtube.com/watch?v={id}'
base_urr = get_base_file_url()
log.debug(url)
releaseTime = ""
try:
releaseTime = str(convert_string_to_time(element_time_list[index].text))
except:
releaseTime = str(time.time())
# 下载视频
state_download = yt_dlp_download(url, 'youtube')
file_http_src = f'{base_urr}youtube/{id}.mp4'
if state_download:
......@@ -53,7 +59,7 @@ def reptile(browser=None, search_word=""):
"reptileTime": str(int(time.time())),
"type": '视频',
"author": element_author_list[index].text,
"releaseTime": str(convert_string_to_time(element_time_list[index].text))
"releaseTime": releaseTime
}
data.append(obj)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment