casey / intermodal

A command-line utility for BitTorrent torrent file creation, verification, and more
https://imdl.io
Creative Commons Zero v1.0 Universal
456 stars 22 forks source link

BEP 47: Padding files and extended file attributes #99

Open casey opened 4 years ago

casey commented 4 years ago

BEP 47

Add padding files and align files in torrents to piece boundaries. Should probably be enabled by default.

(I got 99 issues and this is one.)

deliciouslytyped commented 1 year ago

I'm looking for a CLI tool that supports creating torrents with symbolic links. The libtorrent library seems to support it per https://github.com/arvidn/libtorrent/issues/3636 but I haven't found a (CLI) way to actually create one.

vt-idiot commented 8 months ago

I'm looking for a CLI tool that supports creating torrents with symbolic links. The libtorrent library seems to support it but I haven't found a (CLI) way to actually create one.

@deliciouslytyped As in the utility will "follow" symlinks and the resulting .torrent will include the actual files they point to, or create symlinks once downloaded? For the former, imdl has actually been perfect! It is the only utility I have found that will actually follow symlinks, and actually ignores hidden files. I thought it was too good to be true, so I gathered all the scattered files up into one folder and made a torrent again with my client. Same hash. The only thing stopping me from using it is the lack of BEP 47 support...

PS S:\Definitely\Not\Movies\Actually\Linux\ISOs> ls

    Directory: S:\Definitely\Not\Movies\Actually\Linux\ISOs

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
la---          2023-11-10  2:27 PM              0 Not_A_Movie_Part_1.mp4 -> K:\A\Dying\Hard\Drive\Not_A_Movie_Part_1.mp4
la---          2023-11-10  2:27 PM              0 Not_A_Movie_Part_2.mp4 -> K:\A\Dying\Hard\Drive\Not_A_Movie_Part_2.mp4
la---          2023-11-10  2:27 PM              0 Not_A_Movie_Part_3.mp4 -> K:\A\Dying\Hard\Drive\Not_A_Movie_Part_3.mp4
-a---          2023-08-05  8:29 PM     2424255151 Not_A_Movie_Part_4.mp4
S:\Definitely\Not\Movies\Actually\Linux\ISOs>dir . /A H
 Volume in drive S is
 Volume Serial Number is

 Directory of S:\Definitely\Not\Movies\Actually\Linux\ISOs

2023-11-10  02:27 PM    <DIR>          .
2023-11-10  02:27 PM    <DIR>          ..
2019-06-02  08:23 AM           170,163 folder.jpg
2019-06-02  08:04 AM           130,178 Not-A-Screenshot-1.jpg
2019-06-02  08:04 AM            68,244 Not-A-Screenshot-2.jpg
2019-06-02  08:04 AM            70,865 Not-A-Screenshot-3.jpg
2019-06-02  08:04 AM            70,909 Not-A-Screenshot-4.jpg
2019-06-02  08:05 AM            66,952 Not-A-Screenshot-5.jpg
2019-06-02  08:05 AM            69,209 Not-A-Screenshot-6.jpg
2019-06-02  08:05 AM            72,925 Not-A-Screenshot-7.jpg
2023-11-10  02:27 PM    <SYMLINK>      Not_A_Movie_Part_1.mp4 [K:\A\Dying\Hard\Drive\Not_A_Movie_Part_1.mp4]
2023-11-10  02:27 PM    <SYMLINK>      Not_A_Movie_Part_2.mp4 [K:\A\Dying\Hard\Drive\Not_A_Movie_Part_2.mp4]
2023-11-10  02:27 PM    <SYMLINK>      Not_A_Movie_Part_3.mp4 [K:\A\Dying\Hard\Drive\Not_A_Movie_Part_3.mp4]
2023-08-05  07:29 PM     2,424,255,151 Not_A_Movie_Part_4.mp4

The resulting .torrent ignored all of the hidden images, although I was ready to just use the glob option with *.mp4 if that didn't work, and it actually hashed Parts 1-3 too. No other utility I've tried followed through on doing both even when they claimed to.

For the latter, I am not sure how that would work. My symlink on Windows is nothing like your symlink on Linux which is nothing like Jimbob's symlink on MacOS. Sure, they might behave or look the same, but now in addition to dealing with however they work on Linux or Mac, you've got NTFS hardlinks for files (adds a new MFT record pointing to the same data) and directories, plus symbolic "soft" links which are closer to, but still not quite what you get on Linux with a symlink. And even across Windows systems, an NTFS file "hardlink", if you somehow got a .torrent to represent it, would cause issues for the 3 people actually using ReFS; that only supported symlinks until very recently. Hell, Windows programs cannot even tell hardlinked files or directories (a.k.a junctions) apart - they look like actual files and folders to them. And it's a coinflip as to whether or not NTFS symlinks will: get treated as files, treated like .lnk shortcuts, or just ignored, by any programs other than cmd/explorer/pwsh. A lot of cross platform stuff flat out treats NTFS like it doesn't support symlinks at all as a result. e.g. jdupes has flags that will allow it to read and deduplicate symlinks (with warnings against using them, I think default behavior ignores them so that you don't delete an actual file and keep the symlink on accident), but if you ask it to create links to deduplicate files...it only makes hardlinks on NTFS, never actual symlinks.