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.32k stars 1.6k forks source link

Erorr: TypeError: Song.__init__() got an unexpected keyword argument 'song_list' #1829

Closed graven04 closed 1 year ago

graven04 commented 1 year ago

System OS

Linux

Python Version

3.11 (CPython)

Install Source

pip / PyPi

Install version / commit hash

v4.1.10

Expected Behavior vs Actual Behavior

Expected: syncing actually happening without errors

Actual: got error "TypeError: Song.init() got an unexpected keyword argument 'song_list'"

Steps to reproduce - Ensure to include actual links!

  1. download playlist and make sync file
  2. run: python -m spotdl sync english.sync.spotdl

Traceback

Processing query:                                                                 https://open.spotify.com/playlist/4q3cJO28M2d3lWS4af7rUK?si=85297b78f86d4280      Found 102 songs in english (Playlist)                                             
An error occurred                                                                 ╭────────────────────── Traceback (most recent call last) ───────────────────────╮│ /home/user/.local/lib/python3.11/site-packages/spotdl/console/entry_point.py ││ :124 in console_entry_point                                                    ││                                                                                ││   121 │   try:                                                                 ││   122 │   │   # Pick the operation to perform                                  ││   123 │   │   # based on the name and run it!                                  ││ ❱ 124 │   │   OPERATIONS[arguments.operation](                                 ││   125 │   │   │   query=arguments.query,                                       ││   126 │   │   │   downloader=downloader,                                       ││   127 │   │   )                                                                ││                                                                                ││ /home/user/.local/lib/python3.11/site-packages/spotdl/console/sync.py:100 in ││ sync                                                                           ││                                                                                ││    97 │   │   old_files = []                                                   ││    98 │   │   for entry in sync_data["songs"]:                                 ││    99 │   │   │   file_name = create_file_name(                                ││ ❱ 100 │   │   │   │   Song.from_dict(entry),                                   ││   101 │   │   │   │   downloader.settings["output"],                           ││   102 │   │   │   │   downloader.settings["format"],                           ││   103 │   │   │   │   downloader.settings["restrict"],                         ││                                                                                ││ /home/user/.local/lib/python3.11/site-packages/spotdl/types/song.py:225 in   ││ from_dict                                                                      ││                                                                                ││   222 │   │   """                                                              ││   223 │   │                                                                    ││   224 │   │   # Return product object                                          ││ ❱ 225 │   │   return cls(**data)                                               ││   226 │                                                                        ││   227 │   @classmethod                                                         ││   228 │   def from_missing_data(cls, **kwargs) -> "Song":                      │╰────────────────────────────────────────────────────────────────────────────────╯TypeError: Song.__init__() got an unexpected keyword argument 'song_list'   l

Other details

No response

xnetcat commented 1 year ago

outdated sync file, you have to generate a new one

graven04 commented 1 year ago

generating new sync file gives me this new error:

An error occurred
╭──────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────╮ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/entry_point.py:124 in console_entry_point │ │ │ │ 121 │ try: │ │ 122 │ │ # Pick the operation to perform │ │ 123 │ │ # based on the name and run it! │ │ ❱ 124 │ │ OPERATIONS[arguments.operation]( │ │ 125 │ │ │ query=arguments.query, │ │ 126 │ │ │ downloader=downloader, │ │ 127 │ │ ) │ │ │ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/save.py:80 in save │ │ │ │ 77 │ │ json.dump(save_data, save_file, indent=4, ensure_ascii=False) │ │ 78 │ │ │ 79 │ if m3u_file: │ │ ❱ 80 │ │ gen_m3u_files( │ │ 81 │ │ │ songs, │ │ 82 │ │ │ m3u_file, │ │ 83 │ │ │ downloader.settings["output"], │ │ │ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/utils/m3u.py:76 in gen_m3u_files │ │ │ │ 73 │ # If file_name ends with a slash. Does not have a m3u8 name with extension │ │ 74 │ # at the end of the template, append `{list[0]}`` to it │ │ 75 │ if ( │ │ ❱ 76 │ │ file_name.endswith("/") │ │ 77 │ │ or file_name.endswith(r"\") │ │ 78 │ │ or file_name.endswith("\\") │ │ 79 │ ): │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'bool' object has no attribute 'endswith'

but the sync file is generated when using it to sync i get another error:

An error occurred
╭──────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────╮ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/entry_point.py:124 in console_entry_point │ │ │ │ 121 │ try: │ │ 122 │ │ # Pick the operation to perform │ │ 123 │ │ # based on the name and run it! │ │ ❱ 124 │ │ OPERATIONS[arguments.operation]( │ │ 125 │ │ │ query=arguments.query, │ │ 126 │ │ │ downloader=downloader, │ │ 127 │ │ ) │ │ │ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/sync.py:90 in sync │ │ │ │ 87 │ │ │ sync_data = json.load(sync_file) │ │ 88 │ │ │ │ 89 │ │ # Verify the sync file │ │ ❱ 90 │ │ if sync_data.get("type") != "sync": │ │ 91 │ │ │ raise ValueError("Sync file is not a valid sync file.") │ │ 92 │ │ │ │ 93 │ │ # Parse the query │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'list' object has no attribute 'get'

xnetcat commented 1 year ago

You have to delete the existing sync file first.

graven04 commented 1 year ago

the steps i took:

1) delete existing sync file

2) use command $ spotdl sync https://open.spotify.com/playlist/4q3cJO28M2d3lWS4af7rUK\?si\=1b6c98fb7d784cfb --save-file english.sync.spotdl

3) error:

An error occurred
╭──────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────╮ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/entry_point.py:124 in console_entry_point │ │ │ │ 121 │ try: │ │ 122 │ │ # Pick the operation to perform │ │ 123 │ │ # based on the name and run it! │ │ ❱ 124 │ │ OPERATIONS[arguments.operation]( │ │ 125 │ │ │ query=arguments.query, │ │ 126 │ │ │ downloader=downloader, │ │ 127 │ │ ) │ │ │ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/console/sync.py:72 in sync │ │ │ │ 69 │ │ │ │ 70 │ │ # Create m3u file │ │ 71 │ │ if m3u_file: │ │ ❱ 72 │ │ │ gen_m3u_files( │ │ 73 │ │ │ │ songs_list, │ │ 74 │ │ │ │ m3u_file, │ │ 75 │ │ │ │ downloader.settings["output"], │ │ │ │ /home/rajesh/.local/lib/python3.11/site-packages/spotdl/utils/m3u.py:76 in gen_m3u_files │ │ │ │ 73 │ # If file_name ends with a slash. Does not have a m3u8 name with extension │ │ 74 │ # at the end of the template, append `{list[0]}`` to it │ │ 75 │ if ( │ │ ❱ 76 │ │ file_name.endswith("/") │ │ 77 │ │ or file_name.endswith(r"\") │ │ 78 │ │ or file_name.endswith("\\") │ │ 79 │ ): │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'bool' object has no attribute 'endswith'