Rudloff / alltube

Web GUI for youtube-dl
GNU General Public License v3.0
2.96k stars 584 forks source link

Can't extract playlist zip file : empty archive / end-of-central-directory signature not found #320

Open jdaviescoates opened 4 years ago

jdaviescoates commented 4 years ago

New issue

I wondered if Alltube supported playlists, so I whacked a playlist in and to my delight it sucked in all the video and presented me with a lovely Download everything button. :-D

However, after clicking on that button and waiting for the zip file to be generated and then download, I can't then extract the zip file :(

When trying to unzip by simply doing right click Extract here in my file manager I get an error about it being an empty archive.

If I try the command line it tells me:

end-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.

Your environment

Please answer these questions when reporting a new issue:

What is your operating system (Windows, Linux, OSX, etc.)?

Ubuntu 18.04

What is your web server (Apache, IIS, etc.)?

Not sure, whatever Cloudron is. Apache, I think.

What version of AllTube are you using?

AllTube 2.3.0

How did you install AllTube (with Git or with a release package)?

With the Cloudron package

What version of PHP are you using?

Whatever latest Cloudron is running

What version of Python are you using?

Whatever latest Cloudron is running

What version of youtube-dl are you using?

Whatever latest Cloudron package has

Do you get any PHP-related errors in your webserver's logs?

No

What is the content of your config/config.yml file?

---
# Path to your youtube-dl binary
youtubedl: vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py

# Path to your python binary
python: /usr/bin/python

# An array of parameters to pass to youtube-dl
params:
    - --no-warnings
    - --ignore-errors
    - --flat-playlist
    - --restrict-filenames
    - --no-playlist

# True to enable audio conversion
convert: true

# True to enable advanced conversion mode
convertAdvanced: true

# List of formats available in advanced conversion mode
convertAdvancedFormats: [mp3, avi, flv, wav]

# Path to your avconv or ffmpeg binary
avconv: /usr/bin/ffmpeg

# avconv/ffmpeg logging level.
avconvVerbosity: error

# Path to the directory that contains the phantomjs binary.
phantomjsDir: vendor/bin/

# True to disable URL rewriting
uglyUrls: false

# True to stream videos through server
# Set to "ask" if you want to allow it but not enable by default.
stream: true

# True to enable remux mode (merge best audio and best video)
remux: true

# MP3 bitrate when converting (in kbit/s)
audioBitrate: 256

# App name
appName: Cloudron Alltube Download

# Generic formats supported by youtube-dl
genericFormats:
    best: Best
    bestvideo+bestaudio: Remux best video with best audio
    worst: Worst

# Enable debug mode.
debug: false

Please provide the URL of a video that causes the issue.

I tried these: https://www.youtube.com/playlist?list=PLyCLoPd4VxBszBLWgWMpt9kb5sKDXNX6M https://www.youtube.com/playlist?list=PLyCLoPd4VxBuxu3sLztrvWFehzv-LnR2c

Describe your issue

All seems to work fine until I try to extract the zip file and it doesn't extract.

Rudloff commented 4 years ago

Thanks for the report.

This happens when one of the videos fails to download. The ZIP stream is suddenly stopped so the ZIP file is incomplete and can't be extracted. We can't display an error message since the response is already a ZIP file, but maybe we could try to close the ZIP file cleanly (even if it does not contain every video).

jdaviescoates commented 4 years ago

OK, thanks for the info. Do you think it's worth me trying these playlists again? Do we know what causes one of the videos to fail to download?

Rudloff commented 4 years ago

I tried to download https://www.youtube.com/playlist?list=PLyCLoPd4VxBszBLWgWMpt9kb5sKDXNX6M and got this error on one the videos (https://www.youtube.com/watch?v=EXt2jLRlaf8):

YouTube said: Unable to extract video data

But if I try to download this video alone, it works.

So this seems to be a random error but downloading several videos at the same time might increase the chance of it happening.

Rudloff commented 3 years ago

We could try to catch the error and then use Archive::push_error() to include an error message in the archive. That would be better than downloading a corrupted archive.