dams Posted November 16, 2020 Report Share Posted November 16, 2020 hello I would like to change the name of the download file. the name contains these 2 special characters é I would like to transform the variable {file} by replacing é with e Link to comment Share on other sites More sharing options...
shawn Posted November 21, 2020 Report Share Posted November 21, 2020 {myvar:replace:é:e} If that doesn't work (likely because the characters aren't actually "é", just represented that way in your language), you can use an exclusive form of regexreplace: {myvar:regexreplace:([^a-z0-9\.\s]+):e} You'll have to know and include all legitimate and likely characters from the value of {myvar} into the exclusion block to make sure legitimate characters are not replaced. Link to comment Share on other sites More sharing options...
dams Posted November 21, 2020 Author Report Share Posted November 21, 2020 thank you shawn can you explain me where a do take this variable for works? Link to comment Share on other sites More sharing options...
dams Posted November 21, 2020 Author Report Share Posted November 21, 2020 when a start download i receive a file who's name président.... ketarin dont want start my after-download command because the name its not write president... Link to comment Share on other sites More sharing options...
shawn Posted November 21, 2020 Report Share Posted November 21, 2020 Ah, I think I understand what you're having trouble with. If you want/need the file to be named something specific you need to use the "save-to-file" option instead of the "save-in-folder" option. This field allows you to use variables to store relevant information within it, and if you want to vastly simplify an otherwise ugly filename you can do that as well. Here's a couple examples, again, from my FFmpeg profile. This pattern ("..\{category}\{appname:regexreplace:([\s\t\r\n\-\&]+):_}-{version}.{url:ext}") stores the downloaded file in a folder named "Converters" one folder ABOVE where Ketarin.exe is stored. The new file was named "..\Converters\FFmpeg-N-99959-g09f1d15ae8.zip" for today's file, since it is the AppName ("FFmpeg" - from the first line from this window) with various character sequences replaced with underscores (a safety precaution for some of my other apps), a dash, the version number (N-99959-g09f1d15ae8), then a dot (".") and the extension that would otherwise be applied from the URL (zip). This one - the only change is the download location, to "ffmpeg.{url:ext}". This one will store the file beside Ketarin.exe, named "ffmpeg.zip". You can use these patterns, or any other variable you've composed, in the "download location" as long as the save-to-file option is selected. You can also just use a static string like "president.zip" or whatever else might suit your purposes best. Link to comment Share on other sites More sharing options...
shawn Posted November 21, 2020 Report Share Posted November 21, 2020 By the way, it's much easier to help troubleshoot and demonstrate fixes if you share an application XML profile. Do this by selecting it within the list of applications in Ketarin, then use CTRL+C to copy. This will copy the application XML profile to the clipboard. Then either paste that into a new text file and attach it, or include it in a code block on the forum. You can also copy & paste the application XML profile directly back into Ketarin to duplicate it or to copy one from the site. Link to comment Share on other sites More sharing options...
dams Posted November 22, 2020 Author Report Share Posted November 22, 2020 thank you my probleme is resolve whith option "save to file" thank you shawn. now have another questions;) its torrent download ... so i start download and now the name is replace whit your help but when aria2 download torrent he take another name ....for download file . example: file whith your help names {varnamefilm} "example "winni the pooh" after aria 2 start download but the real name its maybe "XXX-winni-the-pooh- blurayx256(...).AVI" how can replace the name by first variable hows name "winni the pooh" ? Link to comment Share on other sites More sharing options...
shawn Posted November 22, 2020 Report Share Posted November 22, 2020 Assuming you're using aria2c 1.32 or later, you can use a syntax like the one I use for Tails: aria2c --bt-require-crypto=true --seed-time=0 --dir="{file:directory}" --torrent-file="{file}" --select-file=1-2 --index-out=1="{appname:regexreplace:([\s\t\r\n\-\\&\/]+):_}-{version}.iso" --index-out=2="{appname:regexreplace:([\s\t\r\n\-\\&\/]+):_}-{version}.sig" This command is used in the "after update command", and the "download" is the torrent file. In this example, the --select-file switch enables grabbing the first and second files from the torrent. The --index-out switch renames the output files to the same massaged format I use in my previous comment. Note the syntax of --index-out switch includes =#= where # represents the index of the output file, and the second portion of the parameter is the output filename. Link to comment Share on other sites More sharing options...
shawn Posted November 22, 2020 Report Share Posted November 22, 2020 One issue with this method is that it can not determine the real extensions of the selected files, so you MUST know these before hand or use another parsing method to determine the selected file extensions. Assuming they're all AVI is likely going to be a problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now