Giter Club home page Giter Club logo

nitroradical's Introduction

Nitroradical

Scrape the BBC iPlayer TV listings by category. It displays the programme info for that category as JSON and outputs an RSS feed.

Why?

Because the BBC recently stopped their RSS feeds for iPlayer. They have a replacement API (Nitro), but that's only open to BBC employees right now :(

Install

Install dependencies using pip install -r requirements.txt.

Requires Python 3.7 or greater.

Usage

nitroradical.py <category name>

e.g. nitroradical.py films

Not implemented yet

  • Handling multiple programme episodes. For programmes with multiple episodes, only the programme shown in the category listing is included.
  • Getting detailed programme information.
  • Radio information.
  • Tests!

nitroradical's People

Contributors

stevenmaude avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

nitroradical's Issues

Some iPlayer shows don't have a broadcast date, causes IndexError

Some programmes are missing the "broadcast-event__time beta" class

INFO:sw.ds.helpers:Download http://www.bbc.co.uk/programmes/p0295tgm
INFO:urllib3.connectionpool:Starting new HTTP connection (1): www.bbc.co.uk
Traceback (most recent call last):
  File "./nitroradical.py", line 158, in <module>
    main()
  File "./nitroradical.py", line 148, in main
    items = iterate_through_index(category)
  File "./nitroradical.py", line 106, in iterate_through_index
    items.extend(parse_items_from_page(etree))
  File "./nitroradical.py", line 90, in parse_items_from_page
    for programme in programmes]
  File "./nitroradical.py", line 74, in extract_programme_data
    programme_data['pid'])
  File "./nitroradical.py", line 83, in get_programme_broadcast_date
    '//div[@class="broadcast-event__time beta"]/@title')[0]
IndexError: list index out of range

Output a RSS feed

I'd find it more useful if it had an RSS feed that I can stick up somewhere then access in my browser.

Error in /usr/lib64/codecs.py

I grabbed this and tried it with /usr/bin/python ==> python2. It failed on the "import dshelpers" line, so I decided I was a twit. On python3, I get this:
--bash-5.1$ nitroradical.py films
INFO:root:Downloading page 1
INFO:sw.ds.helpers:Download http://www.bbc.co.uk/iplayer/categories/films/all?sort=atoz&page=1
Traceback (most recent call last):
File "/usr/local/bin/nitroradical.py", line 165, in
main()
File "/usr/local/bin/nitroradical.py", line 156, in main
print(json.dumps(items, indent=4))
File "/usr/lib64/python3.9/codecs.py", line 378, in write
self.stream.write(data)
TypeError: write() argument must be str, not bytes
bash-5.1$

Now, you're importing codecs, so I presume it works for you. Python3 is version 3.9.1. I'm a hardware head, never got too deep in programming. Any ideas?

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.