Custom Data Grabber including Sky UK Channel/EPG Grabber (4 Viewers)

DJBlu

Portal Pro
August 14, 2007
1,670
813
Llanelli
Home Country
United Kingdom United Kingdom
For What/Why/When and How open the spolier
What is this?

This is a patch and plugin I have created for Media Portal TV Server which allows you to create a plugin that can request raw data from the TV Server.

Why did I write this?

Simple, the code changes required for the TSWriter and TVLibrary to include new features was becoming really difficult. I thought to myself what is required? And my answer was a Pid Filter system.

How does it work?

At the moment any plugin that you write will need a TV/Radio channel that is created and stored in the Database. The Custom Data Grabber is then able to timeshift this channel whilst grabbing RAW section data from the TSWriter. All you need to do is tell the Custom Data Grabber which channel, what pids and for how long? It is then up to you as to what you do with this section data.

I want to write a plugin what do I do?

Download the SVN files and Custom Data Grabber down below. Install them over the top of a MediaPortal 1.2.0 beta installation. Copy the Custom Data Grabber.dll to the TV Server directory. Start your project as you would normally do in C# or Vb.net. Add a reference to the Custom Data Grabber.dll Create a new instance of the Custom Data Grabber.

Public CustomDataGrabber as CustomDataGrabber = new CustomDataGrabber()
You now need to add handlers for OnPacket and OnComplete to your subroutines Raised everytime a new Data Section Arrives.
Public Sub OnTSPacket(ByVal Pid As Integer, ByVal Length As Integer, ByVal Data As Section) Handles CustomDataGrabber.OnPacket
'Your Code
End Sub
Raised when the Custom Data Grabber has finished

Sub OnComplete(ByVal err As Boolean, ByVal errormessage As String) Handles CustomDataGrabber.OnComplete

'Your Code

End Sub
To start the Grab Create a channel for the grabber to use or get the channel from the TV Database. Create a List of Pids to send

Dim DataBaseChannel as Channel = _layer.GetChannelbyName("Sample Channel")
Dim Pids as List(of integer) = new List(of Integer)
Dim Seconds as Integer = 60
Pids.Add(&H10) ' Nit
Pids.Add(&H11) ' SDT/BAT

CustomDataGrabber.grab(DatabaseChannel.ChannelId, SecondsToGrab, Pids)
CustomDataGrabber.SendComplete(ErrorCode)
ErrorCode of 0 means no errors and the OnComplete event will be raised ErrorCode of 1 means an error occured and the OnComplete event will NOT be raised

Try
'Code
CustomDataGrabber.SendComplete(0)
Catch
CustomDataGrabber.SendComplete(1)
End Try​

What are the posibilities with this?

Many, I have already created 2 plugins which are below to show what is capable. EPG systems, Channel Scanning and updating. Interactive Services.

The major advantage over this is if it was implemented into TV Server then you only change 1 plugin file instead of changing several in the core of the TVServer.

I know this is a long guide but if you give it a try you will see the concept is rather simple and it opens the TVServer to new and exciting features.
PLEASE DOWNLOAD AND READ THE INSTALL INSTRUCTIONS ON POST #2.
If you find it is not working, Delete your database and run the Installer again.

Install the following in order.

Media Portal 1.3.0 Alpha
  • MediaPortal SVN Installer with Series Link - Click Here
  • TvServer SVN Installer with patch - Click Here
Media Portal 1.3.0 RC
  • MediaPortal SVN Installer with Series Link - Click Here
  • TvServer SVN Installer with patch - Click Here

Media Portal 1.3.0 Final
  • MediaPortal SVN Installer with Series Link - Click Here
  • TvServer SVN Installer with patch - Click Here
Media Portal 1.4.0 Final
  • MediaPortal SVN Installer with Series Link - Click Here
  • TvServer SVN Installer with patch - Click Here
Mediaportal 1.5.0 Final
  • MediaPortal SVN Installer with Series Link - Click Here
  • TvServer SVN Installer with patch - Click Here
Mediaportal 1.6.0 Final
Mediaportal 1.15.0 Final (added by @Brownard)

The following is necessary for all installations and must be placed in the TV Server directory.
The following are used as required

For 1.3.0 Beta and onwards
For 1.3.0 Alpha and earlier
ChangeLog (Open Spoiler)


Sky NZ Plugin 1.4.0.6

Fixed: Default Grabber channel settings.

Sky UK Plugin 1.4.0.6

Added: New settings method to reduce calls to database.
Added: New throttling method to reduce stuttering on slower systems.

Sky UK plugin 1.4.0.5

Fixed: Update every x hours settings fixed.

Sky UK Plugin - 1.4.0.4

Added: Logos are centred.

Sky UK Plugin - 1.4.0.3

Fixed : Logo name issue
Added : Throttler to prevent CPU starvation

Sky UK Plugin - 1.4.0.2

Fixed: Channel.Persist error(s)
Re-added Logo downloader

Sky IT Plugin - 1.4.0.1

Re-released with mods from other plugins and updated to TVServer 1.4.0

Sky NZ Plugin - 1.4.0.4

Fixed Bouquet ID and Network ID error
 

Attachments

  • Custom Data Grabber Plugin_Source_Code.zip
    14.8 KB
  • Custom Data Grabberv1.0.0.3.zip
    7.2 KB
  • Freesat Channel and EPG Scannerv1.2.0.2.zip
    52.8 KB
  • Foxtel Australia Channel and EPG Grabberv1.2.0.2.zip
    51.4 KB
  • Sky IT Channel and EPG Grabberv1.2.0.5.zip
    52.8 KB
  • Sky UK Channel and EPG Grabberv1.2.0.36.zip
    52 KB
  • Sky IT Channel and EPG Grabber1.4.0.1.zip
    50.5 KB
  • Sky UK Channel and EPG Grabberv1.4.0.2.zip
    55.7 KB
  • Sky UK Channel and EPG Grabberv1.4.0.3.zip
    55.3 KB
  • Sky UK Channel and EPG Grabberv1.4.0.4.zip
    56 KB
  • Sky UK Channel and EPG Grabberv1.4.0.6.zip
    57.4 KB
  • Sky NZ Channel and EPG Grabberv1.4.0.5.zip
    51 KB
Last edited by a moderator:

DJBlu

Portal Pro
August 14, 2007
1,670
813
Llanelli
Home Country
United Kingdom United Kingdom
Sky UK Channel and EPG Grabber Instructions
Below

Freesat Channel Grabber
Coming Soon, Similar to the Sky UK so you can take a read of those until then.

Plan of Action

1. Series Link - Added
2. Sky Italy Plugin - Added
3. Foxtel Australia Plugin - Added
4. Freesat EPG and series link into Scanner - Channel Scanner working, EPG to come[WIP]
5. EIT Scanner Plugin, series link where available(freeview)
5. Sky New Zealand Plugin. Added
6. Scan() method into Custom Data Grabber, instead of having to tune to a channel.
7. MHW1/MHW2 guide plugin.
8. NagraGuide Plugin.
9. MHEG5/Red Button, will need help with the MediaPortal and the Overlay, volunteers to my PM please :D
10. Irradicate need for Custom Data Grabber plugin by adding code to TVServer.

If you have a request then please ask in the forum and I'll see what I can do. Any bugs no matter how small please let me know. Thanks.
 

Attachments

  • Sky UK Channel and EPG Grabber Instructions.zip
    176.6 KB
  • Sky UK EPG and Channel Grabber Source.zip
    2.1 MB
Last edited:

bob808

MP Donator
  • Premium Supporter
  • June 14, 2008
    295
    32
    Hampshire
    Home Country
    United Kingdom United Kingdom
    Thanks djblu seems to work great again here. Assuming this holds up for everyone will series link be added shortly?

    Edit1: Hmm might have spoken too soon... Trying it card by card and on the hauppague hd-s2 it doesn't add all channels... Says 88 transponders found then adds anywhere between 300 and 500 channels out of 966 and seems to be a different number each time...

    Will complete the test on my 2 tbs cards and let you know what they do.

    Thanks

    Bob

    Edit 2: Same happening on my tbs cards... Different number of channels created each time it runs but always around the 400 Mark despite the counter showing xxx/966 on each grab attempt the number never counts up to 966 logs added


    Edit 3: Desite ticking the tbs cards and retrying, the manual control shows it is the haupague card that is still doing the grabbing... will try again and restart the tv service between grabs...
     

    icam2

    Portal Pro
    March 7, 2011
    204
    68
    Home Country
    United Kingdom United Kingdom
    Just given it a good run. No bugs left from what i can see DJBlu (apart from the small cosmetic channel groups default order eg "music" being to far down by default nothing a manual change cant fix its not even worth noting as a bug). I'll monitor the plugin all day mate and if i spot anything i'll let you know. Cheers

    Way faster the than the old versions mate like it.

    Thanks djblu seems to work great again here. Assuming this holds up for everyone will series link be added shortly?

    Hmm might have spoken too soon... Trying it card by card and on the hauppague hd-s2 it doesn't add all channels... Says 88 transponders found then adds anywhere between 300 and 500 channels out of 966 and seems to be a different number each time...

    Will complete the test on my 2 tbs cards and let you know what they do.

    Thanks

    Bob

    Same happening on my tbs cards... Different number of channels created each time it runs but always around the 400 Mark despite the counter showing xxx/966 on each grab attempt the number never counts up to 966

    I had the same problem bob808. i fixed mine by dropping my settings restarting the pc and rescanning. working fine now
     

    bob808

    MP Donator
  • Premium Supporter
  • June 14, 2008
    295
    32
    Hampshire
    Home Country
    United Kingdom United Kingdom
    Bob808 have you increased the grab time?

    I tried it at 60 and 120 but no difference on the hauppague card... have just reset the database and the tbs cards work perfect - will do the same again and try the hauppague again..

    Edit 1: ok, seems to work with hauppague now... will try with all 4 tuners enabled...

    Edit 2: aargh - the haupague card adds channels and epg, but gives a no signal error when tuning to any of them!

    Edit 3: Working perfect with my TBS 6981 and 8920 tuners - but not on my haup hd-s2 card
     

    icam2

    Portal Pro
    March 7, 2011
    204
    68
    Home Country
    United Kingdom United Kingdom
    Bob808 have you increased the grab time?

    I tried it at 60 and 120 but no difference on the hauppague card... have just reset the database and the tbs cards work perfect - will do the same again and try the hauppague again..

    Edit 1: ok, seems to work with hauppague now... will try with all 4 tuners enabled...

    Edit 2: aargh - the haupague card adds channels and epg, but gives a no signal error when tuning to any of them!

    Edit 3: Working perfect with my TBS 6981 and 8920 tuners - but not on my haup hd-s2 card

    Sounds Like the haupague is locking up after the first scan. Do you have it setup to preload? i used to have problems with an old card doing that. 8920 are the best ones i've ever had.
     

    Users who are viewing this thread

    Top Bottom