scdl icon indicating copy to clipboard operation
scdl copied to clipboard

fixing connection closed prematurely error for missing playlist tracks

Open YasienDwieb opened this issue 6 years ago • 5 comments

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

YasienDwieb avatar Jan 09 '19 13:01 YasienDwieb

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.

flyingrub avatar Jan 09 '19 16:01 flyingrub

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()

YasienDwieb avatar Jan 09 '19 20:01 YasienDwieb

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?

louisgregg avatar Jan 14 '19 18:01 louisgregg

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

flyingrub avatar Jan 14 '19 19:01 flyingrub

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?

Zigler21 avatar Feb 12 '22 21:02 Zigler21