mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-17 09:50:42 +08:00
Compare commits
1 Commits
e274f8d2d0
...
db087a6f28
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db087a6f28 |
@ -1,4 +1,3 @@
|
|||||||
from datetime import datetime, timedelta
|
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -125,11 +124,6 @@ class CloudSaver:
|
|||||||
content = content.replace('<mark class="highlight">', "")
|
content = content.replace('<mark class="highlight">', "")
|
||||||
content = content.replace("</mark>", "")
|
content = content.replace("</mark>", "")
|
||||||
content = content.strip()
|
content = content.strip()
|
||||||
# 统一发布时间格式
|
|
||||||
pubdate = item.get("pubDate", "")
|
|
||||||
if pubdate:
|
|
||||||
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:
|
if link.get("link") not in link_array:
|
||||||
link_array.append(link.get("link"))
|
link_array.append(link.get("link"))
|
||||||
@ -138,7 +132,6 @@ class CloudSaver:
|
|||||||
"shareurl": link.get("link"),
|
"shareurl": link.get("link"),
|
||||||
"taskname": title,
|
"taskname": title,
|
||||||
"content": content,
|
"content": content,
|
||||||
"datetime": pubdate,
|
|
||||||
"tags": item.get("tags", []),
|
"tags": item.get("tags", []),
|
||||||
"channel": item.get("channel", ""),
|
"channel": item.get("channel", ""),
|
||||||
"channel_id": item.get("channelId", ""),
|
"channel_id": item.get("channelId", ""),
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
from datetime import datetime, timedelta
|
import datetime
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
@ -60,8 +60,7 @@ class PanSou:
|
|||||||
note = channel.get("note", "")
|
note = channel.get("note", "")
|
||||||
tm = channel.get("datetime", "")
|
tm = channel.get("datetime", "")
|
||||||
if tm:
|
if tm:
|
||||||
utc_tm = datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ")
|
tm = datetime.datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S")
|
||||||
tm = (utc_tm + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
|
|
||||||
|
|
||||||
match = re.search(pattern, note)
|
match = re.search(pattern, note)
|
||||||
if match:
|
if match:
|
||||||
|
|||||||
@ -955,7 +955,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchSuggestions(index, taskname, deep = 1) {
|
searchSuggestions(index, taskname, deep = 1) {
|
||||||
taskname = taskname.replace(/\((19|20)\d{2}\)/g, '').trim();
|
|
||||||
if (taskname.length < 2) {
|
if (taskname.length < 2) {
|
||||||
console.log(`任务名[${taskname}]过短${taskname.length} 不进行搜索`);
|
console.log(`任务名[${taskname}]过短${taskname.length} 不进行搜索`);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user