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.81k stars 1.62k forks source link

Can't download music #1030

Closed IDontKnow218 closed 3 years ago

IDontKnow218 commented 3 years ago

I tried to download some music from Spotify and this error appeared: raceback (most recent call last): File "c:\users\omar\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\omar\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Omar\AppData\Local\Programs\Python\Python39\Scripts\spotdl.exe__main.py", line 7, in File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\spotdl\main.py", line 100, in console_entry_point downloader.download_single_song(song) File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 274, in download_single_song download_song(songObj, self.displayManager, self.downloadTracker) File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 102, in download_song youtubeHandler = YouTube( File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\pytube\main.py", line 103, in init self.descramble() File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\pytube\main__.py", line 123, in descramble self.player_config_args = get_ytplayer_config(self.watch_html)[ File "c:\users\omar\appdata\local\programs\python\python39\lib\site-packages\pytube\extract.py", line 205, in get_ytplayer_config raise RegexMatchError( pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns 0%| |ETA: ?, ~min/song

issue-label-bot[bot] commented 3 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

rickywangca commented 3 years ago

bump, I've been having same issue, reinstalled spotdl with the pip and master versions, both same issue. Also reinstalled youtube-dl, but to no avail

IDontKnow218 commented 3 years ago

bump, I've been having same issue, reinstalled spotdl with the pip and master versions, both same issue. Also reinstalled youtube-dl, but to no avail

So there is no way to fix this?

aklajnert commented 3 years ago

This one should be fixed. Try to run these two commands:

pip install git+https://github.com/spotDL/spotify-downloader.git
pip install git+https://github.com/nficano/pytube.git

You definitely shouldn't have the same error if any.

rickywangca commented 3 years ago

This one should be fixed. Try to run these two commands:

pip install git+https://github.com/spotDL/spotify-downloader.git
pip install git+https://github.com/nficano/pytube.git

You definitely shouldn't have the same error if any.

Still getting issues unfortunately 😥 EDIT: Just did a clean install of python and clean pip install spotdl and it seems fine now, hope this helps others who may be having similar issue

PS C:\Users\ricky> spotdl https://open.spotify.com/playlist/46rcHsSGHHNCczPexxgn6R?si=_1XKzXy3TouXmL1mC75l9Q Fetching Playlist... Traceback (most recent call last): File "C:\Users\ricky\AppData\Local\Programs\Python\Python37-32\Scripts\spotdl-script.py", line 11, in load_entry_point('spotdl==3.1.4', 'console_scripts', 'spotdl')() File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\spotdl__main__.py", line 111, in console_entry_point songObjList = get_playlist_tracks(request) File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\spotdl\search\utils.py", line 76, in get_playlist_tracks playlistResponse = spotifyClient.playlist_tracks(playlistUrl) AttributeError: 'Spotify' object has no attribute 'playlist_tracks' 0%| |ETA: ?, ~min/song

billsioros commented 3 years ago

This one should be fixed. Try to run these two commands:

pip install git+https://github.com/spotDL/spotify-downloader.git
pip install git+https://github.com/nficano/pytube.git

You definitely shouldn't have the same error if any.

Still getting issues unfortunately 😥 EDIT: Just did a clean install of python and clean pip install spotdl and it seems fine now, hope this helps others who may be having similar issue

PS C:\Users\ricky> spotdl https://open.spotify.com/playlist/46rcHsSGHHNCczPexxgn6R?si=_1XKzXy3TouXmL1mC75l9Q Fetching Playlist... Traceback (most recent call last): File "C:\Users\ricky\AppData\Local\Programs\Python\Python37-32\Scripts\spotdl-script.py", line 11, in load_entry_point('spotdl==3.1.4', 'console_scripts', 'spotdl')() File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\spotdlmain.py", line 111, in console_entry_point songObjList = get_playlist_tracks(request) File "c:\users\ricky\appdata\local\programs\python\python37-32\lib\site-packages\spotdl\search\utils.py", line 76, in get_playlist_tracks playlistResponse = spotifyClient.playlist_tracks(playlistUrl) AttributeError: 'Spotify' object has no attribute 'playlist_tracks' 0%| |ETA: ?, ~min/song

try the following

pip uninstall -y pytube pip install --no-cache git+https://github.com/nficano/pytube.git (pytube-10.1.0 not 10.0.0)

Edit: In my case there was an issue only on pytube's side of things and the normally distributed (pip install spotdl) version of spotdl was no showcasing any issues.

IDontKnow218 commented 3 years ago

This one should be fixed. Try to run these two commands:

pip install git+https://github.com/spotDL/spotify-downloader.git
pip install git+https://github.com/nficano/pytube.git

You definitely shouldn't have the same error if any.

Thanks man it fixed my problem!

aklajnert commented 3 years ago

Great, seems like we're good with that one, closing.

dylan-chong commented 3 years ago

Hmm, that hasn't seemed to fix the problem for me (more details in #1106)

> pip3 install git+https://github.com/spotDL/spotify-downloader.git
Collecting git+https://github.com/spotDL/spotify-downloader.git
  Cloning https://github.com/spotDL/spotify-downloader.git to /private/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/pip-req-build-58b0_qp3
Requirement already satisfied: spotipy in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (2.16.1)
Requirement already satisfied: pytube in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (10.4.1)
Requirement already satisfied: tqdm in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (4.54.1)
Requirement already satisfied: rapidfuzz in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (0.14.0)
Requirement already satisfied: requests in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (2.25.0)
Requirement already satisfied: mutagen in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (1.45.1)
Requirement already satisfied: ytmusicapi in /usr/local/lib/python3.9/site-packages (from spotdl==3.2.2) (0.12.2)
Requirement already satisfied: typing-extensions in /usr/local/lib/python3.9/site-packages (from pytube->spotdl==3.2.2) (3.7.4.3)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.9/site-packages (from requests->spotdl==3.2.2) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests->spotdl==3.2.2) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.9/site-packages (from requests->spotdl==3.2.2) (2020.11.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.9/site-packages (from requests->spotdl==3.2.2) (1.25.11)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.9/site-packages (from spotipy->spotdl==3.2.2) (1.15.0)
Building wheels for collected packages: spotdl
  Building wheel for spotdl (setup.py) ... done
  Created wheel for spotdl: filename=spotdl-3.2.2-py3-none-any.whl size=22401 sha256=9cda2353c103b255a498e94f73d818099a73ba228ed076f9b8f35bb27cb6e08e
  Stored in directory: /private/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/pip-ephem-wheel-cache-ti167n65/wheels/11/10/1d/3e2f026106633e1f5da70d379f6ef09ac00bca2cb4b56c674a
Successfully built spotdl
Installing collected packages: spotdl
  Attempting uninstall: spotdl
    Found existing installation: spotdl 3.2.1
    Uninstalling spotdl-3.2.1:
      Successfully uninstalled spotdl-3.2.1
Successfully installed spotdl-3.2.2

Dylan@Dylans-Work-MacBook-Pro:~/Desktop/spotdl-playlist
> pip3 install git+https://github.com/nficano/pytube.git
Collecting git+https://github.com/nficano/pytube.git
  Cloning https://github.com/nficano/pytube.git to /private/var/folders/kx/wsz1xqjj5cncxlwzwh1rh_4c0000gp/T/pip-req-build-h6q7qdi5
Requirement already satisfied: typing_extensions in /usr/local/lib/python3.9/site-packages (from pytube==10.4.1) (3.7.4.3)

Dylan@Dylans-Work-MacBook-Pro:~/Desktop/spotdl-playlist
> spotdl https://open.spotify.com/playlist/7DGsqj2eu89Sstc5XZng5q
Fetching Playlist...
^CTraceback (most recent call last):
  File "/usr/local/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/local/lib/python3.9/site-packages/spotdl/__main__.py", line 110, in console_entry_point
    songObjList = get_playlist_tracks(request)
  File "/usr/local/lib/python3.9/site-packages/spotdl/search/utils.py", line 76, in get_playlist_tracks
    playlistResponse = spotifyClient.playlist_tracks(playlistUrl)
  File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 640, in playlist_tracks
    return self.playlist_items(playlist_id, fields, limit, offset,
  File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 664, in playlist_items
    return self._get(
  File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 291, in _get
    return self._internal_call("GET", url, payload, kwargs)
  File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 221, in _internal_call
    headers = self._auth_headers()
  File "/usr/local/lib/python3.9/site-packages/spotipy/client.py", line 212, in _auth_headers
    token = self.auth_manager.get_access_token(as_dict=False)
  File "/usr/local/lib/python3.9/site-packages/spotipy/oauth2.py", line 186, in get_access_token
    token_info = self._request_access_token()
  File "/usr/local/lib/python3.9/site-packages/spotipy/oauth2.py", line 199, in _request_access_token
    response = self._session.post(
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 532, in request
    settings = self.merge_environment_settings(
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 711, in merge_environment_settings
    env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
  File "/usr/local/lib/python3.9/site-packages/requests/utils.py", line 772, in get_environ_proxies
    if should_bypass_proxies(url, no_proxy=no_proxy):
  File "/usr/local/lib/python3.9/site-packages/requests/utils.py", line 756, in should_bypass_proxies
    bypass = proxy_bypass(parsed.hostname)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 2643, in proxy_bypass
    return proxy_bypass_macosx_sysconf(host)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 2620, in proxy_bypass_macosx_sysconf
    return _proxy_bypass_macosx_sysconf(host, proxy_settings)
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 2588, in _proxy_bypass_macosx_sysconf
    hostIP = socket.gethostbyname(hostonly)
KeyboardInterrupt
Exception ignored in: <function tqdm.__del__ at 0x104547a60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1124, in __del__
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1337, in close
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1516, in display
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1127, in __repr__
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/progressHandlers.py", line 23, in format_dict
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1477, in format_dict
TypeError: cannot unpack non-iterable NoneType object
^C

Dylan@Dylans-Work-MacBook-Pro:~/Desktop/spotdl-playlist
> l
total 544
drwxr-xr-x   5 Dylan  staff   160B 15 Jan 08:04 .
drwx------+ 24 Dylan  staff   768B 15 Jan 08:05 ..
-rw-r--r--   1 Dylan  staff   271K 15 Jan 08:04 Softly, As I Leave You - Remastered.spotdlTrackingFile
drwxr-xr-x   2 Dylan  staff    64B 15 Jan 08:04 Temp
drwxr-xr-x   2 Dylan  staff    64B 15 Jan 08:02 spotdl-playlist

Dylan@Dylans-Work-MacBook-Pro:~/Desktop/spotdl-playlist
> rm *

Dylan@Dylans-Work-MacBook-Pro:~/Desktop/spotdl-playlist
> spotdl https://open.spotify.com/playlist/7DGsqj2eu89Sstc5XZng5q
Fetching Playlist...
Searching for: Bobby Darin - Softly, As I Leave You - Remastered
Searching for: The Manhattan Transfer - I Know Why (And So Do You)
Searching for: Frank Sinatra, Count Basie - The Best Is Yet To Come
Searching for: Benny Goodman - Down South Camp Meetin' - Live
Searching for: Nat King Cole - Sweet Lorraine
Searching for: Coldplay - Swallowed in the Sea
Searching for: Coldplay - Square One
Searching for: Coldplay - Everything's Not Lost - Includes Hidden Track 'Life Is For Living'
Searching for: Coldplay - God Put a Smile upon Your Face
Searching for: Frankie Valli - My Eyes Adored You
Searching for: Paul Anka - Put Your Head On My Shoulder (Remastered)
Searching for: Michael Bublé - Put Your Head on My Shoulder
Searching for: Dianne Reeves, Lou Rawls - Fine Brown Frame
Searching for: Mel Tormé - Don't Get Around Much Anymore
Searching for: Bobby Darin - Hello, Dolly! - 2001 Digital Remaster
Searching for: Jazz Superstars - How High The Moon
Searching for: Jazz Superstars - The Great Lie
Searching for: Jazz Superstars - Buzzy
Searching for: Michael Bublé - Save the Last Dance for Me
Searching for: Harry Connick, Jr. - Save The Last Dance For Me
Searching for: The Drifters - Save the Last Dance for Me
Searching for: Bill Elliott Swing Orchestra - Hep Hop
Searching for: Bill Elliott Swing Orchestra - The Best Things Happen When You're Dancing (Live)
Searching for: Anita Kerr Singers - Welcome to My World
Searching for: Lynn Anderson - You Don't Have to Say You Love Me - Remastered
Searching for: Faye Wong - 曖昧
Searching for: Chiang Yu-Heng - 再回首
Searching for: The Beatles - Hey Jude
Searching for: Stevie Wonder - Superstition - Single Version
Searching for: The Walker Brothers - The Sun Ain't Gonna Shine Anymore
Searching for: Joni Mitchell - Both Sides Now
Searching for: Roberta Flack - The First Time Ever I Saw Your Face
Searching for: Hot Little Mama - Postman
Searching for: Stevie Wonder - I Just Called To Say I Love You
Searching for: Lou Rawls - Scotch & Soda
Searching for: Lou Rawls, Dianne Reeves - At Last
Searching for: Teresa Teng - 一個小心願
Searching for: Teresa Teng - 千言萬語
Searching for: Teresa Teng - 在水一方
Searching for: David Choi - That Girl
Searching for: The Police - Every Breath You Take
Searching for: Dusty Springfield - You Don't Have To Say You Love Me
Searching for: Todd Rhodes - Good Man (05-24-51)
Searching for: Teresa Teng - You Don't Have To Say You Love Me
Searching for: Teresa Teng - My Way
Searching for: Teresa Teng - 心裡夢裏
Searching for: Teresa Teng - 月亮代表我的心
Searching for: Teresa Teng - 再見!我的愛人
Searching for: Teresa Teng - 甜蜜蜜
Searching for: Teresa Teng - Ni Zenme Shoo
Searching for: Teresa Teng - 我只在乎你
Searching for: Julie London - I'm In The Mood For Love
Searching for: Doris Day, The Mellomen - If I Give My Heart to You (with The Mellomen)
Searching for: Count Basie - Blue Skies - 78rpm Version
Searching for: George Gershwin, Zubin Mehta, New York Philharmonic - Love Is Here To Stay
Searching for: Glenn Miller Orchestra - I Know Why
Searching for: Jerry Goldsmith - A New Friend
Searching for: Jerry Goldsmith - A New Ending
Searching for: Jerry Goldsmith - Remus
Searching for: The Ronettes - Baby, I Love You
Searching for: Frankie Valli & The Four Seasons - Stay
Searching for: Sam Cooke - Blue Moon - Mono
Searching for: Gordon Webster - Georgia On My Mind
Searching for: Pentatonix - Hallelujah
Searching for: Doris Day, The Mellomen - Again (with The Mellomen)
  0%|                                                                                                                                                                                                                                                                                                        |ETA: ?, ~min/songTraceback (most recent call last):
  File "/usr/local/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/usr/local/lib/python3.9/site-packages/spotdl/__main__.py", line 112, in console_entry_point
    downloader.download_multiple_songs(songObjList)
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/downloader.py", line 91, in download_multiple_songs
    self._download_asynchronously(songObjList)
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/downloader.py", line 367, in _download_asynchronously
    self.loop.run_until_complete(asyncio.gather(*tasks))
  File "/usr/local/Cellar/python@3.9/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/downloader.py", line 362, in _pool_download
    return await self.download_song(song_obj)
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/downloader.py", line 172, in download_song
    youtubeHandler = YouTube(
  File "/Users/Dylan/Library/Python/3.9/lib/python/site-packages/pytube/__main__.py", line 91, in __init__
    self.prefetch()
  File "/Users/Dylan/Library/Python/3.9/lib/python/site-packages/pytube/__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "/Users/Dylan/Library/Python/3.9/lib/python/site-packages/pytube/extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "/Users/Dylan/Library/Python/3.9/lib/python/site-packages/pytube/extract.py", line 202, in get_ytplayer_config
    raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
Exception ignored in: <function tqdm.__del__ at 0x10e851a60>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1124, in __del__
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1337, in close
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1516, in display
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1127, in __repr__
  File "/usr/local/lib/python3.9/site-packages/spotdl/download/progressHandlers.py", line 23, in format_dict
  File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1477, in format_dict
TypeError: cannot unpack non-iterable NoneType object

EDIT: The following also does not help

pip3 uninstall -y pytube pip3 install --no-cache git+https://github.com/nficano/pytube.git