Skip to content

Commit

Permalink
Rebuild (#132)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
alexpdev committed May 29, 2022
1 parent e3a7b87 commit da5596d
Show file tree
Hide file tree
Showing 30 changed files with 11,845 additions and 5,004 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# TorrentFile

## Version 0.7.10

- Added rebuild module and subcommand see docs for more info
- Added documentation entry for rebuild subcommand
- improved logging messages
- added unit tests
- improved and expanded on type hints
- minor bug fixes

---------------------

## Version 0.7.9

- complete rewrite of the recheck procedures
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ include setup.py
recursive-exclude * __pycache__
recursive-exclude * *.pyc
recursive-exclude * *.pyo
recursive-exclude * empty
24 changes: 24 additions & 0 deletions docs/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#version-0710" class="md-nav__link">
Version 0.7.10
</a>

</li>

<li class="md-nav__item">
<a href="#version-079" class="md-nav__link">
Version 0.7.9
Expand Down Expand Up @@ -614,6 +621,13 @@
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#version-0710" class="md-nav__link">
Version 0.7.10
</a>

</li>

<li class="md-nav__item">
<a href="#version-079" class="md-nav__link">
Version 0.7.9
Expand Down Expand Up @@ -892,6 +906,16 @@


<h1 id="torrentfile">TorrentFile</h1>
<h2 id="version-0710">Version 0.7.10</h2>
<ul>
<li>Added rebuild module and subcommand see docs for more info</li>
<li>Added documentation entry for rebuild subcommand</li>
<li>improved logging messages</li>
<li>added unit tests</li>
<li>improved and expanded on type hints</li>
<li>minor bug fixes</li>
</ul>
<hr />
<h2 id="version-079">Version 0.7.9</h2>
<ul>
<li>complete rewrite of the recheck procedures</li>
Expand Down
90 changes: 72 additions & 18 deletions docs/man/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<div data-md-component="skip">


<a href="#name" class="md-skip">
<a href="#torrentfile-manual" class="md-skip">
Skip to content
</a>

Expand Down Expand Up @@ -337,6 +337,20 @@
</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#magnet" class="md-nav__link">
Magnet
</a>

</li>

<li class="md-nav__item">
<a href="#rebuild" class="md-nav__link">
Rebuild
</a>

</li>

</ul>
Expand Down Expand Up @@ -484,6 +498,20 @@
</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#magnet" class="md-nav__link">
Magnet
</a>

</li>

<li class="md-nav__item">
<a href="#rebuild" class="md-nav__link">
Rebuild
</a>

</li>

</ul>
Expand All @@ -509,17 +537,17 @@



<h1 id="name">Name</h1>
<ul>
<li>torrentfile</li>
</ul>
<h1 id="torrentfile-manual">torrentfile Manual</h1>
<h2 id="synopsis">Synopsis</h2>
<pre><code>torrentfile [options] &lt;subcommand&gt; [options] &lt;args&gt;
</code></pre>
<h2 id="description">Description</h2>
<p>torrentfile is a CLI tool for creating, editing, validating, or reviewing Bittorrent files(.torrent).
It supports all current versions of the Bittorrent Protocol files as well as hybrid files.
Has support for generating magnet URI's for meta files.</p>
<p><strong><code>torrentfile</code></strong> is a command line toolkit for working with Bittorrent files(.torrent).
Some of the tools available include creating torrent files, editing portions of a
torrent file, checking the integrity or completeness of downloaded torrent contents,
displaying details of a torrentfile, generating magnet URLs for torrentfiles, and
individual or batch rebuilding of torrent contents into their original directory
structure.</p>
<h3 id="options">Options</h3>
<ul>
<li>
Expand Down Expand Up @@ -605,19 +633,25 @@ <h4 id="info">info</h4>
<pre><code>torrentfile info &lt;path&gt;
torrentfile i &lt;path&gt;
</code></pre>
<p>There are no optional arguments for the info subcommand.</p>
<p>Display detailed information about a torrentfile such as trackers,
size of contents, Bittorrent version, any comments left, date the
torrent file was created and more. There is only one positional perameter
which is the path to the torrent file and there are no optional arguments.</p>
<ul>
<li><code>/path/to/*.torrent</code>
The relative or absolute path to the torrent file.</li>
</ul>
<h4 id="edit">edit</h4>
<p>Edit some of the different information detailed in a torrent file. The fields that
are editable each have option flags detialed below. Each option identifies the
field to edit inside the torrent file and what the new value should be. If an
option is not used then its field will be ommited in the newly created torrent
file. As such if the file is marked as private and it should remain that way,
the <code>-p</code> option should be used.</p>
<p>alias: <code>e</code></p>
<pre><code>torrentfile edit [options] &lt;path&gt;
torrentfile e [options] &lt;path&gt;
</code></pre>
<p>Each option identifies the field to edit inside the torrent file and what the new value should be.
If an option is not used then its field will be ommited in the newly created torrent file. As such
if the file is marked as private and it should remain that way, the <code>-p</code> option should be used.</p>
<ul>
<li>
<p><code>-a</code> <code>-t</code> <code>--announce</code> <code>--tracker</code>
Expand Down Expand Up @@ -645,14 +679,34 @@ <h4 id="edit">edit</h4>
</li>
</ul>
<h4 id="recheck">recheck</h4>
<p>Recheck requires two paths as arguments. The first is the path to a torrent file, and
and the second is a path to the file of directory containing the downloaded data
from that torrentfile. <code>torrentfile</code> recursively validates each file with the hashes
contained in the torrentfile, and displays the amount missing frome each file, plus
a final percentage for the whole torrent at the conclusion. This will display a
progress bar for each file including missing files. It is also permitted to use
the contents parent directory which can help for batch processing many torrent files.</p>
<p>alias: <code>r</code>, <code>check</code></p>
<pre><code>torrentfile recheck &lt;path/to/*.torrent&gt; &lt;path/to/contents&gt;
torrentfile r &lt;path/to/*.torrent&gt; &lt;path/to/contents&gt;
<pre><code>torrentfile recheck &lt;*.torrent&gt; &lt;contents&gt;
torrentfile r &lt;*.torrent&gt; &lt;contents&gt;
</code></pre>
<h3 id="magnet">Magnet</h3>
<p>Generate a magnet URL for a torrent file.</p>
<p>alias: <code>m</code></p>
<pre><code>torrentfile magnet &lt;path/to/*.torrent&gt;
</code></pre>
<h3 id="rebuild">Rebuild</h3>
<p>Rebuild individual or batches of torrent contents into the original file structure.
The program takes a path to a torrent file or directory containing torrent files,
the directory containing the torrent contents, and the destination directory to
where the rebuilt torrent content wil be located. The program will recursively
traverse the content directory searching for file's that match one of the meta files
and creates copies of the matches to the destination directory. The original files
are not effected and any existing files in the target directory will not be
overwritten.</p>
<p>alias: <code>build</code>, <code>b</code></p>
<pre><code>torrentfile rebuild &lt;metafiles&gt; &lt;contents&gt; &lt;destination&gt;
</code></pre>
<p>There are only two arguments for the recheck command and both are mandatory. The first is the absolute or relative
<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
progress bar and at the end output what percent of the torrentfile's content it found at the path indicated. It is also
permitted to use the contents parent directory as the second argument and the result will be the same.</p>


</article>
Expand Down
Binary file modified docs/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://alexpdev.github.io/torrentfile/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://alexpdev.github.io/torrentfile/Apache2/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://alexpdev.github.io/torrentfile/Commands/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://alexpdev.github.io/torrentfile/changelog/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://alexpdev.github.io/torrentfile/man/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://alexpdev.github.io/torrentfile/source/</loc>
<lastmod>2022-05-07</lastmod>
<lastmod>2022-05-29</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified docs/sitemap.xml.gz
Binary file not shown.

0 comments on commit da5596d

Please sign in to comment.