Kodi Community Forum

Full Version: "iPlayer WWW" add-on
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Loads more channels

irn|bru found that each Red Button stream has a b version too and they have completely different programs.

I've added them into a beta version in my repo, along with several local channels (for local people, of course). Wink

You can find it in here, until it gets into the main repo.
https://github.com/primaeval/repository....-0.0.1.zip

http://imgur.com/a/irjTc
@primaeval

Thumbs up! The script you had for the red button makes this just about perfect to watch Olympics.
Announcement - new addon - WebGrab+Plus Configurator
http://forum.kodi.tv/showthread.php?tid=285918

Setup your xmltv.xml file with a few clicks.
(2016-08-07, 20:20)PhilipPeake Wrote: [ -> ]Turns out my DNS server address had been (somehow...) set to a non-smart DNS.

Can you please provide more information on this "smart DNS" stuff? I thought the BBC were block non-UK IPs, ergo a VPN was the only solution.
Hi....

I have been trying the Red Button what's on script on a Raspberry PI running OpenElec 6.0.3. It does run and generate a .html file, but no thumbnail images.....it seems ffmpeg is having trouble generating the .png's:

Input #0, hls,applehttp, from 'http://ve-hls-uk-live.edgesuite.net/pool_54/live/uk/sport_stream_24/sport_stream_24.isml/sport_stream_24-pa4%3d128000-video%3d437000.m3u8':
Duration: N/A, start: 22798.131911, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 0
Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 128 kb/s
Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 512x288 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
[NULL @ 0x14eed80] Unable to find a suitable output format for 'sport_stream_24.png'
sport_stream_24.png: Invalid argument

I'm a bit new to this, so perhaps I am making a newbie mistake somewhere along the way.

I'd be grateful for any help in solving this.....

Thanks in advance.


(2016-08-06, 15:50)primaeval Wrote: [ -> ]Red Button what's on script.

The Red Button channels are full of the Olympics at the moment.
Until someone finds a tv guide for them, this is all I can do.

Here is a little python script that captures a frame from each of the 24 red button streams and makes a simple web page of them.
It needs ffmpeg and python. Wink

I have no idea if this can be made into a Kodi addon.

Code:
import re
import requests
from subprocess import call

f = open("index.html","w")
f.write('''<style>
    .img-wrap{
        width: 512; /*just here for the preview */
        position: relative;
        float: left;
        margin: 10;        
    }
        .img-wrap img{
            max-width: 100%;
            z-index: 1
        }
        .img-wrap .caption{
            display: block;
            width: 512;
            position: absolute;
            bottom: 5px; /*if using padding in the caption, match here */
            left: 0;
            z-index: 2;
            margin: 0;
            padding: 5px 0;
            text-indent: 5px;
            color: #fff;
            font-weight: bold;
            background: rgba(0, 0, 0, 0.4);
        }
</style>''')
for channelname in [
    'sport_stream_01',
    'sport_stream_02',
    'sport_stream_03',
    'sport_stream_04',
    'sport_stream_05',
    'sport_stream_06',
    'sport_stream_07',
    'sport_stream_08',
    'sport_stream_09',
    'sport_stream_10',
    'sport_stream_11',
    'sport_stream_12',
    'sport_stream_13',
    'sport_stream_14',
    'sport_stream_15',
    'sport_stream_16',
    'sport_stream_17',
    'sport_stream_18',
    'sport_stream_19',
    'sport_stream_20',
    'sport_stream_21',
    'sport_stream_22',
    'sport_stream_23',
    'sport_stream_24',
    ]:
    url = 'http://a.files.bbci.co.uk/media/live/manifesto/audio_video/%s/hls/uk/%s/%s/%s.m3u8' \
      % ('webcast', 'abr_hdtv', 'ak', channelname)
    r = requests.get(url)
    html = r.content
    for m in re.finditer(r'#EXT-X-STREAM-INF:PROGRAM-ID=(.+?),BANDWIDTH=(.+?),CODECS="(.*?)",RESOLUTION=(.+?)\s*(.+?.m3u8)',html):
        url = m.group(5)
        resolution = m.group(4)
        bitrate = m.group(2)
        call(["ffmpeg", "-y", "-i", url, "-vframes", "1", "%s.png" % (channelname)])
        f.write('''<div class="img-wrap">
                    <img src="%s.png" alt= "">
                    <span class="caption">%s</span>
                    </div>
        ''' % (channelname,channelname))
        break
f.close()
(2016-08-09, 12:20)cacheman Wrote: [ -> ]Hi....

I have been trying the Red Button what's on script on a Raspberry PI running OpenElec 6.0.3. It does run and generate a .html file, but no thumbnail images.....it seems ffmpeg is having trouble generating the .png's:

It might be that OpenElec uses a cutdown version of ffmpeg that doesn't have png output.

Can you try it on a desktop/laptop computer and see if it runs there.
It needs python2.7 and ffmpeg.
I have only tried it on Win7.
(2016-08-09, 12:26)primaeval Wrote: [ -> ]
(2016-08-09, 12:20)cacheman Wrote: [ -> ]I have been trying the Red Button what's on script on a Raspberry PI running OpenElec 6.0.3. It does run and generate a .html file, but no thumbnail images.....it seems ffmpeg is having trouble generating the .png's:

It might be that OpenElec uses a cutdown version of ffmpeg that doesn't have png output.

Yes, that is likely. @cacheman might be worth trying a Krypton build (e.g. a Milhouse LibreELEC build).
PNG is now handled by ffmpeg in kodi.
That means it is more likely that you will be able to use png from ffmpeg from python.
Hi....

Thanks for the super quick reply. I was hoping to avoid using Windoze, but perhaps thats the way I'll have to go.

On another issue, I have noticed that if I try to play something which is listed as 'Live' on www.bbc.com/iplayer, I get a 'iplayer WWW errror' and it says check the log. When I do I see the error below (in this example I was trying to play a live Rio 2016 item). This only seems to happen if I try to play something listed as live.....if I play something not listed as live (and presumably pre-recorded) it works fine.

Would be nice if this worked, but not a show stopper, can still use most of the functions.....just thought you might like to know about this.

If there's anything I can do to fix or test something, happy to help.

Hope this helps.

PHP Code:
12:35:47 8411.064453 T:1510995008   ERROREXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - 
NOTEIGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            
Error Type: <type 'exceptions.IndexError'>
                                            
Error Contents: list index out of range
                                            Traceback 
(most recent call last):
                                              
File "/storage/.kodi/addons/plugin.video.iplayerwww/default.py"line 204in <module>
                                                
Video.AddAvailableStreamItem(nameurliconimagedescription)
                                              
File "/storage/.kodi/addons/plugin.video.iplayerwww/resources/lib/ipwww_video.py"line 799in AddAvailableStreamItem
                                                PlayStream
(namematch[0][2], iconimagedescriptionsubtitles_url)
                                            
IndexError: list index out of range
                                            
-->End of Python script error report<--
12:35:47 8411.676758 T:1967558656   ERRORPlaylist Playerskipping unplayable item0path [plugin://plugin.video.iplayerwww/?url=http%3A%2F%2Fwww.bbc.co.uk%2Fiplayer%2Fepisode%2Fb07nm4g2&mode=202&name=Olympics+-+Day+3+Highlights&icon1 



(2016-08-09, 12:26)primaeval Wrote: [ -> ]
(2016-08-09, 12:20)cacheman Wrote: [ -> ]Hi....

I have been trying the Red Button what's on script on a Raspberry PI running OpenElec 6.0.3. It does run and generate a .html file, but no thumbnail images.....it seems ffmpeg is having trouble generating the .png's:

It might be that OpenElec uses a cutdown version of ffmpeg that doesn't have png output.

Can you try it on a desktop/laptop computer and see if it runs there.
It needs python2.7 and ffmpeg.
I have only tried it on Win7.
(2016-08-09, 13:49)cacheman Wrote: [ -> ]On another issue, I have noticed that if I try to play something which is listed as 'Live' on www.bbc.com/iplayer, I get a 'iplayer WWW errror' and it says check the log. When I do I see the error below (in this example I was trying to play a live Rio 2016 item). This only seems to happen if I try to play something listed as live.....if I play something not listed as live (and presumably pre-recorded) it works fine.

The Olympics Day 3 Highlights stream is definitely an error in the addon:
http://www.bbc.co.uk/iplayer/episode/b07...highlights

That stream doesn't use our normal source for streams, so we don't find them correctly.

Are there many that don't work?
Hi....

Right now on the BBC iPlayer site there is a BBC Collection called Olympics 2016 with 9 live programmes.....this appears in the add-on under 'Highlights -> Collection: Live: Olympics 2016 - 9 available programmes' but the only one of these 9 that works is the one which is not listed as 'Live' and that is Olympic Open Ceremonies. None of the other 8 work....they all fail with the same error in the log file.

Tried the same collection at various times yesterday, but always failed on anything live with the same error.

Also, under Highlights there is 'All Olympics live streams - Don't miss a moment from Rio'....if I select this, a 'Finding episodes....' popup appears, but it never finds any episodes and I'm presented with a blank program listing.....the only entry is '..'.

Hope this helps.

Chris.



(2016-08-09, 14:29)primaeval Wrote: [ -> ]
(2016-08-09, 13:49)cacheman Wrote: [ -> ]On another issue, I have noticed that if I try to play something which is listed as 'Live' on www.bbc.com/iplayer, I get a 'iplayer WWW errror' and it says check the log. When I do I see the error below (in this example I was trying to play a live Rio 2016 item). This only seems to happen if I try to play something listed as live.....if I play something not listed as live (and presumably pre-recorded) it works fine.

The Olympics Day 3 Highlights stream is definitely an error in the addon:
http://www.bbc.co.uk/iplayer/episode/b07...highlights

That stream doesn't use our normal source for streams, so we don't find them correctly.

Are there many that don't work?
(2016-08-09, 14:46)cacheman Wrote: [ -> ]Hi....

Right now on the BBC iPlayer site there is a BBC Collection called Olympics 2016 with 9 live programmes.....this appears in the add-on under 'Highlights -> Collection: Live: Olympics 2016 - 9 available programmes' but the only one of these 9 that works is the one which is not listed as 'Live' and that is Olympic Open Ceremonies. None of the other 8 work....they all fail with the same error in the log file.

Tried the same collection at various times yesterday, but always failed on anything live with the same error.

Also, under Highlights there is 'All Olympics live streams - Don't miss a moment from Rio'....if I select this, a 'Finding episodes....' popup appears, but it never finds any episodes and I'm presented with a blank program listing.....the only entry is '..'.

Hope this helps.

Chris.

I think the Olympics Day 3 Highlights stream was just bad luck. The correct stream seems to be found now.

The Live Olympics links don't work properly because they point to the Red Button streams but we don't parse them properly.

In the meantime you should be able to see those links in the Red Button channels.
You can use my script to get a snapshot of all of them, if you are ok with python.
(2016-08-09, 16:03)primaeval Wrote: [ -> ]
(2016-08-09, 14:46)cacheman Wrote: [ -> ]Hi....

Right now on the BBC iPlayer site there is a BBC Collection called Olympics 2016 with 9 live programmes.....this appears in the add-on under 'Highlights -> Collection: Live: Olympics 2016 - 9 available programmes' but the only one of these 9 that works is the one which is not listed as 'Live' and that is Olympic Open Ceremonies. None of the other 8 work....they all fail with the same error in the log file.

Tried the same collection at various times yesterday, but always failed on anything live with the same error.

Also, under Highlights there is 'All Olympics live streams - Don't miss a moment from Rio'....if I select this, a 'Finding episodes....' popup appears, but it never finds any episodes and I'm presented with a blank program listing.....the only entry is '..'.

Hope this helps.

Chris.

I think the Olympics Day 3 Highlights stream was just bad luck. The correct stream seems to be found now.

The Live Olympics links don't work properly because they point to the Red Button streams but we don't parse them properly.

In the meantime you should be able to see those links in the Red Button channels.
You can use my script to get a snapshot of all of them, if you are ok with python.

Hi....

Thanks for the reply. I got your script to work on Windows, so using that makes the red buttons much easier.

Perhaps it's already in the works, but if somehow the live links could activate the relevant red button channel, it would probably make life a lot easier and your 'Red button whats on' python script wouldn't be needed.

Thanks for your help.
(2016-08-09, 16:11)cacheman Wrote: [ -> ]Perhaps it's already in the works, but if somehow the live links could activate the relevant red button channel, it would probably make life a lot easier and your 'Red button whats on' python script wouldn't be needed.

Thanks for your help.

Here you go. One very raw addon that should show you which stream the live olympic channels are on and let you play it.
BBC Live
plugin.video.bbc.live
in my beta repo:
https://github.com/primaeval/repository....-0.0.1.zip

It might break tomorrow. Be warned.

CaptainT is away so no fixes will get through to the main Kodi repo before the olympics are over. So use this or the official iplayer apps on your favourite device or tv.
Thanks Primaeval! The brand new BBC Live add on works well and fills in the Olympics gap left by that non-functioning "Live Olympic" section in the Highlights area of the iPlayer WWW add on. Thanks to Cacheman as well for bringing this to Primaeval's attention; I'm sure there were many other users like myself who were also experiencing the same issues but didn't speak up.

Does anyone know if there is a method that would allow you preselect the preferred bitrate stream for this BBC Live add on so you could launch the live video right from the sports event list? Right now, you are presented with a list of different streams with varying bitrates (and formats maybe?) to choose from. It still functions, so it's basically a matter of streamlined convenience and speed to facilitate easy quick switching among Olympic live events.

Either way, I just want to express my appreciation to Primaeval and other Devs for these quality addons!


(2016-08-09, 22:39)primaeval Wrote: [ -> ]
(2016-08-09, 16:11)cacheman Wrote: [ -> ]Perhaps it's already in the works, but if somehow the live links could activate the relevant red button channel, it would probably make life a lot easier and your 'Red button whats on' python script wouldn't be needed.

Thanks for your help.

Here you go. One very raw addon that should show you which stream the live olympic channels are on and let you play it.
BBC Live
plugin.video.bbc.live
in my beta repo:
https://github.com/primaeval/repository....-0.0.1.zip

It might break tomorrow. Be warned.

CaptainT is away so no fixes will get through to the main Kodi repo before the olympics are over. So use this or the official iplayer apps on your favourite device or tv.
(2016-08-10, 20:09)thenextman Wrote: [ -> ]Does anyone know if there is a method that would allow you preselect the preferred bitrate stream for this BBC Live add on so you could launch the live video right from the sports event list? Right now, you are presented with a list of different streams with varying bitrates (and formats maybe?) to choose from. It still functions, so it's basically a matter of streamlined convenience and speed to facilitate easy quick switching among Olympic live events.

plugin.video.bbc.live 0.0.3
- olympics bitrate Setting

Here you go. A quick hack to only show one stream with the selected bitrate or offer a choice.

The addon is deliberately ugly as it is only meant to be a debugging and testing tool.

If anyone wants to rip the olympics code out and make it pretty, be my guest.