fix(route/4khd): update image URL processing logic (#18761)

* fix(route/4khd): update image URL processing logic

* fix(route/4khd): update image URL processing logic
This commit is contained in:
AiraNadih 2025-04-04 07:12:35 +08:00 committed by GitHub
parent a2599f8df5
commit 517ba99ba7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import { WPPost } from './types';
const processImages = ($) => {
$('a').each((_, elem) => {
const $elem = $(elem);
const largePhotoUrl = $elem.attr('href').replace('i0.wp.com/pic', 'img');
const largePhotoUrl = $elem.attr('href')?.replace('i0.wp.com', '').replace('pic.4khd.com', 'yt4.googleusercontent.com').replace('AsHYQ', 'AsYHQ').replace('l/AAA', 'I/AAA');
if (largePhotoUrl) {
$elem.attr('href', largePhotoUrl);
$elem.find('img').attr('src', largePhotoUrl);