Just-Some-Bots / MusicBot

:musical_note: The original MusicBot for Discord (formerly SexualRhinoceros/MusicBot)
https://just-some-bots.github.io/MusicBot/
MIT License
3.13k stars 2.35k forks source link

Bandcamp - !play ALBUM errors #217

Closed MichaelFedora closed 8 years ago

MichaelFedora commented 8 years ago

Singles work, but not entire albums. This exception is after running:

!play http://deepelmdigital.com/album/wide-awake

Future exception was never retrieved
future: <Future finished exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\playlist.py", line 261, in _download
    unmoved_fname = md5sum(unhashed_fname, 8).join('-.').join(unhashed_fname.rsplit('.', 1))
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\playlist.py", line 319, in md5sum
    with open(filename, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'Bandcamp_-album-wide-awake-Wide_Awake.NA'
Failed to get entry.
Traceback (most recent call last):
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\player.py", line 164, in _play
    entry = await self.playlist.get_next_entry()
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\playlist.py", line 168, in get_next_entry
    return await entry.get_ready_future()
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python35-32\lib\asyncio\futures.py", line 358, in __iter__
    yield self  # This tells Task to wait for completion.
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python35-32\lib\asyncio\tasks.py", line 290, in _wakeup
    future.result()
  File "C:\Users\Michael\AppData\Local\Programs\Python\Python35-32\lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\playlist.py", line 261, in _download
    unmoved_fname = md5sum(unhashed_fname, 8).join('-.').join(unhashed_fname.rsplit('.', 1))
  File "C:\Users\Michael\Desktop\MusicBot-1.9.5rc7\musicbot\playlist.py", line 319, in md5sum
    with open(filename, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'Bandcamp_-album-wide-awake-Wide_Awake.NA'

Thanks for your hard work with this bot!

imayhaveborkedit commented 8 years ago

Yep, seems to be a bug with how this one is handled. I'll sort this out soon. Oddly enough, it seems all the tracks are downloaded properly, but the bot doesn't construct the names properly or something weird.

imayhaveborkedit commented 8 years ago

Attempt 3 of explaining this issue: It's a bit weird. That link isn't a proper bandcamp link, http://deepelmrecords.bandcamp.com/album/wide-awake is. However, this link redirects to the link you posted in your browser. Youtube-dl doesn't recognize your link as a bandcamp playlist, so it doesn't work. But when it processes the link, it goes through the redirect and it works. This is an odd situation and I'll have to do some testing, but i'll get this sorted out eventually.

MichaelFedora commented 8 years ago

Whats funny is that the singles like http://deepelmdigital.com/track/glowing-embers do work, even though their not a "bandcamp" link either. Thanks for your help!

imayhaveborkedit commented 8 years ago

I think this is fixed. Reopen if this comes up again and i'll take another look.

MichaelFedora commented 8 years ago

Almost fixed :P

It downloads everything, prepares to play the song, and...

[Command] 125676857545719808/MichaelFedora (!play http://deepelmdigital.com/album/wide-awake)
[Download] Started: http://deepelmdigital.com/album/wide-awake
[Download] Complete: http://deepelmdigital.com/album/wide-awake
audio_cache\Bandcamp_-album-wide-awake-Wide_Awake.NA: No such file or directory

Can't find the *.NA file. Singles and normal bandcamp links do work though.

ed: and no I can't reopen this, @imayhaveborkedit . So I'll just tag you instead :3

imayhaveborkedit commented 8 years ago

I think part of this is how I deal with processing links. Fuck it. I'm writing the soundcloud set async processing function.

imayhaveborkedit commented 8 years ago

I fixed the fucker. https://github.com/SexualRhinoceros/MusicBot/commit/041916f465b6b6a768ba3de3989671918496a98f