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

MP3 doesn't get downloaded some times #5

Open
basile-laderchi opened this issue Mar 5, 2019 · 9 comments
Open

MP3 doesn't get downloaded some times #5

basile-laderchi opened this issue Mar 5, 2019 · 9 comments
Assignees
Labels
bug Something isn't working investigating Actively working to find a solution for the issue P1 High priority
Milestone

Comments

@basile-laderchi
Copy link

  • MusicDownloader Version: v1.2.1 (apk downloaded from 1.1.2 after prompt - installed via MiXplorer)
  • Android Version: v6.0
  • Phone vendor / model: Sony Xperia XA

Description

Some times when I try to download an mp3 all I get is an mp3 file with length of some KB.
Upon opening it with a text editor it displays an html page.
I have attached the last failed download: Evening Over Rooftops - The Edgar Broughton Band.zip

Steps to reproduce the issue

Just paste a url and try to download the mp3 file.

The last url I tried to download and did this was: https://youtu.be/U3v0ToMWzZQ

@cioccarellia
Copy link
Owner

Hi :)
I've just finished coding version 1.3.0, that changes a lot how the app works internally.
I've been facing your same issue, and it was really annoying. Sadly, it isn't a MusicDownloader problem, since the server that I'm using for the conversions is returning that page.

Hopefully I applied some hacks to make it work and to me it does, I'll leave the issue open to give you time to test it out.

Thanks :)

@cioccarellia cioccarellia added the bug Something isn't working label Mar 7, 2019
@cioccarellia cioccarellia self-assigned this Mar 7, 2019
@basile-laderchi
Copy link
Author

basile-laderchi commented Mar 7, 2019

Hi,

I downloaded and installed then new version and on the first song I tried to download again the same problem.

One idea I had was maybe you could check the magic number of the file (first few bytes of the file) and if it's wrong delete the one you downloaded and download it again?
According to File Signatures the mp3 can have 3 alternatives.

Or maybe include the FFmpeg Android Java library and download the m4a and convert it locally?

@cioccarellia
Copy link
Owner

Needs further investigation. For now I made a release (1.3.1) with new icons and styles, the next thing on the roadmap is this issue

@cioccarellia cioccarellia added investigating Actively working to find a solution for the issue P1 High priority labels Mar 7, 2019
@cioccarellia
Copy link
Owner

Let me explain you how the downloading module works.
The main downloader, once it receives the watch url from YouTube makes a request to the conversion server, passing to it the link. This server returns a response that can contain downloading information, or an error (Here the source code).
If the file is ready, the response URL is enqueued to the downloads using the Android built-in Download Manager APIs.
If the file is still converting (big files) the request is repeated.
If the request was unsuccessful, an error is shown.

Maybe some further debugging for the app/server/app interactions will produce more detailed information

@cioccarellia
Copy link
Owner

Drafted a new release, check out how it works for you :)

@cioccarellia
Copy link
Owner

Still having this issue with some files, it's really annoying, this needs a deeper dive :/

@basile-laderchi
Copy link
Author

basile-laderchi commented Mar 12, 2019

I still have the same issue as you do.

@cioccarellia cioccarellia added this to the Version 2.0 milestone Apr 15, 2019
@na-stewart
Copy link

@AndreaCioccarelli Could it be possible that some videos cant be downloaded? this seems to be the cast with other apps too that download music from youtube. It could just be due to specific videos being unable to download.

@cioccarellia
Copy link
Owner

Youtube splits videos around different servers and only the internal algorithm has a 100% success rate.
Personally some days it works pretty well and other ones it completely sucks, but it's not an error i can resolve with a couple of lines of code, I need to change the conversion server, and maybe offer a list to choose from. Aka coffee refill on my desk tomorrow morning.

For now, the only workaround I could find is downloading the same file again if a blank song/video is downloaded. MusicDownloader will overwrite it and so no manual cleanup is needed.
Still, I don't think some videos are not available for being downloaded. (Except protected content and videos you can't see even on yt). It's the remote conversion algorithm that was not the best choice.

@cioccarellia cioccarellia pinned this issue May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating Actively working to find a solution for the issue P1 High priority
Projects
None yet
Development

No branches or pull requests

3 participants