Skip to content

Additional Syntax

Etherealxx edited this page Apr 30, 2023 · 2 revisions

Rename Downloaded Files

Using > symbol, you can rename files. Take this for example
Log
Mostly catbox file has random name, by using > symbol after the link, you can type the desired name on the right. (Don't forget the extension)

Running Shell Commands

You can run shell commands by using ! in front of the command you want, just like in google colab cells. Then press the Download All! button. (Sure, it doesn't download anything, but, well😅)
Log Log
You can run many lines at once too!

Extract Everyting (@extract)

You can use @extract to extract every *.7z, *.rar, and *.zip on current directory).

#lora
<example lora .zip link>
@extract
#embed

This will extract everything on Lora folder, since the code runs from top to bottom, and when the @extract executes, the current directory is still on Lora folder.

Custom Hashtag Path (@new)

You can use @new <hashtagname> <directory> to make a new usable hashtag and assign a directory path to it.
For example, you type this and press the Download All! button:

@new #private /content/stable-diffusion-webui/outputs
#private
<example model link>

This will make a new hashtag #private, make it points to /content/stable-diffusion-webui/outputs, set #private as current directory, then download whatever into it. You can check if the new hashtag is assigned successfully by looking at the hashtag table on the right/bottom of the screen.

Custom Direct Link Download with aria2 (@aria2)

If there are other direct links that isn't supported by Batchlinks, you can use @aria or @aria2 custom command to download it. The main syntax is:

@aria2 {link} {path/hashtag} > {filename} 

You can change @aria2 with @aria, both works. Both the path/hashtag and filename is optional. This command was made to avoid hassle writing this:

aria2c --summary-interval=1 --console-log-level=error -c -x 16 -s 16 -k 1M {link} -d {path} -o {filename}

There are several ways to use it. Here i use a 20MB download test file as an example.

@aria2 http://212.183.159.230/20MB.zip

☝️ This will download the file into the current directory (where the hashtags points to). So if before that line you use #vae, it will be downloaded to the vae directory. If there are no hashtags before, it'll be sent to the default #model directory. The filename will be the last part of the link (512MB.zip).

@aria2 http://212.183.159.230/20MB.zip #vae

☝️ This will download the file into where #vae points to (which is the vae directory). You can use custom hashtag here as well.

@aria2 http://212.183.159.230/20MB.zip /content/stable-diffusion-webui 

☝️ This will download the file into the written path, which is /content/stable-diffusion-webui. Make sure it is a folder path, not a file path.

@aria2 http://212.183.159.230/20MB.zip /content/stable-diffusion-webui > 20megabytes.zip

☝️ This will download the file into the written path and rename the file into 20megabytes.zip. Remember to make sure to write the extension too.