Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSON-RPC interface to download the video through aria2 #5822

Open
wanglongqi opened this issue May 26, 2015 · 9 comments
Open

Use JSON-RPC interface to download the video through aria2 #5822

wanglongqi opened this issue May 26, 2015 · 9 comments
Labels

Comments

@wanglongqi
Copy link

@wanglongqi wanglongqi commented May 26, 2015

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.

@yan12125 yan12125 added the request label May 26, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 26, 2015

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

@wanglongqi
Copy link
Author

@wanglongqi wanglongqi commented May 26, 2015

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.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 26, 2015

Ok, so we should conect to the server and execute the JSON-RPC commands?

@wanglongqi
Copy link
Author

@wanglongqi wanglongqi commented May 26, 2015

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.

@xfoxfu
Copy link

@xfoxfu xfoxfu commented Jan 29, 2016

👍

Such features is quite useful when using tools like Aria2GUI.

@ArtemProkopenko
Copy link

@ArtemProkopenko ArtemProkopenko commented Jul 3, 2016

Very useful feature.

@zoenglinghou
Copy link

@zoenglinghou zoenglinghou commented Jan 21, 2019

Is there any update on the feature? Thanks

@ghost
Copy link

@ghost ghost commented Apr 13, 2020

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?

@pawamoy
Copy link

@pawamoy pawamoy commented Jun 22, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.