Skip to main content

Transfer the songs from your old CDs to a Spotify Playlist and list the CDs on eBay

Project description

CD to Spotify and EBay

CDs have become quite antiquated in recent years, and you might still have some lying around the house. Instead of just throwing them out, why not transfer the songs on them to your everyday Spotify playlist so you can hold on to your old songs and memories. You can also make a little money by listing them on eBay.

CD-to-Spotify-and-EBay is a Python utility which interfaces with standard barcode scanners (such as Zebra scanners); users scan the barcodes of many CDs consecutively and the program automatically adds the contents of those CDs to a requested Spotify Playlist and lists the scanned CDs on eBay for the average listing price of the CD.

Spotify Authorization Setup

Go to Spotify Dashboard to Create a Spotify Application of any name.

Go to Settings and set Redirect URI to: http://localhost:8888/callback

Spotify Auth

Create a copy of information.yaml found here (or just edit the file if cloning the repository) and input your Spotify username, your client_id and client_secret from the application you created (gif above shows where this information is), as well as the URI of the playlist you would like to add the contents of the CD to:

# Spotify Authorization Information
spotifyInfo:
    user_id: INSERT_SPOTIFY_USERNAME
    client_id: INSERT_SPOTIFY_CLIENT_ID
    client_secret: INSERT_SPOTIFY_CLIENT_SECRET
    playlist_uri: INSERT_SPOTIFY_PLAYLIST_URI

EBay Authorization Setup

With an eBay Developer account create application keys for a Production Application here.

Connect your developer account to your eBay seller account by retrieving a Production User Token (by clicking on user tokens on application keys page) and signing into your Seller Account.

Insert the eBay appid, certid, devid, token (from application keys you created) and pricemultiplier (percent of average listing price to list item for Example: .85 for 85 percent) into information.yaml:

# EBay Authorization information (See GitHub)
api.ebay.com:
    compatability: 719 #No Need to Change
    appid: INSERT_EBAY_APP_ID
    certid: INSERT_EBAY_CERT_ID
    devid:  INSERT_EBAY_DEV_ID
    token: INSERT_EBAY_TOKEN
    pricemultiplier: INSERT_PRICE_MULTIPLIER

Final Setup

Finally, make sure to fill out the rest of the information in the information.yaml which provides the serial port of the scanner and information for posting the CD on eBay:

otherInfo:
    country: INSERT_COUNTRY #Example: US
    location: INSERT_LOCATION #Example: NY
    site: INSERT_SITE #Example: US
    conditionID: INSERT_CONDITION_ID #See eBay docs
    PayPalEmailAddress: INSERT_PAYPAL_EMAIL
    description: INSERT_EBAY_DESCRIPTION
    currency: INSERT_CURRENCY_TYPE
    com_port: INSERT_COM_PORT

Usage

First pip install the package:

pip3 install CD_to_Spotify_and_EBay

Then use the package in python like this:

from CD_to_Spotify_and_EBay import BarcodeScanner
cd = BarcodeScanner(PATH_TO_INFORMATION.YML)
cd.run()

OR

Clone this repository, connect your barcode scanner, cd into the repository, and run:

pip3 install -r requirements.txt

then

python3 main.py

For both, scan a batch of barcodes back to back and scan the final barcode twice to initiate transfer to Spotify and posting on eBay.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CD_to_Spotify_and_EBay-1.1.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

CD_to_Spotify_and_EBay-1.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file CD_to_Spotify_and_EBay-1.1.1.tar.gz.

File metadata

  • Download URL: CD_to_Spotify_and_EBay-1.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for CD_to_Spotify_and_EBay-1.1.1.tar.gz
Algorithm Hash digest
SHA256 852c42336eb75adc1971ca4b2f8c86fe53832b38afff59903f368260dbf39366
MD5 f442fb48075ea432516d8ffda1872a5b
BLAKE2b-256 ce893fae183454b78b0d641640b8872c0d1643621cc56dcfa1e28e7a8456be28

See more details on using hashes here.

File details

Details for the file CD_to_Spotify_and_EBay-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: CD_to_Spotify_and_EBay-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for CD_to_Spotify_and_EBay-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e58ffdef484a8c0f7f2d1da95f27e46cd525f9d6dca01b01423463a5c2cef74
MD5 7f7962f762edba118fef4081bc094924
BLAKE2b-256 612313574edd809dadf35202dd6042cd79810efa9b396a50a22490a7c930e8b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page