#30 [Feature] progress bar

Open
opened 5 years ago by Zykino · 6 comments
Zykino commented 5 years ago

It could be useful to have a rough indication (like on the webpages).

Especially on a slow connection... or when Windows cli want you to be slow...

It could be useful to have a rough indication (like on the webpages). Especially on a slow connection... or when Windows cli want you to be slow...
Poster
Owner

Interesting feature indeed.

On Youtube, the example code features something like a progress bar through the API, but I was unable to made it work when I began prismedia. Perhaps their documentation has improved from then 🤔

About Peertube, I guess it should have something as the web interface do it, but for the moment the /upload endpoint does not give updates regarding the progress, it's a full synchronous process. I guess we'll need to ask the dev directly for this one (actually I have not checked the documentation from a long time ^^)

Interesting feature indeed. On Youtube, the example code features something like a progress bar through the API, but I was unable to made it work when I began prismedia. Perhaps their documentation has improved from then :thinking: About Peertube, I guess it should have something as the web interface do it, but for the moment the /upload endpoint does not give updates regarding the progress, it's a full synchronous process. I guess we'll need to ask the dev directly for this one (actually I have not checked the documentation from a long time ^^)
LecygneNoir added the
enhancement
label 5 years ago
LecygneNoir added the
help wanted
label 5 years ago
Zykino commented 3 years ago
Poster

Well I just thought again about it and found out that the lib ussed to upload the files can call a callback through the upload. https://toolbelt.readthedocs.io/en/latest/uploading-data.html#monitoring-your-streaming-multipart-upload.
There is even an example progress bar using the clint package. https://gitlab.com/sigmavirus24/toolbelt/blob/master/examples/monitor/progress_bar.py.

I must admit I looked for peertube and not youtube yet and we should use the same progress bar visualisation for both platforms. But at least now we know how to get the info, I will try to dig more or even do the implementation when I have a bit more time.

Well I just thought again about it and found out that the lib ussed to upload the files can call a callback through the upload. https://toolbelt.readthedocs.io/en/latest/uploading-data.html#monitoring-your-streaming-multipart-upload. There is even an example progress bar using the `clint` package. https://gitlab.com/sigmavirus24/toolbelt/blob/master/examples/monitor/progress_bar.py. I must admit I looked for peertube and not youtube yet and we should use the same progress bar visualisation for both platforms. But at least now we know how to get the info, I will try to dig more or even do the implementation when I have a bit more time.
Poster
Owner

Indeed the toolbet package has something like that, but I think it also heavily depends of the website you upload to. It needs some sort of return to know the progress?

Or perhaps we "simulate" some sort of progress bar according to the video size and the upload speed, it may help.

For youtube, I am pretty sure it exist, as there is also some retryable code to finish a failed upload (which I never implemented ^^').

Feel free to play with it! If you work on the peertube part, I may be able to add youtube later ;-)

Indeed the toolbet package has something like that, but I think it also heavily depends of the website you upload to. It needs some sort of return to know the progress? Or perhaps we "simulate" some sort of progress bar according to the video size and the upload speed, it may help. For youtube, I am pretty sure it exist, as there is also some retryable code to finish a failed upload (which I never implemented ^^'). Feel free to play with it! If you work on the peertube part, I may be able to add youtube later ;-)
Zykino commented 3 years ago
Poster

As I understand, it does not depend on the website we upload to and I do not think it needs to: we know in advence the upload size, and the library that uploads the file know where it is at (so how much has been uploaded).

I have a small demo for peertube but did not really understand how to get the information from the youtube library. Still a bit left to polish but I should make a PR soon (around next weekend).

Edit: Printing for each byte is way too much, kB is still very fast but MB is updated once every 2sec (with 500kB/s upload). And seeing XXX/4359 when the file is 4.25GB is also a bit strange. Maybe I should adapt depending on the file size (more or less than a Giga / Tera) ?
I do not want to show percentage if I can (but the Youtube doc seemed to only speak about percentage…).

As I understand, it does not depend on the website we upload to and I do not think it needs to: we know in advence the upload size, and the library that uploads the file know where it is at (so how much has been uploaded). I have a small demo for peertube but did not really understand how to get the information from the youtube library. Still a bit left to polish but I should make a PR soon (around next weekend). Edit: Printing for each byte is way too much, kB is still very fast but MB is updated once every 2sec (with 500kB/s upload). And seeing XXX/4359 when the file is 4.25GB is also a bit strange. Maybe I should adapt depending on the file size (more or less than a Giga / Tera) ? I do not want to show percentage if I can (but the Youtube doc seemed to only speak about percentage…).
LecygneNoir removed the
help wanted
label 3 years ago
LecygneNoir added the
Work in Progress
label 3 years ago
Zykino commented 3 years ago
Poster

I forgot to close this ticket.

Status is as follow:

I forgot to close this ticket. Status is as follow: - [x] Peertube - [ ] Youtube
Poster
Owner

As we have discussed on Discord, it's perhaps possible for youtube, now the API seems to support something called "chunks", which is useful to report upload status.

It did not exist when I first write the code for youtube (Code I get from the Youtube documentation itself :-D), so it would need some rewrite, but the idea is good!

As reference: 07263305b5/python/retrieve_reports.py (L119)

As we have discussed on Discord, it's perhaps possible for youtube, now the API seems to support something called "chunks", which is useful to report upload status. It did not exist when I first write the code for youtube (Code I get from the Youtube documentation itself :-D), so it would need some rewrite, but the idea is good! As reference: https://github.com/youtube/api-samples/blob/07263305b59a7c3275bc7e925f9ce6cabf774022/python/retrieve_reports.py#L119
LecygneNoir added the
Todo
label 3 years ago
LecygneNoir removed the
Work in Progress
label 3 years ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.