feat: 增加获取图片源地址功能

This commit is contained in:
meishibiezb
2026-05-01 21:54:20 +08:00
parent a6b86934af
commit dd97df9ede
3 changed files with 18 additions and 13 deletions

View File

@@ -5,6 +5,8 @@
export interface PinData {
/** 相对路径,如 "/pins/7118240882" */
url: string;
/** 图片缩略图地址 */
imgSmallSrc: string;
/** 图片源地址 */
imgSrc: string;
/** 图片原始宽度 */
@@ -120,9 +122,12 @@ export class PinCollector {
const width = parseFloat(img.getAttribute('width') || '0');
const height = parseFloat(img.getAttribute('height') || '0');
const originalSrc = img.src.replace(/_fw\d+(webp)?/, '');
return {
url: href,
imgSrc: img.src,
imgSmallSrc: img.src,
imgSrc: originalSrc,
imgWidth: width,
imgHeight: height,
alt: altText,