Comments (11)
As for file size, the latest version performs gzip to session file if you add ".gz" extension after the session filename.
At the moment, aria2 internally does not differentiate options from config file and from command-line, also it sometimes changes options on the course of downloads.
from aria2.
i thought it should be an easy task, i'll see if i can do something about it probably recheck the config file for each save session (i guess this will drain more processor time)
from aria2.
Ah, that would be easier than I think. It would be good to add an option to toggle this because some people may like original behavior.
from aria2.
looking at SessionSerializer, it shouldn't be that hard. the way i see it. is checking the config file for each save session operation. that way options passed as cmd arguments will be saved since they are not permanent while general config option are ignored. (this works pretty good manually, and i was able to resume download across windows and linux)
any suggestion on the option is much appreciated (if i make it this far)
from aria2.
You cannot simply ignore options from the global config, as the global config is anything except "permanent". Users may change it all the time.
What would work, however, is de-duplicating option values within the saved session file. You would first store all the values that are common to all session items (e.g. in a special session item) and then ignore them when storing individual items. You might even be less strict and consider all options for de-duplication which "most" individual items share.
When restoring, you would first read the global options. Then for each individual item you would first set all global options and afterwards all individual item options (Also works with the "most" option).
This shouldn't be too hard to do either.
Remember that this is to reduce redundancy and minimizing the file size. So de-duplication has not to be perfect (but slow), but good enough (and fast enough).
Another simple big win would be to use short-option names instead of the long option names. Basically you would assign all PREF_* a new short-option string which is still unique. When reading back options from a serialized session you would then compare against the short and traditional long option names (for backwards compatibility).
Also, @guedouari or @tatsuhiro-t, can you reopen this. I would be interested in this, too.
from aria2.
Should be noted that the short-option string idea probably won't have much effect when serializing as .gz, though.
from aria2.
In aria2, option values are overwritten in the following order:
- default values
- conf file
- cmd-line
(See option_processing.cc for the order of option application)
For input file, its accompanied options overwrites the result of 3 (or merged into 3).
I understand that the originator wants to just save options specified by 3 and later stage.
The most options are not specified by command-line and hence input file, saving only those options will save significant amount of space.
To implement this stuff, the obvious choice is introduce parent-child relationship in Option class.
Each download item has its own Option object which fills options specified by cmd-line and input-file.
It has the association to Option object which includes options filled by conf file, which in turn has the association to Option object with default value.
When a certain option value is queried, Option object checks its own option values. If it does not have one, it then asks parent Option object and so on.
On serialization, we just asks Option not to consult parent Objects, so the overhead is almost zero.
from aria2.
I'll create a patch based on my idea.
from aria2.
since you're familiar with the code. i guess you're the best choice. still i've been trying to find onother way with less code. given the existence of a function that returns global-options (like the rpc one) it's shouldn't take more than a couple lines of code and it will be light weight. the only downside is the config file and the cmd arguments will be treated alike and ignored from the session file
from aria2.
I pushed the change 4070113. Please test it. I decided not to add option to toggle this because the content of conf file seems to be rather stable and size reduction is drastic.
from aria2.
tested with config file only and with cmd args , perfect!
hope i could be of real help next time :)
from aria2.
Related Issues (20)
- aira2 Does Not Support IPv6 Domain Remote Management?
- Failed to download file from ipv6 server HOT 2
- Using aria2c with yt-dlp returns Unrecognized URI HOT 4
- Aria2 Download queue
- aria2.session cannot write and this issue leads not to dowload
- Why is the executable file called 'aria2c' (instead of 'aria2')
- Aria2c RPC Method changeUri doesn't work HOT 1
- 关于开启https无法访问的问题 HOT 8
- How to request SFTP compression?
- Aria2 control files regularly fail to rename from aria2__temp to aria2 and do not get deleted post-download
- Support file uri scheme
- msys2-mingw64 提示 error: 'gettimeofday' was not declared in this scope; did you mean 'gettimeofday_ms'?
- HLS fragments
- Problem compiling in mingw static. undefined reference to `libiconv_set_ relocation_prefix HOT 2
- option --follow-torrent=false doesn't work
- aria2c incompatible with most CDNs
- Subfolder support for metalink HOT 1
- File Version property shouldn't be empty
- OSError: [Errno 99] Cannot assign requested address HOT 1
- OSX10.7 aria2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aria2.