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

How to get file download progress (file no., percentage, ETA and rate) #5958

Closed
ghost opened this issue Jun 12, 2015 · 7 comments
Closed

How to get file download progress (file no., percentage, ETA and rate) #5958

ghost opened this issue Jun 12, 2015 · 7 comments

Comments

@ghost
Copy link

@ghost ghost commented Jun 12, 2015

Is there a way to get file download progress in the terminal. The --console-title shows the progress and displays progress details in title.

youtube-dl --extract-audio --audio-quality 0 --console-title --audio-format mp3 <url>

But i want those details as an output in terminal and not in the title

eg: a="hello"; echo $a

is this possible

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jun 12, 2015

Does --newline help?

@ghost
Copy link
Author

@ghost ghost commented Jun 12, 2015

@yan12125 no it doesnt help? how to fetch the percentage and ETA alone?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jun 12, 2015

The progress is properly outputted to the terminal, could you post the output you get and the way you want to process it?

@ghost
Copy link
Author

@ghost ghost commented Jun 12, 2015

@jaimeMF
youtube-dl --extract-audio --audio-quality 0 --newline --audio-format mp3 https://www.youtube.com/playlist?list=PL1C815DB73EC2678E

This is the out put

[youtube:playlist] PL1C815DB73EC2678E: Downloading webpage
[download] Downloading playlist: Less than 1 minute
[youtube:playlist] playlist Less than 1 minute: Collected 4 video ids (downloading 4 of them)
[download] Downloading video 1 of 4
[youtube] KNLwsqzFfNg: Downloading webpage
[youtube] KNLwsqzFfNg: Extracting video information
[youtube] KNLwsqzFfNg: Downloading DASH manifest
download] Destination: _1 min. - Amendes pour les particules du LHC-KNLwsqzFfNg.m4a

[download]   0.4% of 231.51KiB at  6.10KiB/s ETA 00:30
[download]   1.1% of 231.51KiB at 27.07KiB/s ETA 00:10
[download]   4.0% of 231.51KiB at 19.24KiB/s ETA 00:04
[download]   6.5% of 231.51KiB at 75.06KiB/s ETA 00:03
[download]  13.4% of 231.51KiB at 98.22KiB/s ETA 00:03
[download]  28.7% of 231.51KiB at 81.40KiB/s ETA 00:02
[download]  61.7% of 231.51KiB at 91.56KiB/s ETA 00:01
[download]  86.2% of 231.51KiB at 82.96KiB/s ETA 00:00
[download] 100.0% of 231.51KiB at 73.21KiB/s ETA 00:00
[download] 100% of 231.51KiB in 00:02
[ffmpeg] Correcting container in "_1 min. - Amendes pour les particules du LHC-KNLwsqzFfNg.m4a"
WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
[avconv] Destination: _1 min. - Amendes pour les particules du LHC-KNLwsqzFfNg.mp3
WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
Deleting original file _1 min. - Amendes pour les particules du LHC-KNLwsqzFfNg.m4a (pass -k to keep)
[download] Downloading video 2 of 4
[youtube] wTvXkMpJflk: Downloading webpage
[youtube] wTvXkMpJflk: Extracting video information
[youtube] wTvXkMpJflk: Downloading DASH manifest
etc
etc

and i wand only
Downloading video 1 of 4 [download] Downloading video 2 of 4

as $files1

FIRST FILE

file =1 
per      time             rate
0.40%   00:30:00    6.10KiB/s
1.10%   00:10:00    27.07KiB/s
4.00%   00:04:00    19.24KiB/s
6.50%   00:03:00    75.06KiB/s
13.40%  00:03:00    98.22KiB/s
28.70%  00:02:00    81.40KiB/s
61.70%  00:01:00    91.56KiB/s
86.20%  00:00:00    82.96KiB/s
100.00% 00:00:00    231.51KiB

SECOND, THIRD...FILES

As separate variable $file, $per, $time, $rate
i know we can use awk but for this complicated output how should i do

@ghost ghost changed the title How to get file download progress How to get file download progress (percentage, ETA and rate) Jun 12, 2015
@ghost ghost changed the title How to get file download progress (percentage, ETA and rate) How to get file download progress (file no., percentage, ETA and rate) Jun 12, 2015
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 12, 2015

Generally, you should use an API. I see little sense overcomplexing progress output with template similar to -o.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jun 12, 2015

Currently you have the option to parse the youtube-dl output or use the python api as @dstftw has mentioned. I'm closing this issue as a duplicate of #152, if we implement it we would offer the download progress as a json output.

@jaimeMF jaimeMF closed this Jun 12, 2015
@ghost
Copy link
Author

@ghost ghost commented Jun 12, 2015

I am a little bit confuesed, API and PHP is used for web application right. I have installed youtube-dl in my ubuntu system

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
3 participants
You can’t perform that action at this time.