反爬虫优化,评论图片支持
This commit is contained in:
+5
-4
@@ -147,9 +147,10 @@ export default function TasksPage() {
|
||||
|
||||
const extractedCount = useMemo(() => extractDouyinLinks(input).length, [input]);
|
||||
|
||||
const formatDuration = (t?: number) => {
|
||||
if (!t) return "";
|
||||
const secs = Math.max(0, Math.round((Date.now() - t) / 1000));
|
||||
const formatDuration = (startTime?: number, endTime?: number) => {
|
||||
if (!startTime) return "";
|
||||
const end = endTime || Date.now();
|
||||
const secs = Math.max(0, Math.round((end - startTime) / 1000));
|
||||
if (secs < 60) return `${secs}s`;
|
||||
const m = Math.floor(secs / 60);
|
||||
const s = secs % 60;
|
||||
@@ -228,7 +229,7 @@ export default function TasksPage() {
|
||||
<span className="text-xs text-neutral-400">已耗时 {formatDuration(t.startedAt)}</span>
|
||||
)}
|
||||
{t.status === 'success' && (
|
||||
<span className="text-xs text-neutral-400">用时 {t.startedAt ? formatDuration(t.startedAt) : '--'}</span>
|
||||
<span className="text-xs text-neutral-400">用时 {formatDuration(t.startedAt, t.finishedAt)}</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-1 flex items-center gap-2 text-sm text-neutral-200">
|
||||
|
||||
Reference in New Issue
Block a user