Skip to content
Ng Guoyou edited this page May 27, 2019 · 11 revisions

Twitter /media images

// Fix Twitter media extensions
// https://pbs.twimg.com/media/D7daES-XoAAPyoA?format=jpg&name=large > D7daES-XoAAPyoA.jpg
sourceurl: pbs.twimg.com/media/(.*)\?.*format=(.*)&.*
capture: sourceurl
into: :$1:.:$2:

Twitter :large images

// Remove :large from Twitter images
filename: (.*)(:|_)large
sourceurl: pbs.twimg.com
capture: filename
into: :$1:

Add ISO date to filenames

// Add ISO date to filenames
filename: .*
into: :isodate:_:filename:

Add jpg and mp4 extensions to images and videos without extensions in filename

// Matches images with no dot extension in filename
filename: ^[^\.]+[^\.]{0,5}$
mediatype: image
into: :filename:.jpg

// Matches videos with no dot extension in filename
filename: ^[^\.]+[^\.]{0,5}$
mediatype: video
into: :filename:.mp4

Add html extension to all page saves

// Add .html extension to pages
context: page
into: :filename:.html