Page 1 of 1

BBC iPlayer (UK only)

PostPosted: Thu Sep 22, 2011 7:59 pm
by zip
iPlayer plugin (requires Serviio 1.6.1 and newer)

This is a plugin that enables to watch iPlayer content using the following URL structures:

Categories
  Code:
http://www.bbc.co.uk/iplayer/categories/documentaries/highlights
http://www.bbc.co.uk/iplayer/categories/documentaries-history/highlights


Groups / collections
  Code:
http://www.bbc.co.uk/iplayer/group/b06z98k4
http://www.bbc.co.uk/iplayer/group/p02j4np8


Episodes (id comes from the programme URL)
  Code:
http://www.bbc.co.uk/iplayer/episodes/b006m86d



Added 22/9/2011
Updated for 0.6.1 5/1/2012
Updated 14/12/2012 (thanks to pineson)
Updated 9/6/2013
Updated 30/3/2016
Updated 29/06/2016

Re: BBC iPlayer (UK only)

PostPosted: Wed Mar 30, 2016 8:07 pm
by zip
Updated the plugin

Re: BBC iPlayer (UK only)

PostPosted: Tue May 31, 2016 4:45 am
by markstuartwalker
Thank you this plugin - it works great for the episodes that I want but I am struggling to get the categories function to work.

http://www.bbc.co.uk/iplayer/categories ... highlights
http://www.bbc.co.uk/iplayer/categories ... highlights

Have the BBC moved things around and broken things?

Re: BBC iPlayer (UK only)

PostPosted: Fri Jun 03, 2016 7:04 am
by markstuartwalker
I have looked at the Groovy code and can trace that there is a function to handle categories but I cannot get the logging to work to diagnose any further.

This is likely to be a novice problem. Can anyone help me with this?

Re: BBC iPlayer (UK only)

PostPosted: Sun Jun 12, 2016 9:11 pm
by Xmantium
Episodes work fine, cant get categories to work.

Re: BBC iPlayer (UK only)

PostPosted: Mon Jun 13, 2016 7:31 am
by markstuartwalker
Agreed. Same as my problem.

Re: BBC iPlayer (UK only)

PostPosted: Tue Jun 21, 2016 1:14 pm
by zip
What URL are you using for categories?

Re: BBC iPlayer (UK only)

PostPosted: Tue Jun 28, 2016 1:55 pm
by markstuartwalker
See my post above

http://www.bbc.co.uk/iplayer/categories ... highlights

Doesn't retrieve anything for me

Re: BBC iPlayer (UK only)

PostPosted: Tue Jun 28, 2016 9:06 pm
by zip
Try this URL (instead of the grid, it's the a-z link on top right)

http://www.bbc.co.uk/iplayer/categories ... ?sort=atoz

Re: BBC iPlayer (UK only)

PostPosted: Wed Jun 29, 2016 7:06 am
by markstuartwalker
Excellent! That fixed that example.

But the one that I was really trying to access was

http://www.bbc.co.uk/iplayer/categories ... ?sort=atoz

And that must be different in some way as I get nothing.

I finally worked out how to look at the logging and realised that an exception was being raised when converting the release date. The BBC were being a little lazy in just putting in '1958' instead of '14 Feb 1958' and this was breaking the SimpleDateFormat parsing.

def releasedMatcher = li =~ '(?ms)<span class="release">.*?First shown:\\s*(.*?)\\n.*?</span>'
if(releasedMatcher) {
String releaseDateString = releasedMatcher[0][1]
releaseDate = new SimpleDateFormat('dd MMM yyyy').parse(releaseDateString)
}

I bodged in a fixed date and this solved the problem (except of course they all now show the same date). I'll let the author fix this more elegantly.

def releasedMatcher = li =~ '(?ms)<span class="release">.*?First shown:\\s*(.*?)\\n.*?</span>'
if(releasedMatcher) {
String releaseDateString = releasedMatcher[0][1]
releaseDateString = '1 Jan 1958'
releaseDate = new SimpleDateFormat('dd MMM yyyy').parse(releaseDateString)
}

Re: BBC iPlayer (UK only)

PostPosted: Wed Jun 29, 2016 10:54 am
by markstuartwalker
Finally, the adoption of all?sort=atoz introduced a fault on the pagination mechanism. I had to add the third line here to suppress an '&amp;' in the URL.

pageBaseUrl = lastPageMatcher[0][1]
totalPages = lastPageMatcher[0][2].toInteger()
pageBaseUrl = pageBaseUrl.replace('amp;','')

Re: BBC iPlayer (UK only)

PostPosted: Wed Jun 29, 2016 7:23 pm
by zip
I've fixed the first bit, cannot reproduce the error with pagination - works for me. Updated the plugin in the top post.

Re: BBC iPlayer (UK only)

PostPosted: Thu Jun 30, 2016 1:10 pm
by markstuartwalker
Thank you. I have confirmed that date is fixed. You might like to consider modifying other parts of the code where the same date parsing is done.

Try http://www.bbc.co.uk/iplayer/categories ... ?sort=atoz

And observe the first page collecting alphabetically (approximately A-G) and then collecting the first page again rather than page 2.

Enhancing the logging to log("Loading page " +'http://www.bbc.co.uk' + pageBaseUrl + page)
shows the incorrect URL being used.
http://www.bbc.co.uk/iplayer/categories ... amp;page=2
when it should be
http://www.bbc.co.uk/iplayer/categories ... toz&page=2

I suspect that you somehow aren't using the sort=atoz parameter to force the screen to a simple list.

Re: BBC iPlayer (UK only)

PostPosted: Thu Jun 30, 2016 7:10 pm
by zip
Thanks, updated

Re: BBC iPlayer (UK only)

PostPosted: Fri Jul 01, 2016 11:41 am
by markstuartwalker
Fixed! Thank you.

Re: BBC iPlayer (UK only)

PostPosted: Tue Oct 04, 2016 4:58 pm
by JamezG
Hi, As I am now unable to get BBC Iplayer on my Sony Bravia TV (KDL-40EX703), I am trying Serviio ( Prov1.7) to provide access but I am encountering a few problems and I therefore need some help. I have followed the instructions in your posts thank you very much (downloaded the .groovy files, Inserted the URLs as written as a web resource) but:
1. The Episodes elements (including trying the Eastenders Example as written) does not show any episodes. My TV shows the online Display Name in the 'Online' folder but when I select that folder I get ' There are no items to display'
2. The Categories elaments work to a degree but I only get the the first page of files (as shown on the PC iplayer page) displayed on my TV. I have been using the '/all?sort=atoz' parameter at the end of the url but I do not have any item on the screen to select further pages

PS why can I not paste URLs in to the Serviio Console librarys?

Re: BBC iPlayer (UK only)

PostPosted: Tue Dec 10, 2019 10:01 pm
by kdp99
Anyone give me a bit of help, I am almost there but not quite with this my first use of a plugin.
I have put the plugin in the plugins folder, then in the consul I have gone to the library then online sources. From there I have said
web resource, and videos,
and in source URL

http://www.bbc.co.uk/iplayer/categories ... highlights
under presentation for video I have for online display category.

When I go to serviio under video I have an online section, but when I chose it there is no content there.
I am sure I am not quite understanding the process correctly, can some one spot my errors ?

Many thanks.

I have done a few changes but still no joy,

I changed the type to live stream and used the URL below


http://www.bbc.co.uk/iplayer/categories ... ?sort=atoz

When I check the URL I get
The stream URL is not valid or is not currently available

Re: BBC iPlayer (UK only)

PostPosted: Thu Dec 12, 2019 6:25 pm
by kdp99
Bump !