From 4dd1a4e84fb087b4bb6d148d43399b246a775b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=93=B2=E9=AA=81?= Date: Sun, 19 Nov 2017 17:41:36 +0800 Subject: [PATCH] update readme --- .idea/vcs.xml | 6 ++++++ .idea/workspace.xml | 46 ++++++++++++++++++++++++++++++++++++--------- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 .idea/vcs.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 53310d4..4a4a418 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,7 +1,11 @@ - + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 24ddb16..4578ee7 100644 --- a/README.md +++ b/README.md @@ -1 +1,45 @@ # aria-control-file-parser + +parse aria2c control file from cmd line. + +I just find someone, also find a way to convert .aria2 file to magnet link. + +just see this issue(https://github.com/aria2/aria2/issues/792). + +read the aria technical notes, the .aria2 (Control File) contain the hash info of +the magnet link, so just parse the file. + +also @alphatr write a tool transform .aria2 file to a magnet link use javascript. + + +``` +# ================================================================ +# 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 detail +# https://aria2.github.io/manual/en/html/technical-notes.html +# ================================================================ +``` \ No newline at end of file