Author Topic: How to find Mediaselector ID using Programme ID  (Read 1108 times)

0 Members and 1 Guest are viewing this topic.

Offline Farpoint

  • Newbie
  • *
  • Posts: 13
    • View Profile
How to find Mediaselector ID using Programme ID
« on: November 16, 2014, 01:43:49 PM »
As the Beeb is making progs available for 30 days now, I\'m trying to get some older ones I missed.

We used to be able to get the Mediaselector ID from the source page for the programme but the Beeb have removed that now.

The Beebotron pages with the links on have the Mediaselector IDs so how do you get them?

It\'s like a nightmare game of tennis with the BBC and I\'m losing all the time.

Nigel aka farpoint

Offline Matamore!

  • Hero Member
  • *****
  • Posts: 4,118
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #1 on: November 16, 2014, 03:10:05 PM »
I\'m afraid that everything I have just posted was irrelevant.

Most of it was probably just a description of the process you already use; and you already know that that no longer works for any programmes that are more than 7 days old.

I\'ve found where I posted about the problem before, but I\'m afraid it has no good news to offer, except perhaps for programmes that have been made available indefinitely, i.e. \"over a year\":

October 14, 2014 16:13
October 14, 2014 16:32 (shown out of sequence by Phorum software)
October 14, 2014 16:53
October 14, 2014 18:26
October 15, 2014 22:34

It\'s all so, so, so frustrating! I feel like hibernating.

Offline Matamore!

  • Hero Member
  • *****
  • Posts: 4,118
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #2 on: November 16, 2014, 02:50:49 PM »
[Edit: you may want to skip this entire post, in view of the next one!]

Farpoint Wrote:
-------------------------------------------------------
> It\'s like a nightmare game of tennis with the BBC and I\'m losing all the time.

I know the feeling! I\'ve been using the Internet for about 22 years now, and I\'ve never encountered a single website - let alone one run by a large organisation with a worldwide and decades-long reputation for high standards - that is anything like as infuriatingly and bewilderingly illogical as this one, or has so little information available as to how to use it. It\'s a disgrace.

Anyway, to try to get terminology straight, I\'ll run through the sequence of commands I use to play a WMA stream for a program, printing out all the PIDs and URLs I come across along the way. If we can narrow the focus down to the part of the process you are interested in, I can show how I get the information I need from the website (against its resistance!).
Code: [Select]

(Base) b
(Beeb) la
(LAgn) ffz

+---------------------------------------------+
|                                             |
|  +-----+    +-------+                       |
|  | Key |    | Title |                       |
|  +-----+    +-------+                       |
|                                             |
|  ffz        Stuart Maconie\'s Freakier Zone  |
|                                             |
|                                             |
+---------------------------------------------+

(Prog) i
b00rwkjd
(Prog) u
http: //www.bbc.co.uk/programmes/b00rwkjd
(Prog) la
(Epis) ep_title
The Best of British Prog
(Epis) i
b04pcqw3
(Epis) u
http: //www.bbc.co.uk/programmes/b04pcqw3
(Epis) t
(Tran) f
+-----------------------------------------------------------------+
|                                                                 |
|  :           Back to earlier interaction.                   |
|  browse:         Browse this Web page.                          |
|  cache_path:     Show the local cache path.                     |
|  elements:       Analyse the code of this Web page.             |
|  ep_id:          Print episode PID.                             |
|  ep_title:       Print episode title.                           |
|  flat:           Display \'flat\' command menu.                   |
|  help:           List all available commands.                   |
|  id:             Print transmission PID.                        |
|  mediaselector:  Go to transmission\'s \'mediaselector\' page.     |
|  prog_id:        Print programme PID.                           |
|  prog_title:     Print programme title.                         |
|  refresh:        Refresh the cache.                             |
|  stream:         Go to WMA audio stream for this transmission.  |
|  url:            Display the URL of this resource.              |
|  view:           View the code of this Web page.                |
|                                                                 |
+-----------------------------------------------------------------+
(Tran) i
b04pcqvt
(Tran) u
http: //open.live.bbc.co.uk/mediaselector/4/asx/b04pcqvt/stream-uk-audio_streaming_wma_med_uk
(Tran) m
(MSel) f
+-------------------------------------------------------+
|                                                       |
|  :        Back to earlier interaction.            |
|  browse:      Browse this Web page.                   |
|  cache_path:  Show the local cache path.              |
|  elements:    Analyse the code of this Web page.      |
|  ep_id:       Print episode PID.                      |
|  ep_title:    Print episode title.                    |
|  flat:        Display \'flat\' command menu.            |
|  help:        List all available commands.            |
|  path:        Show path to this page on BBC website.  |
|  prog_id:     Print programme PID.                    |
|  prog_title:  Print programme title.                  |
|  refresh:     Refresh the cache.                      |
|  tran_id:     Print transmission PID.                 |
|  url:         Display the URL of this resource.       |
|  view:        View the code of this Web page.         |
|                                                       |
+-------------------------------------------------------+
(MSel) tran_id
b04pcqvt
(MSel) u
http: //www.bbc.co.uk/mediaselector/4/mtis/stream/b04pcqvt
(MSel)
(Tran) s
(BStr) n
Stuart Maconie\'s Freakier Zone: The Best of British Prog
(BStr) u
mms: //wm-acl.bbc.co.uk/wms/prod_rb2_wm_wma_med/p02b6n5b_b04pcqvt_1416100447549.wma
(BStr)

I imagine that what you call the \'Mediaselector ID\' is what I have been calling the \'transmission PID\' (I think perhaps the BBC calls it a \'version PID\', but I\'m not sure), which in this instance would be b04pcqvt. Is that correct? If so, then the question is how to get the Mediaselector ID from the \'programme\' page for the episode we\'re interested in, which in this case would be:
Code: [Select]

http: //www.bbc.co.uk/programmes/b04pcqw3

Again, is that correct?

Actually, it can\'t be quite correct, as I have just put it, because the page you actually need to get the PID from (in this case) is:
Code: [Select]

http: //www.bbc.co.uk/iplayer/playlist/b04pcqw3

(I keep forgetting this stuff, even though I have been working with it for months!) In the XML(?) code for an \'iplayer/playlist\' page like that, I look for an element like the one below. This was taken from a different example:
Code: [Select]

http: //www.bbc.co.uk/iplayer/playlist/b04kfk2b

The XML(?) element is:
Code: [Select]

   duration=\"1800\"
   identifier=\"b04kfht8\"
   group=\"b04kfk2b\"
   publisher=\"pips\">
   The Now Show: Series 44: Episode 5
   2014-10-10T17:30:00Z
         href=\"http: //www.bbc.co.uk/iplayer/bbc_radio_four\">BBC Radio 4
         href=\"http: //www.bbc.co.uk/iplayer/radio/bbc_radio_four\">Radio 4
   Now Show
   
   


I\'ve highlighted the place I take the Mediaselector ID from.

If I remember right (it\'s all been so confusing and exasperating!), on 14 October the BBC changed the code for a lot of pages, and one of the effects was that Mediaselector IDs could only be obtained by this method for programmes less than 7 days old, even when the programme is available for 4 weeks. Jan pointed out, somewhere, that the WMA stream URLs, if you can find them, are still valid for the whole 4 weeks. I seem to remember posting a thread about finding other streams (than the ones I usually listen to, here in the UK) which can still be found after 7 days, but I won\'t complicate things any further for the moment.

(I don\'t know about you, but I\'m already confused enough!)

Offline Janaru

  • Administrator
  • Hero Member
  • *****
  • Posts: 18,352
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #3 on: November 16, 2014, 08:55:38 PM »
I absolutely agree. I\'ve never seen the like.


I\'ve been wondering about older links, too. I\'ll have a look at this tomorrow, when I have the will to wade through Auntie\'s mess....


It may be worth looking at date pages for the Beebotron....
Note to self:  Use your powers for good, not for evil.....

Offline Farpoint

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #4 on: November 16, 2014, 09:01:21 PM »
Hi Matamore.

Ok,here we go.

The mediator identifier (the ID that we need to create the link to access the programme) used to be on the source page of the programme on the beebs website, but it\'s no longer on those source pages as the beeb has removed it.

Getting the programme ID is easy as it shows up for every programme that you access, and I can use that using  http: //www.bbc.co.uk/iplayer/playlist/b04m4jbw as an example. Now I hadn\'t used that for a while so can\'t remember what the result of that was some months ago, but now it shows programme details but no mediator identifier. You have to view the source for that page to see the mediator identifier as I discovered this afternoon.

As you rightly say, it only shows the mediator identifier for  a seven day period, after that the source page changes somewhat.

The links to programmes do still work for the 4 week period as I have some asf files that I downloaded when I listened to some programmes and they still work. For example, those below.
Anotther case of milton jones--Magician, from 20/10/2014  4extra
Bertolt Brecht-- Mother Courage, from 03/11/2014  4extra
Afternoon play- From 05/11/2014 4fm

So, what I need is to find out how to get the mediator identifier for some programmes on radio 2 that are beyond the seven day time limit now, but within the 30 day limit.

I update the Beebotron pages with the links on every day, whereas I should have saved the pages before updating them, because no doubt the links would still have worked beyond the seven days on the saved pages.

I\'m on dialup in France, and the radio is the only English contact I have on a daily basis. I use Linux and Kaffeine-xine for playing the wma streams, and I don\'t think there\'s any hope of them dealing with the fancy new streams the beeb will be using after the end of the year.

 All the best.

Nigel aka farpoint.

Offline newuser99

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #5 on: December 26, 2014, 09:39:53 PM »
Hello,

For people who are interested in locating a mediaselector for programs that are available for listening from the BBC, This is an example good place to start: \"http://www.bbc.co.uk/radio/programmes/genres/music/player.xml?all\". It is an index of programs in the music genra which are currently available. It contains xml program elements for types= episode, brand, and series. You have do additional steps for brand and series, but for episodes you can navigate to the mediaselector like this.

1. From the program tag in the player link above (from 12/26/2014 - the files are updated frequently), copy the value of the episode pid == b04t0syd



b04t0syd
(Don\'t Fight It) Feel it - The Sam Cooke Story
Marking the 50th anniversary of the death of Sam Cooke, aka the King of Soul.

p02d9h32

1


2. Use the episode pid to look up the program information by plugging it into a program information link. http://www.bbc.co.uk/programmes/b04t0syd.xml and finding the tag. Copy the  value of the tag where canonical = \"1\" == b04t0sy9

b04t0sy9
3420

Original version




...


b04t0sy9
3420

Original version



...

3.   Plug canonical into the mediaselector url  http://www.bbc.co.uk/mediaselector/4/mtis/stream/b04t0sy9

This is what I see in the USA. You can select two different encoding options from the . I have used both. The WMA9 stream can be saved directly to a file, but it is written in real time. The AAC stream has to be processed by a decoding program. I use ffmpeg











4. Copy the href attribute from the connection tag and use it in your favorite listening environment.

http://open.live.bbc.co.uk/mediaselector/4/asx/b04t0sy9/stream-nonuk-audio_streaming_wma_low_nonuk


Happy Programming!

Offline Janaru

  • Administrator
  • Hero Member
  • *****
  • Posts: 18,352
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #6 on: January 14, 2015, 12:08:56 AM »
Thanks for that, Newuser. Hopefully, that will help those who are trying to find a work around. :)
Note to self:  Use your powers for good, not for evil.....

Offline adancy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #7 on: January 27, 2015, 10:18:10 PM »
Just to warn you that it looks like the mediaselector link may be changing in the near future - the new format of link appears to be http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/pc/vpid/ . However this will only return encoded AAC streams - not the legacy Windows Media Audio streams.

Also for anyone using the old iplayer playlist XML links (of the form http://www.bbc.co.uk/iplayer/playlist/) it would appear these have just been turned off as well - if you need to convert a programme ID into a version programme ID (suitable for the mediaselector links above) you now need to go to this page: http://www.bbc.co.uk/programmes/.xml and find the something chunk of code - this will give you the VPID you need.

Hope this helps!

Andrew
(Webmaster, iplayerconverter.co.uk)

Offline Janaru

  • Administrator
  • Hero Member
  • *****
  • Posts: 18,352
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #8 on: February 13, 2015, 03:00:12 PM »
Sorry I\'m so late in saying this, but thanks for that, Andrew. :)  Although I don\'t need this at the moment, I have the distinct feeling I will be needing it in the future.
Note to self:  Use your powers for good, not for evil.....

Offline adancy

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #9 on: February 16, 2015, 06:17:48 PM »
Thanks. I\'ve just updated iplayerconverter.co.uk to show all the AAC data from the new mediaselector pages on the \'convert\' page. Hopefully that will be of use to some people now the BBC have started shutting down the WMA streams (although oddly some shows as recently as yesterday still seem to have WMA data available)

Offline Janaru

  • Administrator
  • Hero Member
  • *****
  • Posts: 18,352
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #10 on: February 17, 2015, 09:00:35 PM »
Thanks a million for that, Andrew. :)-D
Note to self:  Use your powers for good, not for evil.....

Offline Farpoint

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #11 on: February 19, 2015, 05:30:36 PM »
Hi.
I\'m in France, using Linux, and on Dialup.

Do I need Akamai stuff installed on my Linux machine to use he AAC info on your pages?

I tried the rtmpdump section on the command line. rtnpdump said connected, then error, then disconnected from server.

Any tips on using the AAC info?

Nigel. aka farpoint.

Offline Janaru

  • Administrator
  • Hero Member
  • *****
  • Posts: 18,352
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #12 on: February 24, 2015, 11:02:40 PM »
I still haven\'t needed to wade into this, so I\'m of no help, unfortunately. Hopefully, adancy will see your post soon, Nigel.
Note to self:  Use your powers for good, not for evil.....

Offline newuser99

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to find Mediaselector ID using Programme ID
« Reply #13 on: February 28, 2015, 12:29:49 AM »
I can confirm adancy\'s suggestion to use http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/pc/vpid/ for looking up the media selector data required to format a string to record a program, from the USA.  I just finished modifying and testing my application. It works for radio 1-6. I have not tried it on anything else. I am curious how you discovered the url. I used to get them from http://www.bbc.co.uk/radio/aod/availability/.xml but those links are still showing the /4/ version.

The link http://forums.slimdevices.com/showthread.php?72709-Announce-BBCiPlayerExtra-v1-0/page8 contains a statement the the  that the /pc/ can be replaced with /journalism-http-tablet/ to get the HLS stream info. It works, but I don\'t know how to use the information. It does not work in Chrome 39.0.2171.95 (64-bit) or  VLC 2.0.1 (Mac) does not know what to do with it either.

I use an application i wrote in Smalltalk to create a shell script that looks like this:

#!/bin/sh
 /opt/local/bin/rtmpdump -r \"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p02jl7v4_b052hjqb_1424099656057.mp4&et=1425085114&fmta-token=85c25129a7e2d4588bf207c6bfd1bd1d2a9dfa93aa7f4f53a8229470bc7f107d\" -a \"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p02jl7v4_b052hjqb_1424099656057.mp4&et=1425085114&fmta-token=85c25129a7e2d4588bf207c6bfd1bd1d2a9dfa93aa7f4f53a8229470bc7f107d\" -y \"mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p02jl7v4_b052hjqb_1424099656057.mp4\" -o /Volumes/MediaVault/BBC/546704379.flv ; /opt/local/bin/ffmpeg -loglevel quiet  -i /Volumes/MediaVault/BBC/546704379.flv -c copy -copyts /Volumes/MediaVault/BBC/Phonophone.mp4 ; rm /Volumes/MediaVault/BBC/546704379.flv


This is a snippet of the code that produces it:
(connection is a Dictionary that contains the attributes of the connection tag)

dQuote := \'\"\'
defaultDestination =
supplier  := connection at: #supplier.
protocol  := connection at: #protocol.
authExpires   := connection at: #authExpires.
authString  := connection at: #authString.
priority  := connection at: #priority.
server  := connection at: #server.
application  := connection at: #application.
identifier  := connection at: #identifier.
flvFileName := randomString, \'.flv\'.
mp4Filename := fileName.
cmdLine := \'/opt/local/bin/rtmpdump -r \' , dQuote, protocol, \'://\', server, \':1935/\',  application, \'?\', authString, dQuote, \' -a \', dQuote, application, \'?\', authString, dQuote, \' -y \"\', identifier, dQuote,  \' -o \', defaultDestination, flvFileName, \' ; /opt/local/bin/ffmpeg -loglevel quiet  -i \', defaultDestination, flvFileName, \' -c copy -copyts \', defaultDestination, mp4Filename, \' ; rm \', defaultDestination, flvFileName.

I was only able to do this because I saw a command line example somewhere. Note the command line is three separate commands: rtmpdump, ffmpeg, and rm

--jrm