mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-11 22:50:45 +08:00
🐛 修复资源发布时间时区错误问题 (#114)
Some checks are pending
Docker Publish / build-and-push (push) Waiting to run
Some checks are pending
Docker Publish / build-and-push (push) Waiting to run
This commit is contained in:
parent
de37c26423
commit
6f9b009194
@ -1,4 +1,4 @@
|
||||
import datetime
|
||||
from datetime import datetime, timedelta
|
||||
import re
|
||||
import requests
|
||||
|
||||
@ -128,7 +128,8 @@ class CloudSaver:
|
||||
# 统一发布时间格式
|
||||
pubdate = item.get("pubDate", "")
|
||||
if pubdate:
|
||||
pubdate = datetime.datetime.strptime(pubdate, "%Y-%m-%dT%H:%M:%S%z").strftime("%Y-%m-%d %H:%M:%S")
|
||||
utc_tm = datetime.fromisoformat(pubdate)
|
||||
pubdate = (utc_tm + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
|
||||
# 链接去重
|
||||
if link.get("link") not in link_array:
|
||||
link_array.append(link.get("link"))
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import re
|
||||
import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import requests
|
||||
|
||||
@ -60,7 +60,8 @@ class PanSou:
|
||||
note = channel.get("note", "")
|
||||
tm = channel.get("datetime", "")
|
||||
if tm:
|
||||
tm = datetime.datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S")
|
||||
utc_tm = datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ")
|
||||
tm = (utc_tm + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
match = re.search(pattern, note)
|
||||
if match:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user