Giter Site home page Giter Site logo

Comments (6)

erickutcher avatar erickutcher commented on August 22, 2024 3

Here's a beta version you can try out. I removed the DELETE and FILE_SHARE_DELETE flags from the CreateFile function. Those flags allowed the program to rename or delete a file while it's in use. I'll have to figure out a convenient way (probably an option) to allow both things.

HTTP_Downloader_32_1.0.5.1_Beta.zip
HTTP_Downloader_64_1.0.5.1_Beta.zip

from httpdownloader.

RationalFragile avatar RationalFragile commented on August 22, 2024 1

Thank youuu 😊 I can confirm that VLC can read the file while it's downloading now.

(Tho, I realized now that there is another small inconvenience for this use case: when using only one download stream (download parts), I think instead of using sparse files or dense files (whether zeroed or not), HTTP_Downloader should use normal "append" to file so that the video player (like VLC) would hit the end of the file and stop while waiting for the next frames instead of continuing to play the empty region.)

But, honestly, just sharing my idea, unless many other people want this, I think it's just not worth the hassle, especially dealing with when someone starts a single-stream download then switches it to multi-parts... And really, pausing VLC manually and waiting for the buffering a bit should be more than enough. And it's so much better than having to wait for a 24GB file to complete before playing it 😅

Again, thank you so much for your time and for the update.

from httpdownloader.

erickutcher avatar erickutcher commented on August 22, 2024

Sorry for such a late reply. I've tried implementing this because it's something that I've wanted to be able to do also, but I could never figure it out. It has to do with file access rights and probably other stuff. Maybe one of these days I'll solve it.

from httpdownloader.

RationalFragile avatar RationalFragile commented on August 22, 2024

@erickutcher, According to a stackoverflow, you need to remove other file permissions when creating the file: "Writer [processes] must use FILE_SHARE_READ, Reader [processes] must use FILE_SHARE_READ | FILE_SHARE_WRITE".

So just search for "FILE_SHARE_READ" and make sure other FILE_SHARE_X are removed. I don't know if it's necessary to remove FILE_SHARE_DELETE or not but you can just remove it since it's fine to require the user to stop the download before deleting the file.

Hope this helps 😊

from httpdownloader.

erickutcher avatar erickutcher commented on August 22, 2024

I don't know if doing an append type download will have any effect. This link should download as a chunked transfer: https://filesamples.com/samples/video/mkv/sample_1280x720_surfing_with_audio.mkv

HTTP Downloader will download chunked transfers by appending to the end of the file. These types of downloads will show a "?" in the File Size column since their file size isn't known from the start.

VLC seems to bail when it hits a premature end of file.

from httpdownloader.

RationalFragile avatar RationalFragile commented on August 22, 2024

I see what you mean! Something fishy is going on. Because, I tried a few files and non of them made VLC wait.

I swear it happened before (the VLC bar shows an orange ping pong loading thing, while some other program like chrome is downloading it). But I can't now find any video to show this. And also this has nothing to do with HTTP_Downloader, I tested by downloading with Chrome and VLC still ended the playback instead of waiting.

So yeah, I was wrong in assuming that the file writing method was the one causing the issue.

from httpdownloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.