-
Notifications
You must be signed in to change notification settings - Fork 77
Smartnaming syntax V10
The smartnaming file describes how the filename of a video is constructed.
Here is a valid file:
# Default rule
max_length = 64
template = "%title"
[[rule]] # First rule - only for pages hosted under foo.com domain
url = "foo.com"
template = "foobar-%title"
[[rule]] # Second rule - only for pages hosted under bar.com domain
url = "bar.com"
max_length = 99
template = "%title-%hostname-%selector"
selector = "h2.title"
# Etc. Add as many rules as you want.
The first part is the default rules for all websites. You can set the max_length
and the template
. VDH use the value template
of template to create file. If template
is myvideo
, then all video files will be named myvideo.mp4
. If template
is myvideo-%title
, video files will named myvideo-title-of-webpage.mp4
. You can see that the default value is juste the title of the page with a maximum size of 64 characters.
The second part is made of [[rule]]
blocks. Each block can define:
-
max_length
is the maximum filename size -
template
is the format of the filename. This can include 3 components:-
%title
is replaced with the page title -
%hostname
is replaced with the url hostname -
%selector
is replaced with the matching selector (see below)
-
-
url
is the URL of the origin of the download. -
selector
is a CSS selector that will be run against the video page
One rule starts with [[rule]]
.
The priority of a rule is defined by its position in the file. Top rules have higher priorities.
This documentation is about Video DownloadHelper.