Jump to content
Ketarin forum

replacing strange characters


Recommended Posts

{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 post
Share on other sites

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).

save-to-file-pattern.png.2ab17d4ca1ae0d705c9b0d0a600a85dc.png

 

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".

save-to-file-simple.png.f3ee20f7dd36dc71c1d14f06eef83386.png

 

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.