Closed heartlog closed 1 year ago
How would you want to calculate the file sizes of the download? The API doesn't return information about it, therefore it could only be guessed based on a formula. Fetching the size for each possible stream individually would cause a lot of unneeded network traffic. I found an article which could be started of with, however I'm not sure how appropriate it would be.
Well I have an idea Well you you can try Stackoverflow article
I already stated out previously that it's not a solution as it would cause unneeded network traffic.
Why not try then newpipes method ?
As far as i khow newpipe also extract the video source url and somehow determines the size of video
size of a video in Java based on its playback URL, you can use following code ..
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
public class VideoSize {
public static void main(String[] args) throws IOException {
URL url = new URL("https://pipedproxy-bom.kavin.rocks/videoplayback?expire=1678474107&ei=GycLZPqaAcyGvw%3D%3D&cpn=jbveMn4EKPCy0CDH&host=rr1---sn-cvh76nls.googlevideo.com");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("HEAD");
int fileSize = connection.getContentLength();
System.out.println("File size: " + fileSize + " bytes");
}
}
This code sends a HEAD request to the video URL to retrieve the header information, which includes the content length of the video file. The content length is then printed to the console in bytes.
You can send a HEAD request to each streaming URL, then calculate it based on the Content-Length
header.
I'm aware, we're already doing that when starting a download. However, that would need to be done for 20 streams in parallel and in my opinion cause unneeded server traffic.
I'm aware, we're already doing that when starting a download. However, that would need to be done for 20 streams in parallel and in my opinion cause unneeded server traffic.
How about using nested list (multiline drop-down was it ?) like structure? Ex. 1) 144p ā
Then if I click 480 then the format option will become apparent. Like this you can divide 20 stream according and limit to less request to server at time. ā“ only 2-3 (max 4) request required for 1 resolution at time.
By this there will be no load on server and also it'll be fast.
.
https://github.com/libre-tube/LibreTube/blob/master/CODE_OF_CONDUCT.md
Please don't tag maintainers/members.
Sorry, about that
That's now possible thanks to https://github.com/TeamPiped/Piped-Backend/pull/599
Thank God !! Good work Bnyro !! š„°
Feature request
Show size of file after choosing the resolution and audio quality.
1.After selecting the resolution of the file, the application could calculate the size of the file to be downloaded.
2.The calculated size of the file could then be displayed next to the resolution option selected, perhaps in a different color or font to make it more visible.
How should it be ?
Selection of video resolution
Select audio quality
Resulting last interface
Other details
Why we need it ?
By this user's can download video according to storage and dataplan while considering the network š speed.. Not to mention Newpipe already have this feature, you can see that for reference..
š
Acknowledgements