update readme

This commit is contained in:
黄哲骁 2017-11-19 17:41:36 +08:00
parent 3b08d17488
commit 4dd1a4e84f
3 changed files with 87 additions and 9 deletions

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

46
.idea/workspace.xml generated
View File

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="aa6c2199-1a12-49e5-87b6-7ea25345c196" name="Default" comment="" /> <list default="true" id="aa6c2199-1a12-49e5-87b6-7ea25345c196" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" /> <option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -15,11 +19,11 @@
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="450"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="450">
<file leaf-file-name="read_a2.py" pinned="false" current-in-tab="true"> <file leaf-file-name="read_a2.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/read_a2.py"> <entry file="file://$PROJECT_DIR$/read_a2.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2304"> <state relative-caret-position="-1620">
<caret line="64" column="16" lean-forward="true" selection-start-line="64" selection-start-column="16" selection-end-line="64" selection-end-column="16" /> <caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="32" selection-end-column="66" />
<folding> <folding>
<element signature="e#0#13#0" expanded="true" /> <element signature="e#0#13#0" expanded="true" />
</folding> </folding>
@ -27,6 +31,16 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="README.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="540">
<caret line="15" column="27" lean-forward="true" selection-start-line="15" selection-start-column="27" selection-end-line="15" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="__builtin__.py" pinned="false" current-in-tab="false"> <file leaf-file-name="__builtin__.py" pinned="false" current-in-tab="false">
<entry file="file://$USER_HOME$/.PyCharm2017.1/system/python_stubs/-762174762/__builtin__.py"> <entry file="file://$USER_HOME$/.PyCharm2017.1/system/python_stubs/-762174762/__builtin__.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
@ -73,10 +87,14 @@
<find>h</find> <find>h</find>
</findStrings> </findStrings>
</component> </component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/read_a2.py" /> <option value="$PROJECT_DIR$/read_a2.py" />
<option value="$PROJECT_DIR$/README.md" />
</list> </list>
</option> </option>
</component> </component>
@ -92,6 +110,7 @@
<option name="width" value="1936" /> <option name="width" value="1936" />
<option name="height" value="1056" /> <option name="height" value="1056" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView"> <component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1"> <navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages /> <flattenPackages />
@ -338,14 +357,15 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" /> <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3295325" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33028573" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18534483" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18534483" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3295325" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3295325" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
@ -425,13 +445,21 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/read_a2.py"> <entry file="file://$PROJECT_DIR$/read_a2.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2304"> <state relative-caret-position="-1620">
<caret line="64" column="16" lean-forward="true" selection-start-line="64" selection-start-column="16" selection-end-line="64" selection-end-column="16" /> <caret line="3" column="0" lean-forward="true" selection-start-line="3" selection-start-column="0" selection-end-line="32" selection-end-column="66" />
<folding> <folding>
<element signature="e#0#13#0" expanded="true" /> <element signature="e#0#13#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="540">
<caret line="15" column="27" lean-forward="true" selection-start-line="15" selection-start-column="27" selection-end-line="15" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
</component> </component>
</project> </project>

View File

@ -1 +1,45 @@
# aria-control-file-parser # 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
# ================================================================
```