Skip to main content

Parse the information out of aria2 control files.

Project description

aria-control-file-parser

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-1.0.0.tar.gz (5.2 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-1.0.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: parse_aria_control_file-1.0.0.tar.gz
  • Upload date:
  • Size: 5.2 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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e23a51fe46f9483d0818368997dbbdbc81191d6fcb7313ccaece1eea2091c510
MD5 39d74db7e5cd9e323387749c5f242bb2
BLAKE2b-256 ab402da6a6fc52e5d112ad75fd23e30aa117f752a83eee85b10b8918a83849ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for parse_aria_control_file-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f0739a88f9e76cf3b3d7e62f8d9f65f8280a43cc0d03997ab5033f86e1422ee6
MD5 7df2807ffb7d72de3236398a0990997b
BLAKE2b-256 e2030dc8bd3bc7a2db90b5325dca46eae59feaa43d59d3ea592cefdccf5b1928

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