AliAkhtari78 / SpotifyScraper

Spotify Scraper to extract all the information from spotify, download mp3 with cover of the song
https://spotifyscraper.readthedocs.io/en/latest
MIT License
137 stars 18 forks source link

Only download the information for first 30 songs for a playlist. #1

Closed yuhaian closed 4 years ago

yuhaian commented 4 years ago

Describe the bug get_playlist_url_info() only download first 30 songs (first page?) for a given playlist. My playlist has 192 songs, and this function only downloaded the information for first 30 songs.

To Reproduce Steps to reproduce the behavior:

from SpotifyScraper.scraper import Scraper, Request
request = Request().request()
s = Scraper(session=request)
url='https://open.spotify.com/playlist/37i9dQZF1DXebGqmpCVcEO?si=DWloNa88RcGyoyaxzfb1Lw'
pl = s.get_playlist_url_info(url=url)
print( len(pl['tracks_list']))   
#  The result here is 30 or 31.
  1. Use the same URL on browser, you can see 50 songs
  2. Scroll down you can see all other songs.

Expected behavior Expected all 50 songs in pl variable, not first 30.

Screenshots Not applicable.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context None

AliAkhtari78 commented 4 years ago

@yuhaian Hi. I am very happy you used my library and I appreciate your feedback base on your experience.

Spotify Scraper uses requests to get web pages and it can load as much as tracks received by requests.

In order to load all tracks of each playlist, the page should be scrolled by a web browser so I have to add a selenium based scraper beside of request based scraper.

It isn't a problem! It's an additional feature that I can add as a further capability using selenium beside of request to get web pages.

I will release a new version of the library soon, So you can download and use it.