spotDL / spotify-downloader

Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
https://spotdl.readthedocs.io/en/latest/
MIT License
17.14k stars 1.57k forks source link

Downloading songs from Spotify where the accompanying Youtube video is private crashes SpotDL #1144

Closed DDGo closed 3 years ago

DDGo commented 3 years ago

Environment


Expected Behaviour

I was expecting when SpotDL sees a private video after scraping the data, that it would skip it

Actual Behaviour

SpotDL crashed to the commandline and stopped downloading the Spotify playlist.

Steps to Reproduce

  1. Have a playlist with https://open.spotify.com/track/6c9EGVj5CaOeoKd9ecMW1U in it (haven't tested a standalone download of only this track)
  2. Run spotdl
  3. See it crash, stopping the playlist download if the song was in it.

Traceback

Traceback (most recent call last):
  File "/usr/local/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/local/lib/python3.8/dist-packages/spotdl/__main__.py", line 112, in console_entry_point
    downloader.download_multiple_songs(songObjList)
  File "/usr/local/lib/python3.8/dist-packages/spotdl/download/downloader.py", line 91, in download_multiple_songs
    self._download_asynchronously(songObjList)
  File "/usr/local/lib/python3.8/dist-packages/spotdl/download/downloader.py", line 355, in _download_asynchronously
    self.loop.run_until_complete(asyncio.gather(*tasks))
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/spotdl/download/downloader.py", line 350, in _pool_download
    return await self.download_song(song_obj)
  File "/usr/local/lib/python3.8/dist-packages/spotdl/download/downloader.py", line 172, in download_song
    youtubeHandler = YouTube(
  File "/home/ddg/.local/lib/python3.8/site-packages/pytube/__main__.py", line 104, in __init__
    self.prefetch()
  File "/home/ddg/.local/lib/python3.8/site-packages/pytube/__main__.py", line 203, in prefetch
    self.check_availability()
  File "/home/ddg/.local/lib/python3.8/site-packages/pytube/__main__.py", line 137, in check_availability
    raise VideoPrivate(video_id=self.video_id)
pytube.exceptions.VideoPrivate: p_d6rh2ArNc is a private video

Any other information:

Silverarmor commented 3 years ago

image The song you provided is not available on spotify.?

Silverarmor commented 3 years ago

Resolved on Discord: https://discord.com/channels/771628785447337985/796571887635267614/802314386978897931

Duplicate of #902.