Skip to content

Commit da5596d

Browse files
authored
Rebuild (#132)
* Added rebuild subcommand and module * added an error check on path traversal. * fix coverage gaps and fix minor bugs with the rebuild module, add unit tests for rebuild module * fixed linting errors * fix coverage gaps and added error checking * bump version to 0.7.10 * metadata alterations bumnp version 0.7.10
1 parent e3a7b87 commit da5596d

30 files changed

+11845
-5004
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# TorrentFile
22

3+
## Version 0.7.10
4+
5+
- Added rebuild module and subcommand see docs for more info
6+
- Added documentation entry for rebuild subcommand
7+
- improved logging messages
8+
- added unit tests
9+
- improved and expanded on type hints
10+
- minor bug fixes
11+
12+
---------------------
13+
314
## Version 0.7.9
415

516
- complete rewrite of the recheck procedures

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ include setup.py
1010
recursive-exclude * __pycache__
1111
recursive-exclude * *.pyc
1212
recursive-exclude * *.pyo
13-
recursive-exclude * empty

docs/changelog/index.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@
291291
</label>
292292
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
293293

294+
<li class="md-nav__item">
295+
<a href="#version-0710" class="md-nav__link">
296+
Version 0.7.10
297+
</a>
298+
299+
</li>
300+
294301
<li class="md-nav__item">
295302
<a href="#version-079" class="md-nav__link">
296303
Version 0.7.9
@@ -614,6 +621,13 @@
614621
</label>
615622
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
616623

624+
<li class="md-nav__item">
625+
<a href="#version-0710" class="md-nav__link">
626+
Version 0.7.10
627+
</a>
628+
629+
</li>
630+
617631
<li class="md-nav__item">
618632
<a href="#version-079" class="md-nav__link">
619633
Version 0.7.9
@@ -892,6 +906,16 @@
892906

893907

894908
<h1 id="torrentfile">TorrentFile</h1>
909+
<h2 id="version-0710">Version 0.7.10</h2>
910+
<ul>
911+
<li>Added rebuild module and subcommand see docs for more info</li>
912+
<li>Added documentation entry for rebuild subcommand</li>
913+
<li>improved logging messages</li>
914+
<li>added unit tests</li>
915+
<li>improved and expanded on type hints</li>
916+
<li>minor bug fixes</li>
917+
</ul>
918+
<hr />
895919
<h2 id="version-079">Version 0.7.9</h2>
896920
<ul>
897921
<li>complete rewrite of the recheck procedures</li>

docs/man/index.html

Lines changed: 72 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<div data-md-component="skip">
7373

7474

75-
<a href="#name" class="md-skip">
75+
<a href="#torrentfile-manual" class="md-skip">
7676
Skip to content
7777
</a>
7878

@@ -337,6 +337,20 @@
337337
</ul>
338338
</nav>
339339

340+
</li>
341+
342+
<li class="md-nav__item">
343+
<a href="#magnet" class="md-nav__link">
344+
Magnet
345+
</a>
346+
347+
</li>
348+
349+
<li class="md-nav__item">
350+
<a href="#rebuild" class="md-nav__link">
351+
Rebuild
352+
</a>
353+
340354
</li>
341355

342356
</ul>
@@ -484,6 +498,20 @@
484498
</ul>
485499
</nav>
486500

501+
</li>
502+
503+
<li class="md-nav__item">
504+
<a href="#magnet" class="md-nav__link">
505+
Magnet
506+
</a>
507+
508+
</li>
509+
510+
<li class="md-nav__item">
511+
<a href="#rebuild" class="md-nav__link">
512+
Rebuild
513+
</a>
514+
487515
</li>
488516

489517
</ul>
@@ -509,17 +537,17 @@
509537

510538

511539

512-
<h1 id="name">Name</h1>
513-
<ul>
514-
<li>torrentfile</li>
515-
</ul>
540+
<h1 id="torrentfile-manual">torrentfile Manual</h1>
516541
<h2 id="synopsis">Synopsis</h2>
517542
<pre><code>torrentfile [options] &lt;subcommand&gt; [options] &lt;args&gt;
518543
</code></pre>
519544
<h2 id="description">Description</h2>
520-
<p>torrentfile is a CLI tool for creating, editing, validating, or reviewing Bittorrent files(.torrent).
521-
It supports all current versions of the Bittorrent Protocol files as well as hybrid files.
522-
Has support for generating magnet URI's for meta files.</p>
545+
<p><strong><code>torrentfile</code></strong> is a command line toolkit for working with Bittorrent files(.torrent).
546+
Some of the tools available include creating torrent files, editing portions of a
547+
torrent file, checking the integrity or completeness of downloaded torrent contents,
548+
displaying details of a torrentfile, generating magnet URLs for torrentfiles, and
549+
individual or batch rebuilding of torrent contents into their original directory
550+
structure.</p>
523551
<h3 id="options">Options</h3>
524552
<ul>
525553
<li>
@@ -605,19 +633,25 @@ <h4 id="info">info</h4>
605633
<pre><code>torrentfile info &lt;path&gt;
606634
torrentfile i &lt;path&gt;
607635
</code></pre>
608-
<p>There are no optional arguments for the info subcommand.</p>
636+
<p>Display detailed information about a torrentfile such as trackers,
637+
size of contents, Bittorrent version, any comments left, date the
638+
torrent file was created and more. There is only one positional perameter
639+
which is the path to the torrent file and there are no optional arguments.</p>
609640
<ul>
610641
<li><code>/path/to/*.torrent</code>
611642
The relative or absolute path to the torrent file.</li>
612643
</ul>
613644
<h4 id="edit">edit</h4>
645+
<p>Edit some of the different information detailed in a torrent file. The fields that
646+
are editable each have option flags detialed below. Each option identifies the
647+
field to edit inside the torrent file and what the new value should be. If an
648+
option is not used then its field will be ommited in the newly created torrent
649+
file. As such if the file is marked as private and it should remain that way,
650+
the <code>-p</code> option should be used.</p>
614651
<p>alias: <code>e</code></p>
615652
<pre><code>torrentfile edit [options] &lt;path&gt;
616653
torrentfile e [options] &lt;path&gt;
617654
</code></pre>
618-
<p>Each option identifies the field to edit inside the torrent file and what the new value should be.
619-
If an option is not used then its field will be ommited in the newly created torrent file. As such
620-
if the file is marked as private and it should remain that way, the <code>-p</code> option should be used.</p>
621655
<ul>
622656
<li>
623657
<p><code>-a</code> <code>-t</code> <code>--announce</code> <code>--tracker</code>
@@ -645,14 +679,34 @@ <h4 id="edit">edit</h4>
645679
</li>
646680
</ul>
647681
<h4 id="recheck">recheck</h4>
682+
<p>Recheck requires two paths as arguments. The first is the path to a torrent file, and
683+
and the second is a path to the file of directory containing the downloaded data
684+
from that torrentfile. <code>torrentfile</code> recursively validates each file with the hashes
685+
contained in the torrentfile, and displays the amount missing frome each file, plus
686+
a final percentage for the whole torrent at the conclusion. This will display a
687+
progress bar for each file including missing files. It is also permitted to use
688+
the contents parent directory which can help for batch processing many torrent files.</p>
648689
<p>alias: <code>r</code>, <code>check</code></p>
649-
<pre><code>torrentfile recheck &lt;path/to/*.torrent&gt; &lt;path/to/contents&gt;
650-
torrentfile r &lt;path/to/*.torrent&gt; &lt;path/to/contents&gt;
690+
<pre><code>torrentfile recheck &lt;*.torrent&gt; &lt;contents&gt;
691+
torrentfile r &lt;*.torrent&gt; &lt;contents&gt;
692+
</code></pre>
693+
<h3 id="magnet">Magnet</h3>
694+
<p>Generate a magnet URL for a torrent file.</p>
695+
<p>alias: <code>m</code></p>
696+
<pre><code>torrentfile magnet &lt;path/to/*.torrent&gt;
697+
</code></pre>
698+
<h3 id="rebuild">Rebuild</h3>
699+
<p>Rebuild individual or batches of torrent contents into the original file structure.
700+
The program takes a path to a torrent file or directory containing torrent files,
701+
the directory containing the torrent contents, and the destination directory to
702+
where the rebuilt torrent content wil be located. The program will recursively
703+
traverse the content directory searching for file's that match one of the meta files
704+
and creates copies of the matches to the destination directory. The original files
705+
are not effected and any existing files in the target directory will not be
706+
overwritten.</p>
707+
<p>alias: <code>build</code>, <code>b</code></p>
708+
<pre><code>torrentfile rebuild &lt;metafiles&gt; &lt;contents&gt; &lt;destination&gt;
651709
</code></pre>
652-
<p>There are only two arguments for the recheck command and both are mandatory. The first is the absolute or relative
653-
<code>&lt;path&gt;</code> to the torrent file, and the second is the absolute or relative <code>&lt;path&gt;</code> to it's content. This will display a
654-
progress bar and at the end output what percent of the torrentfile's content it found at the path indicated. It is also
655-
permitted to use the contents parent directory as the second argument and the result will be the same.</p>
656710

657711

658712
</article>

docs/objects.inv

77 Bytes
Binary file not shown.

docs/search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/sitemap.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://alexpdev.github.io/torrentfile/</loc>
5-
<lastmod>2022-05-07</lastmod>
5+
<lastmod>2022-05-29</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>https://alexpdev.github.io/torrentfile/Apache2/</loc>
10-
<lastmod>2022-05-07</lastmod>
10+
<lastmod>2022-05-29</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
<url>
1414
<loc>https://alexpdev.github.io/torrentfile/Commands/</loc>
15-
<lastmod>2022-05-07</lastmod>
15+
<lastmod>2022-05-29</lastmod>
1616
<changefreq>daily</changefreq>
1717
</url>
1818
<url>
1919
<loc>https://alexpdev.github.io/torrentfile/changelog/</loc>
20-
<lastmod>2022-05-07</lastmod>
20+
<lastmod>2022-05-29</lastmod>
2121
<changefreq>daily</changefreq>
2222
</url>
2323
<url>
2424
<loc>https://alexpdev.github.io/torrentfile/man/</loc>
25-
<lastmod>2022-05-07</lastmod>
25+
<lastmod>2022-05-29</lastmod>
2626
<changefreq>daily</changefreq>
2727
</url>
2828
<url>
2929
<loc>https://alexpdev.github.io/torrentfile/source/</loc>
30-
<lastmod>2022-05-07</lastmod>
30+
<lastmod>2022-05-29</lastmod>
3131
<changefreq>daily</changefreq>
3232
</url>
3333
</urlset>

docs/sitemap.xml.gz

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)