This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A Python script that downloads radio tracklistings from BBC’s website and tags MP3 or M4A audio files or outputs to a text file. Licensed under GPL v3 (see COPYING).

Usage examples

Run bbc_tracklist.py from the command line.

Required arguments are an action: one of tag, text or both and a BBC programme id, the 8 characters that are found at the end of iPlayer URLs such as:http://www.bbc.co.uk/iplayer/episode/<programme id>/<programme name> or programme information URLs such as: http://www.bbc.co.uk/programmes/<programme id>, e.g. b03d0wk8

text will save the tracklisting to a text file, tag will tag an audio file and (unsurprisingly) both will perform both of these actions.

Optional arguments are --directory DIRECTORY and --fileprefix FILEPREFIX. The --fileprefix is the filename prefix: e.g. for some_bbc_audio.mp3, the filename prefix is some_bbc_audio.

If either of these are omitted, output will be to the current path. If no filename is specified, any audio file you want tagging should be named as the pid. Any text file generated without a filename will be called pid.txt.

First, if tag or both actions are chosen, the script tries to tag an M4A file, then an MP3. If it fails to find (or write to) an appropriate audio file, it falls back to creating a text file.

The script generates an output formatted as:

Programme title
Programme first broadcast date

Artist
Title
Record label

***

get_iplayer usage

If downloading a radio programme with get_iplayer, adding an argument of the form --command "python /home/scripts/bbc_tracklist.py action <pid> --directory <dir> --fileprefix <fileprefix>" should result in a text file containing the tracklisting in the same directory as your downloaded audio file where action is text, tag or both.

(Change /home/scripts to point to wherever the script is located.)

In Windows, you may need to quote the placeholders (presumably if there are spaces in them; thanks JackDandy) bbc_tracklist.py <pid> "<dir>" "<fileprefix>"

Installation requirements

  • Tested on Python 2.7.3 on Windows (Windows 7 64-bit) and Linux (Raspbian and Ubuntu 12.04). (I suspect it doesn’t work with Python versions earlier than this due to improvements in Python’s HTMLParser introduced in 2.7.3.)
  • Not compatible with Python 3.4 as yet. This code shouldn’t be hard to port, but beets is not yet Python 3 compatible.
  • Requires beets, requests and lxml.

Install module directly

pip install bbc-radio-tracklisting-downloader should install the module and its dependencies. However, lxml may be an issue if you’re on Windows (see below); make sure that’s installed first.

bbc_tracklist should be available as a command. (Tested on Linux only.)

Installing by hand

pip install -r requirements.txt may work for you on Linux.

If you’re on Windows and have pip installed, pip install beets requests should work. lxml requires compiling, so the easiest way is to install it is by downloading the latest installer version for Python 2.7 from PyPI.

Even on Linux, compiling lxml may require more build dependencies. See this discussion for details. Otherwise, there may be a version of lxml in your distribution’s package manager (e.g. python-lxml).

You can then grab a copy of the Python scripts from here or git clone the repository.

Known issue (don’t think there’s an easy fix)

  • Printing tracklisting in Windows doesn’t play nicely with non-ASCII characters; these are ignored. (Printing occurs if directory and fileprefix are invalid.) You can try running cmd /u in a command prompt if you find this an issue (not tested).
Release History

Release History

0.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bbc_radio_tracklisting_downloader-0.0.2-py2-none-any.whl (7.1 kB) Copy SHA256 Checksum SHA256 py2 Wheel May 14, 2016
bbc-radio-tracklisting-downloader-0.0.2.tar.gz (7.5 kB) Copy SHA256 Checksum SHA256 Source May 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting