Coder Social home page Coder Social logo

lastsounds's Introduction

Lastsounds

Scrobble tracks from a BBC Sounds episode to Last.fm via the command line. The application takes a URL for a BBC Sounds episode as an argument and scrobbles the tracks assuming the user finished listening at runtime.

Basic usage -

python sounds_scrobble.py [OPTIONS] [URL]

Note: If Python 3 is not the default on your system you'll need to run python3 ... instead.

By default, lastsounds scrobbles all tracks from the episode. To scrobble only a range of tracks, pass the option --partial or -p when running the command -

python sounds_scrobble.py --partial [URL]

Example output

Dependencies

Lastsounds depends on BeautifulSoup, Click, Requests, Colorama, and pylast.

All dependencies can be installed using pipenv by running pipenv install in the git repository.

Setup

Lastsounds requires an API key & a shared secret that are specific to your account. These can be created here. Only the "Application name" field needs to be filled and the rest can be left blank.

After creating the key and secret, create a copy of details and rename it to .details. Then edit it to add values for your API key, shared secret, and username.

lastsounds's People

Contributors

abers avatar daniel-stoneuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lastsounds's Issues

Scrobble forwards & specify listening times

By default, sounds_scrobble now assumes user is scrobbling after listening to all tracks or a range of tracks - so scrobbles final track for current time and works backwards. Scrobbling forwards will require additional functions - such as a function to calculate total time of all tracks / range and another to specify time started or finished listening. Also, if the user wants to scrobble at the same time as listening to the programme then will need to add waits equal to track-length - with options for pausing or stopping.

Add option and interface for correcting track details

Sometimes BBC Sounds contains incorrect track information, especially the formatting for tracks involving multiple artists. Therefore, need to add an option '--check-tracks' (disabled by default) that will print the full tracklist without scrobbling. The user will then be prompted whether to go ahead with scrobbling or edit the artist and track fields.

Command line arguments

Add command line arguments so users can specify:

  • Programme URL
  • Track start/end/all
  • Calculate length forward/backward

Then rewrite main to only prompt the user if relevant arguments not provided.

BBC Sounds website change

Scrobbling has stopped working as BBC Sounds have changed the way track information is displayed. Will update the class string searches, or replace with alternative way to scrape the track info when I have time.

Error and exception handling

Refactor the code to handle obvious errors and exceptions. For example, if the URL is not valid re-prompt the user for it. Also, exit out of application if users enters blank for any prompt - with "received blank input - exiting" message.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.