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

Download stuck at 99% #20

Closed
Toylerrr opened this issue Jun 9, 2024 · 10 comments
Closed

Download stuck at 99% #20

Toylerrr opened this issue Jun 9, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@Toylerrr
Copy link

Toylerrr commented Jun 9, 2024

I'm trying to use this package to download a files from a Gamevault server. This is the API endpoint that I am using. The auth seems to work and it will download the file segments but once it hits 99% it halts and just sits there.

from pypdl import *
from aiohttp import BasicAuth
import logging

logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger()

def main():
    # Using Basic Authentication
    username = "test"
    password = "asdfghjkl"
    headers = {"User-Agent":"My cool Program/0.1"}
    auth = BasicAuth(username, password)
    print(f"Auth object: {auth}")
    dl = Pypdl(auth=auth, headers=headers)
    # Start the download
    dl.start(url='http://192.168.0.200:5006/api/games/1/download', multisegment=True, block=True)

if __name__ == '__main__':
    main()

would you happen to have any insight on how I can get this to work?

@mjishnu
Copy link
Owner

mjishnu commented Jun 13, 2024

hey, does this occur when its trying to combine the files, can you check the download folder and see the size of each file if all have same size it means its an issue in the combining process

@Toylerrr
Copy link
Author

yes it does seem to have downloaded all the chunks then sits at 99%

@mjishnu
Copy link
Owner

mjishnu commented Jun 13, 2024

will look into it. did you try again and faced same issue ? in some cases due to some i/o issue it can happen when you re-run script it should be fixed but if not then might be a bug somewhere

@Toylerrr
Copy link
Author

Fresh try this AM after a server restart to see if that was the issue. Still sitting at 99%. Just a note I was troubleshooting a lot when I posted originally and I couldn't get it to work with gamevault.

image

@Toylerrr
Copy link
Author

Interestingly enough if I do a non-multi segment download it does complete but doesn't give me the files just the JSON as a zip and says 401 error. Password is guaranteed correct.

{ "message": "Unauthorized", "statusCode": 401 }

@mjishnu
Copy link
Owner

mjishnu commented Jun 13, 2024

Interestingly enough if I do a non-multi segment download it does complete but doesn't give me the files just the JSON as a zip and says 401 error. Password is guaranteed correct.

{ "message": "Unauthorized", "statusCode": 401 }

this is certainly weird if password was correct. what about size is it displaying any and you are passing it as aiohttp.basicauth right

@mjishnu
Copy link
Owner

mjishnu commented Jun 13, 2024

Fresh try this AM after a server restart to see if that was the issue. Still sitting at 99%. Just a note I was troubleshooting a lot when I posted originally and I couldn't get it to work with gamevault.

image

ah now that i am looking, try and change name to something without whitespace that could be causing the combination not occur, try to set name to something like "booth" or something anything without white spaces also make sure the path doesn't have white spaces too. currently i am a bit busy i will try to reproduce it tomorrow sorry for the delay.

and another thing try and download with previous version of pypdl v1.3.2 ( note: there are change to class and attributes can check doc of 1.3.2 tag for more details)

@mjishnu mjishnu self-assigned this Jun 16, 2024
@mjishnu
Copy link
Owner

mjishnu commented Jun 16, 2024

with commit 4fb506b the issue regarding Unauthorized status while using single segment download has been fixed, it was caused by a typo

the issue regarding download stuck at 99% this is because of incorrect segment size which is caused due the a bug in Gamevault server. it was accepting non-inclusive range headers this is not a standarad practice as range headers should be inclusive

i have opened an issue regarding this in Gamevault repo: Phalcode/gamevault-backend#298

@mjishnu mjishnu added the bug Something isn't working label Jun 16, 2024
@Toylerrr
Copy link
Author

Thank you, this is something that I never would have figured out. I greatly appreciate your assistance and look forward to this fix on the pypdl as well as your fix on the gamevault repo.

@mjishnu
Copy link
Owner

mjishnu commented Jun 18, 2024

Thanks for reporting, with v1.4.1 this should be fixed.

@mjishnu mjishnu closed this as completed Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants