Skip to main content

Build Status Documentation Status

Spotify Scraper

Overview

Python Spotify Web Player Scraper, a fast high-level Spotify Web Player Scraper, to scrape and extract data from Spotify Web Player with the most efficient and fastest methods. instead of using Selenium, I used requests library to increase the speed of scraping. You can set cookies, headers and proxy and download the cover and preview mp3 song of Spotify songs beside the scraping.

Requirements

  • Python 3.6 +
  • Works on Linux, Windows, macOS, BSD
  • Internet connection

Installing

You can install this package as simple as type a command in your CMD or Terminal. The quick way:

$ pip install -U spotifyscraper

or do it in the hard way:

$ git clone https://github.com/AliAkhtari78/SpotifyScraper.git
$sudo python setup.py install

Documentation

Check out Read The Docs for a more in-depth explanation, with examples, troubleshooting issues, and more useful information.

Extract Spotify track information by URL

  • from SpotifyScraper.scraper import Scraper, Request

Import SpotifyScraper to use it

  • request = Request().request()

Create requests using Request which was imported before, You can also pass cookie_file, header and proxy inside Request(). Default is None.

  • print(Scraper(session=request).get_track_url_info(url='https://open.spotify.com/track/7wqpAYuSk84f0JeqCIETRV?si=b35Rzak1RgWvBAnbJteHkA'))

Call get_track_url_info function from Scraper to extract all the infromation from url. If the given URL is valid, it will return a dict with the below keys:

  • title
  • preview_mp3
  • duration
  • artist_name
  • artist_url
  • album_title
  • album_cover_url
  • album_cover_height
  • album_cover_width
  • release_date
  • total_tracks
  • type_
  • ERROR
  • $ { 'title': 'The Future Never Dies', 'preview_mp3': 'https://p.scdn.co/mp3-preview/2d706ceae19cfbc778988df6ad5c60828dbd8389?cid=a46f5c5745a14fbf826186da8da5ecc3', 'duration': '4:3', 'artist_name': 'Scorpions', 'artist_url':'https://open.spotify.com/artist/27T030eWyCQRmDyuvr1kxY', 'album_title': 'Humanity Hour 1', 'album_cover_url':'https://i.scdn.co/image/ab67616d0000b273e14019d431204ff27785e349', 'album_cover_height': 640, 'album_cover_width': 640, 'release_date': '2007-01-01', 'total_tracks': 12, 'type_': 'album', 'ERROR': None}

Extract Spotify playlist information by URL

  • from SpotifyScraper.scraper import Scraper, Request

  • request = Request().request()

  • playlist_info = Scraper(session=request).get_playlist_url_info(url='https://open.spotify.com/playlist/37i9dQZF1DX74DnfGTwugU')

Call get_playlist_url_info function from Scraper to extract all the infromation from url. If the given URL is valid, it will return a dict with the below keys:

  • album_title
  • cover_url
  • author
  • author_url
  • playlist_description
  • tracks_list
  • ERROR

Download Spotify song cover by URL

  • from SpotifyScraper.scraper import Scraper, Request

  • request = Request().request()

  • path = Scraper(session=request).download_cover(url='https://open.spotify.com/track/7wqpAYuSk84f0JeqCIETRV?si=b35Rzak1RgWvBAnbJteHkA')

Call download_cover function from Scraper to download the cover of the provided song.

if the provided URL is valid, it will return the path of downloaded cover to you.

Download Spotify preview song by URL

  • from SpotifyScraper.scraper import Scraper, Request

  • request = Request().request()

  • path = Scraper(session=request).download_preview_mp3(url='https://open.spotify.com/track/7wqpAYuSk84f0JeqCIETRV?si=b35Rzak1RgWvBAnbJteHkA')

Call download_preview_mp3 function from Scraper to download the preview mp3 song of the provided URL.

if the provided URL is valid, it will return the path of downloaded mp3 to you.

Get in touch

  • Report bugs, suggest features, or view the source code on GitHub.
  • Read the doc to use all provided functions of this library.
  • get in touch with me by my website: Ali Akhtari

Metadata

Release files for spotifyscraper 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spotifyscraper 1.0.4
File Size Uploaded
spotifyscraper-1.0.4.tar.gz 9.0 kB Details

Release files / spotifyscraper-1.0.4.tar.gz

Download URL spotifyscraper-1.0.4.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3ca1265a5540ec1b66452e20ea3a509eff1964791052580a6a3a50ca0b187ae0
BLAKE2b-256 checksum
How to use checksums
05e08010e172b64437c02fee734c77ed805a28112ea6008db7757fb192ddbd07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

Release history Release notifications | RSS feed

3.9.2

2 release files

3.9.1

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.20

2 release files

2.0.19

2 release files

2.0.18

2 release files

2.0.15

2 release files

2.0.14

2 release files

2.0.13

2 release files

2.0.12

2 release files

2.0.11

2 release files

2.0.10

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.5

1 release file

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page