diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 03a590f2..9bfe4fc1 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -640,6 +640,7 @@ "custom_downloadtemplate_hintExtension": { "message": "{extension}: Downloaded tweet's file extension." }, "custom_downloadtemplate_hintID": { "message": "{id}: Tweet's ID." }, "custom_downloadtemplate_hintIndex": { "message": "{index}: Index for each file to download. (for posts with multiple media)" }, + "custom_downloadtemplate_hintFilename": { "message": "{filename}: Original filename from pbs.twimg.com." }, "nonexistent_user": { "message": "This account doesn't exist" }, "nonexistent_user_desc": { "message": "Try searching for another." }, "suspended_user": { "message": "Account suspended" }, diff --git a/layouts/settings/index.html b/layouts/settings/index.html index fb93f0b4..890d76fd 100644 --- a/layouts/settings/index.html +++ b/layouts/settings/index.html @@ -404,6 +404,7 @@

__MSG_custom_downloadtemplate__



__MSG_custom_downloadtemplate_hintExtension__
__MSG_custom_downloadtemplate_hintID__
__MSG_custom_downloadtemplate_hintIndex__ +
__MSG_custom_downloadtemplate_hintFilename__

diff --git a/scripts/helpers.js b/scripts/helpers.js index f9772b85..06728e56 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -3605,7 +3605,8 @@ async function appendTweet(t, timelineContainer, options = {}) { "extension": extension, "timestamp": ts, "id": t.id_str, - "index": _index + "index": _index, + "filename": url.pathname.substring(url.pathname.lastIndexOf('/') + 1, url.pathname.lastIndexOf('.')) }; filename = filename_template.replace(/\{([\w]+)\}/g, (_, key) => filesave_map[key]); }