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

Add support for Aria2 RPC #284

Merged
merged 1 commit into from
Oct 8, 2018
Merged

Add support for Aria2 RPC #284

merged 1 commit into from
Oct 8, 2018

Conversation

hguandl
Copy link
Contributor

@hguandl hguandl commented Oct 7, 2018

There are several reports about the download speed would slow down gradually, especially in Bilibili:
#275 #143 #128

I am not an expert in Go and have no idea to improve the application itself. So I tried to use third-party applications to download.

aria2 is a very famous and lightweight command-line download utility. It has an interface of RPC, which means we can merely send a request to make it work.

  -aria2
    	Use Aria2 RPC to download
  -aria2addr string
    	Aria2 Address (default "localhost:6800")
  -aria2method string
    	Aria2 Method (default "http")
  -aria2token string
    	Aria2 RPC Token

Here is the demo:

  • Use built-in download:

  • Use aria2c (I use a WebUI, AriaNg to watch the speed):

I know that this breaks the independence of annie, but it is an effective workaround to improve the download speed. In addition, I only implemented the download request, leaving the post process empty. Perhaps I would make the function more completed some day or just make it a plugin for annie.

Last but not least, thank you for developing this convenient tool.

.gitignore Outdated Show resolved Hide resolved
downloader/downloader.go Outdated Show resolved Hide resolved
downloader/downloader.go Outdated Show resolved Hide resolved
downloader/downloader.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 8, 2018

Codecov Report

Merging #284 into master will increase coverage by 1.19%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #284      +/-   ##
==========================================
+ Coverage   72.07%   73.26%   +1.19%     
==========================================
  Files          26       26              
  Lines        1898     1919      +21     
==========================================
+ Hits         1368     1406      +38     
+ Misses        381      358      -23     
- Partials      149      155       +6
Impacted Files Coverage Δ
downloader/downloader.go 44.89% <0%> (-4.21%) ⬇️
extractors/twitter/twitter.go 68.49% <0%> (+52.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 24ddaed...3a65f9d. Read the comment docs.

@iawia002
Copy link
Owner

iawia002 commented Oct 8, 2018

Thanks for this! I will do some documentation and format related work tomorrow night, and then I will draft a new version.

@iawia002 iawia002 merged commit 8c9ea38 into iawia002:master Oct 8, 2018
@iawia002 iawia002 mentioned this pull request Oct 9, 2018
@M1178475702
Copy link
Contributor

I have saw the code about download.
I find that when download paylist video, there are downloaed one by one, not concurrent.
I wonder why not change it to conconcurrent?
If i modify it to concurrent, something (may be bug) will occure?

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

Successfully merging this pull request may close these issues.

3 participants