Open wanglongqi opened 9 years ago
If the flag --enable-rpc
is all you need to enable JSON-RPC
, does adding it you youtube-dl with the --external-downloader-args
option work?
If not, could you post the command you would use from the command line to make aria2c use the JSON-RPC
Maybe I do not use aria2 the right way. I have a JSON-RPC
server running on my computer, rerun aria2c
with --enable-rpc
will print error like IPv4 RPC: failed to bind TCP port 6800
.
Ok, so we should conect to the server and execute the JSON-RPC commands?
Yes, I think it should be not hard to implement. Here is an example from document:
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc')
>>> opts = dict(dir='/tmp',
... header=['Accept-Language: ja',
... 'Accept-Charset: utf-8'])
>>> s.aria2.addUri(['http://example.org/file'], opts)
'1'
The main problem is how to assemble this function into current framework. Maybe add another external downloader or read configuration file.
+ Very useful feature.
Is there any update on the feature? Thanks ❤
aria2p is a client that sends the RPC commands to an aria2 server. We could try to symlink aria2 to aria2p in order to fool youtube-dl into using aria2p instead. Where is the aria2 executable used by youtube-dl located?
@frogger72 maybe you could add a new external downloader using aria2p instead of aria2c? https://github.com/ytdl-org/youtube-dl/blob/master/youtube_dl/downloader/external.py#L181
Why youtube-dl doesn't provide its own JSON-RPC interface? Much better than passing command line args to the script.
Currently, download through aria2 is implemented in external downloader. I do not like the interface in the terminal, and aria2 has a pretty good JSON-RPC interface, which can be managed from web interface. I would like to be able to see the download list and speed through web browser instead of terminal window, since they are easier to read and looks prettier.