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

fixing connection closed prematurely error for missing playlist tracks #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YasienDwieb
Copy link

Fixed the error that downloading process aborts due to missing records at playlists.

@flyingrub
Copy link
Collaborator

I think we need to test what is the response in the case of missing tracks and treat this case separately. The connection is usually closed prematurely when we loose internet connection or something like that. So it's useful to exit in this case and not try and fail to download the next tracks.

@YasienDwieb
Copy link
Author

YasienDwieb commented Jan 9, 2019

so it needs to be separated:


    if received != total_length:
        logger.error('connection closed prematurely, download incomplete, Skipping...')
        
        from urllib.request import urlopen
        # from urllib.request import urlopen
        try:
            urlopen('http://www.google.com', timeout=5)
            # handling missing playlist tracks
            return
        except urllib.URLError as err: 
            # exiting due to internet connection error
            logger.error('network error, exiting...')
            sys.exit()

@louisgregg
Copy link

The "connection closed prematurely, download incomplete" error is thrown relatively frequently when downloading a long list of files. Could Soundcloud be terminating these longer download sessions? Perhaps when a certain download limit is reached? Or is my internet just cutting out?

@flyingrub
Copy link
Collaborator

flyingrub commented Jan 14, 2019

Perhaps you just have a lot of striked songs in your playlist ?

@Zigler21
Copy link

This could also be a problem when it tries to download a song that a GO+ track, maybe add an exception flag for those kinds of tracks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants