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

HeaderNotFoundError: can't sync to MPEG frame #2267

Open
Gal-ahad opened this issue Dec 23, 2024 · 1 comment
Open

HeaderNotFoundError: can't sync to MPEG frame #2267

Gal-ahad opened this issue Dec 23, 2024 · 1 comment
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed Cannot Reproduce Issues that can't be reproduced by developers

Comments

@Gal-ahad
Copy link

System OS

Windows

Python Version

3.13 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.2.10

Expected Behavior vs Actual Behavior

The intended result was downloading the song (https://open.spotify.com/track/4mx756ehrFAIky4IeJKOUa?si=3e8522577f4f4fe1) to an mp3 format

Instead got an HeaderNotFoundError: can't sync to MPEG frame error even though the song is available to play in my region

Steps to reproduce - Ensure to include actual links!

  1. open command prompt
  2. run the spotdl https://open.spotify.com/track/4mx756ehrFAIky4IeJKOUa?si=3e8522577f4f4fe1 command

this is when i get the error

Traceback

╭──────────────────────────── Traceback (most recent call last)────────────────────────────────────╮
│ in _run_module_as_main:198                                                                       │
│ in _run_code:88                                                                                  │
│                                                                                                  │
│ in <module>:7                                                                                    │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\console\entry_poin │
│ t.py:53 in console_entry_point                                                                   │
│                                                                                                  │
│    52 │   else:                                                                                  │
│ ❱  53 │   │   entry_point()                                                                      │
│    54                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\console\entry_poin │
│ t.py:143 in entry_point                                                                          │
│                                                                                                  │
│   142 │   # for download, load and preload operations                                            │
│ ❱ 143 │   downloader = Downloader(downloader_settings)                                           │
│   144                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\download\downloade │
│ r.py:171 in __init__                                                                             │
│                                                                                                  │
│   170 │   │   │   │                                                                              │
│ ❱ 171 │   │   │   │   found_files = gather_known_songs(self.settings["output"], scan_format)     │
│   172                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\utils\search.py:61 │
│ 2 in gather_known_songs                                                                          │
│                                                                                                  │
│   611 │   │   # Try to get the song from the metadata                                            │
│ ❱ 612 │   │   song = get_song_from_file_metadata(path)                                           │
│   613                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\utils\search.py:58 │
│ 4 in get_song_from_file_metadata                                                                 │
│                                                                                                  │
│   583 │                                                                                          │
│ ❱ 584 │   file_metadata = get_file_metadata(file, id3_separator)                                 │
│   585                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\spotdl\utils\metadata.py: │
│ 419 in get_file_metadata                                                                         │
│                                                                                                  │
│   418 │                                                                                          │
│ ❱ 419 │   audio_file = File(str(path.resolve()))                                                 │
│   420                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_util.py:164 in   │
│ wrapper_func                                                                                     │
│                                                                                                  │
│    163 │   │   │   │   │   │      writable, create) as h:                                        │
│ ❱  164 │   │   │   │   return func(h, *args, **kwargs)                                           │
│    165                                                                                           │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_file.py:302 in   │
│ File                                                                                             │
│                                                                                                  │
│   301 │   │   │   pass                                                                           │
│ ❱ 302 │   │   return Kind(fileobj, filename=filething.filename)                                  │
│   303 │   else:                                                                                  │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_file.py:48 in    │
│ __init__                                                                                         │
│                                                                                                  │
│    47 │   │   else:                                                                              │
│ ❱  48 │   │   │   self.load(*args, **kwargs)                                                     │
│    49                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_util.py:156 in   │
│ wrapper                                                                                          │
│                                                                                                  │
│    155 │   │   │   │   │   │      writable, create) as h:                                        │
│ ❱  156 │   │   │   │   return func(self, h, *args, **kwargs)                                     │
│    157                                                                                           │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\id3\_file.py:420  │
│ in load                                                                                          │
│                                                                                                  │
│   419 │   │                                                                                      │
│ ❱ 420 │   │   self.info = self._Info(fileobj, offset)                                            │
│   421                                                                                            │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\_util.py:185 in   │
│ wrapper                                                                                          │
│                                                                                                  │
│    184 │   │   │   try:                                                                          │
│ ❱  185 │   │   │   │   return func(*args, **kwargs)                                              │
│    186 │   │   │   except exc_dest:                                                              │
│                                                                                                  │
│ C:\Users\USER\AppData\Local\Programs\Python\Python313\Lib\site-packages\mutagen\mp3\__init__.py:4 │
│ 01 in __init__                                                                                   │
│                                                                                                  │
│   400 │   │   if first_frame is None:                                                            │
│ ❱ 401 │   │   │   raise HeaderNotFoundError("can't sync to MPEG frame")                          │
│   402                                                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯


### Other details

_No response_
@Gal-ahad Gal-ahad added the Bug Unexpected problem or unintended behavior that needs to be fixed label Dec 23, 2024
@Silverarmor
Copy link
Member

Cannot recreate.

PS C:\Users\Silver\Music> spotdl https://open.spotify.com/track/4mx756ehrFAIky4IeJKOUa?si=3e8522577f4f4fe1
Processing query: https://open.spotify.com/track/4mx756ehrFAIky4IeJKOUa?si=3e8522577f4f4fe1
Downloaded "Sān-Z - Burning Desires": https://music.youtube.com/watch?v=LCo0KdbVIJM

Please

  • provide a FULL traceback including command invocation and all errors
  • Run with --log-level DEBUG

@Silverarmor Silverarmor added the Cannot Reproduce Issues that can't be reproduced by developers label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed Cannot Reproduce Issues that can't be reproduced by developers
Projects
None yet
Development

No branches or pull requests

2 participants