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...
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 ^^)
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.
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 ;-)
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 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!
Deleting a branch is permanent. It CANNOT be undone. Continue?