Skip to content

Tag System / Replace Keywords

Replace Tags

TagDescriptionResult Example
${url}Resource addresshttps://bmmmd.com/test.mp4
${referer}Resource request header
If the resource has no referer, no content is output. Recommended to use with the exists function
https://bmmmd.com/
${initiator}Similar to ${referer} which always has a value
If the resource has no referer, the source URL domain or current page URL is used.
https://bmmmd.com
${webUrl}Resource playback page addresshttps://bmmmd.com/test.html
${title}Title of the resource playback pageTest Video
${fullFileName}Full filenametest.mp4
${fileName}Filename, without extensiontest
${ext}Extension, without "."mp4
${userAgent}User Agent, customizable in Settings - Replace TagsMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
${cookie}Cookie required by the resource may be empty
Format is key=value;key=value;
Requires Cat Catch version 2.3.8
key=value;key2=value2;
${mobileUserAgent}The User Agent used when simulating a mobile phone
${year}
${month}
${date}
${hours}
${minutes}
${seconds}
Time related, year/month/day/hour/minute/second*
${day}Day of the week (English)Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
${now}Unix timestamp1672329448871
${fullDate}Date2020-12-28
${time}Time21'30'55
${shareApi}System share API, only allowed in #player-protocol
${range}Range generation tag, only allowed in m3u8 parser entry. For details, see m3u8 Parse

Function Support

The bolded tags in the above list can use functions

FunctionDescriptionExample
sliceCharacter extraction${title|slice:0,5}
Extract the first 5 characters of the title

${title|slice:-10}
Extract the last 10 characters of the title

Parameter setting comes from the js language slice function
replaceCharacter replacement${fullFileName|replace:".m3u8",".mp4"}
Replace ".m3u8" in the filename with ".mp4"

${title|replace:"website",""}
Delete the word "website" from the title

Parameter setting comes from the js language replace function
replaceAllCharacter replacementSame as above
replace only replaces once. replaceAll replaces multiple times.

${fullDate|replaceAll:"-","/"}
2020/12/28
Replace the date separator with "/"
regexpRegex extraction${url|regexp:"(https?://[^?]*)"}
Resource address, extract the address without parameters
existsOutput if exists
Otherwise output the second parameter. If there is no second parameter, output nothing.
${referer|exists:'--headers "Referer:*"'}
If referer exists, output --headers "Referer:*"
The * will eventually be replaced with the referer itself.

Recommended to be filled in the m3u8DL parameters. If referer exists, pass the --headers parameter to m3u8DL, otherwise do not pass it.

${fullFileName|exists:"*","${title}"}
If there is a filename, output itself; if there is no filename, output the webpage title.
toString conversion
base64
urlEncode
urlDecode
lowerCase
upperCase
filter
${title|to:base64}
5rWL6K+V6KeG6aKR
base64 encoding

${url|to:urlEncode}
https%3A%2F%2Fbmmmd.com%2Ftest.m3u8
url encoding

${url|to:lowerCase} Convert English letters to lowercase
${url|to:upperCase} Convert English letters to uppercase

${url|to:filter} Replace characters that cannot be used as filenames with HTML character entities
filterFilter/replace characters that cannot be used as filenames${url|filter:"_"} Replace characters that cannot be used as filenames with underscore
Replaced characters \ / < > : " | ? * ~

Supports chained calls, for example:

${url|regexp:"(https?://[^?]*)"|replace:"http://","https://"|to:base64}

It will perform extraction, replacement, and base64 conversion on the url in sequence from left to right.