Skip to main content

Parse the information out of aria2 control files.

Project description

aria-control-file-parser

PyPI

Parse aria2c control files from the command line.

The .aria2 (Control File) contains the hash info of the magnet link, so we can parse the file to get the original magnet link. This allows you to resume the download where it left off if it was cancelled or interrupted.

See this issue.

# ================================================================
#  0                   1                   2                   3
#  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +---+-------+-------+-------------------------------------------+
# |VER|  EXT  |INFO   |INFO HASH ...                              |
# |(2)|  (4)  |HASH   | (INFO HASH LENGTH)                        |
# |   |       |LENGTH |                                           |
# |   |       |  (4)  |                                           |
# +---+---+---+-------+---+---------------+-------+---------------+
# |PIECE  |TOTAL LENGTH   |UPLOAD LENGTH  |BIT-   |BITFIELD ...   |
# |LENGTH |     (8)       |     (8)       |FIELD  | (BITFIELD     |
# |  (4)  |               |               |LENGTH |  LENGTH)      |
# |       |               |               |  (4)  |               |
# +-------+-------+-------+-------+-------+-------+---------------+
# |NUM    |INDEX  |LENGTH |PIECE  |PIECE BITFIELD ...             |
# |IN-    |  (4)  |  (4)  |BIT-   | (PIECE BITFIELD LENGTH)       |
# |FLIGHT |       |       |FIELD  |                               |
# |PIECE  |       |       |LENGTH |                               |
# |  (4)  |       |       |  (4)  |                               |
# +-------+-------+-------+-------+-------------------------------+
#
#         ^                                                       ^
#         |                                                       |
#         +-------------------------------------------------------+
#                 Repeated in (NUM IN-FLIGHT) PIECE times

# More information available at:
# https://aria2.github.io/manual/en/html/technical-notes.html
# ================================================================

How to Use

python3 aria2_parser.py dahufa.aria2

With multiple files or with a directory:

python3 aria2_parser.py dahufa.aria2 dahufa.aria2 ./folder

Reading aria2 files from folder recursively:

python3 aria2_parser.py ./ -r

Build

python3 setup.py build
python3 setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parse_aria_control_file-0.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parse_aria_control_file-0.0.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file parse_aria_control_file-0.0.0.tar.gz.

File metadata

  • Download URL: parse_aria_control_file-0.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for parse_aria_control_file-0.0.0.tar.gz
Algorithm Hash digest
SHA256 166cefe1d63067f78450e76301209267815ebddac9793dd1963cce89fa14e686
MD5 c77096ff463709a684c4a4ea4de23688
BLAKE2b-256 e55d9f30dd8428b490c641c9cf79d26cc4a3b83bfbd3aa474ca107fd2a5eb9c5

See more details on using hashes here.

File details

Details for the file parse_aria_control_file-0.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for parse_aria_control_file-0.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 95e709506adca6a5276a1d37713240141306d277efb4cd244cb4c4d200f3582b
MD5 a7cc3eb68b46558a4ef85e7c1d04bbdf
BLAKE2b-256 c46108e8b9585f48e763164a63a36510be53a586744142e76666e930fc3711d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page