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

Bandcamp and Piped downloading not working #2192

Open
kpbhaker opened this issue Sep 22, 2024 · 2 comments
Open

Bandcamp and Piped downloading not working #2192

kpbhaker opened this issue Sep 22, 2024 · 2 comments
Labels
Audio Provider Issue related to audio providers Bug Unexpected problem or unintended behavior that needs to be fixed

Comments

@kpbhaker
Copy link

kpbhaker commented Sep 22, 2024

System OS

Windows

Python Version

3.12.6 (CPython)

Install Source

pip / PyPi

Install version / commit hash

4.2.8

Expected Behavior vs Actual Behavior

I was using the --audio parameter for youtube fallback. I used this parametre python3 -m spotdl download ******** --audio soundcloud bandcamp slider-kz piped youtube-music --overwrite force to download musics and then this happened - Failed to get results from BandCamp

I think there is problem in bandcamp api to download musics. Thank you for listening me. Have a good day devs'....

Steps to reproduce - Ensure to include actual links!

In windows 11 -- python3 -m spotdl download https://open.spotify.com/playlist/5DutDksCDPMirP40odZ0gf?si=ExGfrcOAQO6p52dk5Kv_gw --audio --audio soundcloud bandcamp slider-kz piped youtube-music --overwrite force

Traceback

Failed to get results from BandCamp
╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ C:\Users\cyber\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\P │
│ ython312\site-packages\requests\models.py:974 in json                                                                │
│                                                                                                                      │
│    971 │   │   │   │   │   raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)                                        │
│    972 │   │                                                                                                         │
│    973 │   │   try:                                                                                                  │
│ ❱  974 │   │   │   return complexjson.loads(self.text, **kwargs)                                                     │
│    975 │   │   except JSONDecodeError as e:                                                                          │
│    976 │   │   │   # Catch JSON-related errors and raise as requests.JSONDecodeError                                 │
│    977 │   │   │   # This aliases json.JSONDecodeError and simplejson.JSONDecodeError                                │
│                                                                                                                      │
│ C:\Program                                                                                                           │
│ Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\json\__init__.py:346 in    │
│ loads                                                                                                                │
│                                                                                                                      │
│   343 │   if (cls is None and object_hook is None and                                                                │
│   344 │   │   │   parse_int is None and parse_float is None and                                                      │
│   345 │   │   │   parse_constant is None and object_pairs_hook is None and not kw):                                  │
│ ❱ 346 │   │   return _default_decoder.decode(s)                                                                      │
│   347 │   if cls is None:                                                                                            │
│   348 │   │   cls = JSONDecoder                                                                                      │
│   349 │   if object_hook is not None:                                                                                │
│                                                                                                                      │
│ C:\Program                                                                                                           │
│ Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py:337 in     │
│ decode                                                                                                               │
│                                                                                                                      │
│   334 │   │   containing a JSON document).                                                                           │
│   335 │   │                                                                                                          │
│   336 │   │   """                                                                                                    │
│ ❱ 337 │   │   obj, end = self.raw_decode(s, idx=_w(s, 0).end())                                                      │
│   338 │   │   end = _w(s, end).end()                                                                                 │
│   339 │   │   if end != len(s):                                                                                      │
│   340 │   │   │   raise JSONDecodeError("Extra data", s, end)                                                        │
│                                                                                                                      │
│ C:\Program                                                                                                           │
│ Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1776.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py:355 in     │
│ raw_decode                                                                                                           │
│                                                                                                                      │
│   352 │   │   try:                                                                                                   │
│   353 │   │   │   obj, end = self.scan_once(s, idx)                                                                  │
│   354 │   │   except StopIteration as err:                                                                           │
│ ❱ 355 │   │   │   raise JSONDecodeError("Expecting value", s, err.value) from None                                   │
│   356 │   │   return obj, end                                                                                        │
│   357                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
JSONDecodeError: Expecting value: line 2 column 1 (char 1)

During handling of the above exception, another exception occurred:

╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
│ C:\Users\cyber\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\P │
│ ython312\site-packages\spotdl\providers\audio\bandcamp.py:185 in get_results                                         │
│                                                                                                                      │
│   182 │   │   """                                                                                                    │
│   183 │   │                                                                                                          │
│   184 │   │   try:                                                                                                   │
│ ❱ 185 │   │   │   results = search(search_term)                                                                      │
│   186 │   │   except KeyError:                                                                                       │
│   187 │   │   │   return []                                                                                          │
│   188 │   │   except Exception as exc:                                                                               │
│                                                                                                                      │
│ C:\Users\cyber\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\P │
│ ython312\site-packages\spotdl\providers\audio\bandcamp.py:152 in search                                              │
│                                                                                                                      │
│   149 │   │   proxies=GlobalConfig.get_parameter("proxies"),                                                         │
│   150 │   )                                                                                                          │
│   151 │                                                                                                              │
│ ❱ 152 │   results = response.json()["results"]                                                                       │
│   153 │                                                                                                              │
│   154 │   return_results: List[Tuple[str, str]] = []                                                                 │
│   155                                                                                                                │
│                                                                                                                      │
│ C:\Users\cyber\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\P │
│ ython312\site-packages\requests\models.py:978 in json                                                                │
│                                                                                                                      │
│    975 │   │   except JSONDecodeError as e:                                                                          │
│    976 │   │   │   # Catch JSON-related errors and raise as requests.JSONDecodeError                                 │
│    977 │   │   │   # This aliases json.JSONDecodeError and simplejson.JSONDecodeError                                │
│ ❱  978 │   │   │   raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)                                                │
│    979 │                                                                                                             │
│    980 │   @property                                                                                                 │
│    981 │   def links(self):                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
JSONDecodeError: Expecting value: line 2 column 1 (char 1)

Other details

I am using python3.12.6 and spotdl 4.2.8..

@kpbhaker kpbhaker added the Bug Unexpected problem or unintended behavior that needs to be fixed label Sep 22, 2024
@lauhub
Copy link

lauhub commented Oct 9, 2024

Same problem with piped:

spotdl download  "https://open.spotify.com/playlist/0f6LQiUOikTjACYjYrTGoN?si=96c854276fda41be" --audio piped --log-level DEBUG
[12:11:04] ERROR    asyncio_1 - Traceback (most recent call last):                                  progress_handler.py:358
                      File "requests/models.py", line 974, in json                                                         
                      File "json/__init__.py", line 346, in loads                                                          
                      File "json/decoder.py", line 337, in decode                                                          
                      File "json/decoder.py", line 355, in raw_decode                                                      
                    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)                                
                                                                                                                           
                    During handling of the above exception, another exception occurred:                                    
                                                                                                                           
                    Traceback (most recent call last):                                                                     
                      File "spotdl/download/downloader.py", line 662, in search_and_download                               
                      File "spotdl/download/downloader.py", line 386, in search                                            
                      File "spotdl/providers/audio/base.py", line 174, in search                                           
                      File "spotdl/providers/audio/piped.py", line 121, in get_results                                     
                      File "requests/models.py", line 978, in json                                                         
                    requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)                         
                                                                                                                           
                    ╭───────────────────── Traceback (most recent call last) ─────────────────────╮                        
                    │ in json:974                                                                 │                        
                    │                                                                             │                        
                    │ in loads:346                                                                │                        
                    │                                                                             │                        
                    │ in decode:337                                                               │                        
                    │                                                                             │                        
                    │ in raw_decode:355                                                           │                        
                    ╰─────────────────────────────────────────────────────────────────────────────╯                        
                    JSONDecodeError: Expecting value: line 1 column 1 (char 0)                                             
                                                                                                                           
                    During handling of the above exception, another exception occurred:                                    
                                                                                                                           
                    ╭───────────────────── Traceback (most recent call last) ─────────────────────╮                        
                    │ in search_and_download:662                                                  │                        
                    │                                                                             │                        
                    │ in search:386                                                               │                        
                    │                                                                             │                        
                    │ in search:174                                                               │                        
                    │                                                                             │                        
                    │ in get_results:121                                                          │                        
                    │                                                                             │                        
                    │ in json:978                                                                 │                        
                    ╰─────────────────────────────────────────────────────────────────────────────╯      

@Silverarmor Silverarmor changed the title I think there is problem in bandcamp downloads in SpotDL Bandcamp and Piped downloading not working Jan 18, 2025
@Silverarmor
Copy link
Member

Yes. It appears the way requests are made has broken.
The code is not the best and not commented well either. I will have a look into this in free time, however I think support for bandcamp and piped may be dropped.

There is simply not enough usage by users to warrant the hours required to re-implement these functions

@Silverarmor Silverarmor added the Audio Provider Issue related to audio providers label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Provider Issue related to audio providers Bug Unexpected problem or unintended behavior that needs to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants