Multiple scripts for the same video without duplicating files: Symlinks

In several topics I read about people duplicating video files to support multiple versions of the same script. The obvious downside here is the additional disk space used.

I wanted to share a better way which is just as fast, by making symlinks (a reference to a file that behaves as a copy of said file). You can create them from a terminal window, but to make it easy there is the following program:

Windows Option
Note: Only works on NTFS filesystems.

Link Shell Extension

After installing you can rightclick + dragdrop a file and it creates a symlink of the file.
image

You can rename the symlink to your alternative script, with the end result being as follows: Note the Symlink takes up no space. All video players will treat the .symlink as if it is the linked MP4 file.
image

MAC OS option:
https://github.com/nickzman/symboliclinker/releases
image

LINUX

ln -s file.mp4 file.easy.mp4

18 Likes

Smart, I’d like to add this also Works on Linux and OSX.

IIRC symlinks work on most filesystems except FAT/FAT32/exFAT etc…

1 Like

Thanks for bringing this ability to have symlinks on windows to my attention! I don’t know why I never thought of looking for something like this it’s always been something that bugged my with NTFS. Will be very helpful for scripts and equally helpful for my day to day life!

1 Like

I’m able to use the symlinks to have a renamed copy of the file, and play the file. But VLC and MPC-HC use the name of the source file, not the symlink. This means when linking to something like MFP, the scripts for the original file will be loaded, instead of the alternate scripts.

I can’t comment on MPC-HC, but it does kinda work with when using VLC+ScriptPlayer. The trick is that the video file (symlink) has to be “pull into” ScriptPlayer (drag/drop opening in ScriptPlayer).

If you’ve already linked VLC and ScriptPlayer, the video will still play in VLC (ScriptPlayer on its own isn’t a good video player…). Doing it in this order will play the correct script. Opening the symlink normally will just play the file (as the original name) in VLC with the original script.

 
 

Different problem…Does anyone know how to get symlinks to work for VR videos. DLNA won’t see the symlink files at all on DeoVR or Herespher. SMB on Herespehere is funny…the symlinks show up as folders…and when clicking on the folder, its says:

Can’t access SMB share files with the current user. Please verify the current user has acces to these SMB share files.

I’m able to access the entire directory via SMB except for these folder/symlinks. Anyone got a clue how to get this working? Maybe @HereSphere can chime in if no one else has any input?

I was able to fix my problems by using hardlinks instead. Hardlinks will report the filename properly to video players.

Windows Explorer reports increased disk usage, but if you check with a more sophisticated tool, it’s not real disk usage. Basically Explorer is counting the same disk space over as many times as you hardlinked it.

I also use hardlinks in windows. They’re easier to make, they point to the same i-node on the disk, rather than to a directory file, so you can rename things or move them to different folders in the same drive without consequence. If you delete one, you don’t have to worry about deleting the ‘anchor’, until you’ve deleted the last file.

mklink /h “<new_filename>” “<original_file>”

They also work when I access the share over the network. If I have F:\anime\smut-action.mp4 and make a hard link with:

mklink /h “F:\pmv\smut-beats.mp4” “F:\anime\smut-action.mp4”

when I map a drive to the shared folder, I can add N:\anime\smut-action.mp4 and N:\pmv\smut-beats.mp4 to the playlist (Potplayer or MPC-HC), and so long as there’s a .funscript with the same name in each folder as well, it all works.

I get a lot of use out of it when I have several funscripts for the same video file by different scripters, different intensity, some with speed limits, some that have filler, some that only track the girl’s action, etc.

All told, I figure it’s a good 20-30% disk space reduction.

I’m fine with using the command line for one, writing a quick batch file to do several files, but I grabbed Link Shell Extension to add click functionality to the windows explorer context menu. It creates hard and symbolic links by right clicking the source file(s) to select it as a target, then right clicking the folder to ‘drop as’ whichever you’d like. It also puts symbols on the file icons to let you know they’re a link. (A red arrow to the upper right, similar to what a shortcut has)