Skip to content

Commit

Permalink
Fix double encoded URLs for washington post
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Nov 11, 2024
1 parent 47bf878 commit 600382c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31267,9 +31267,12 @@ var $$IMU_EXPORT$$;
// thanks to llacb47 on github: https://github.com/qsniyg/maxurl/issues/482 (moving this rule above the /rf/ one due to [?#].*)
// https://img.washingtonpost.com/wp-apps/imrs.php?src=https://www.washingtonpost.com/rf/image_982w/2010-2019/WashingtonPost/2020/03/14/Health-Environment-Science/Graphics/promo2-coronavirus-simulator-0313.jpg&w=60&h=60
// https://www.washingtonpost.com/rw/2010-2019/WashingtonPost/2020/03/14/Health-Environment-Science/Graphics/promo2-coronavirus-simulator-0313.jpg
// thanks to liamengland1 on github: https://github.com/qsniyg/maxurl/pull/1380
// https://www.washingtonpost.com/wp-apps/imrs.php?src=https%3A%2F%2Farc-anglerfish-washpost-prod-washpost%252Es3%252Eamazonaws%252Ecom%2Fpublic%2FBJVONBA3VBXPZDXZILSARTNYY4%252Ejpg&w=992&h=662
// https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/BJVONBA3VBXPZDXZILSARTNYY4.jpg
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+wp-apps\/+imrs\.php\?(?:.*&)?src=([^&]+).*/, "$1");
if (newsrc !== src)
return decodeuri_ifneeded(newsrc);
return decodeURIComponent(decodeuri_ifneeded(newsrc));

// thumbor (todo: have a sort of get_dest_from_thumbor in common_functions)
// thanks to llacb47 on github: https://github.com/qsniyg/maxurl/issues/482
Expand Down
5 changes: 4 additions & 1 deletion userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -28592,9 +28592,12 @@ var $$IMU_EXPORT$$;
// thanks to llacb47 on github: https://github.com/qsniyg/maxurl/issues/482 (moving this rule above the /rf/ one due to [?#].*)
// https://img.washingtonpost.com/wp-apps/imrs.php?src=https://www.washingtonpost.com/rf/image_982w/2010-2019/WashingtonPost/2020/03/14/Health-Environment-Science/Graphics/promo2-coronavirus-simulator-0313.jpg&w=60&h=60
// https://www.washingtonpost.com/rw/2010-2019/WashingtonPost/2020/03/14/Health-Environment-Science/Graphics/promo2-coronavirus-simulator-0313.jpg
// thanks to liamengland1 on github: https://github.com/qsniyg/maxurl/pull/1380
// https://www.washingtonpost.com/wp-apps/imrs.php?src=https%3A%2F%2Farc-anglerfish-washpost-prod-washpost%252Es3%252Eamazonaws%252Ecom%2Fpublic%2FBJVONBA3VBXPZDXZILSARTNYY4%252Ejpg&w=992&h=662
// https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/BJVONBA3VBXPZDXZILSARTNYY4.jpg
newsrc = src.replace(/^[a-z]+:\/\/[^/]+\/+wp-apps\/+imrs\.php\?(?:.*&)?src=([^&]+).*/, "$1");
if (newsrc !== src)
return decodeuri_ifneeded(newsrc);
return decodeURIComponent(decodeuri_ifneeded(newsrc));
// thumbor (todo: have a sort of get_dest_from_thumbor in common_functions)
// thanks to llacb47 on github: https://github.com/qsniyg/maxurl/issues/482
// https://www.washingtonpost.com/resizer/5i6h3byfAbADvdFUAn-5RMklGQ4=/1200x630/filters:focal(2231x1260:4531x2559):quality(100)/arc-anglerfish-washpost-prod-washpost/public/JBWJ3HR4RQI6VL7CBEHLG63AWE.jpg
Expand Down

0 comments on commit 600382c

Please sign in to comment.