Custom Data Grabber including Sky UK Channel/EPG Grabber

Discussion in 'General Development (no feature request here!)' started by DJBlu, May 19, 2011.

  1. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
    For What/Why/When and How open the spolier
    Show Spoiler

    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)


    Show 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


     

    Attached Files:

    Last edited by a moderator: September 2, 2016
    • Like Like x 41
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    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.
     

    Attached Files:

    Last edited: March 17, 2014
    • Like Like x 3
  4. CrashUK

    CrashUK Portal Pro

    Joined:
    July 24, 2008
    Messages:
    108
    Likes Received:
    3
    Ratings:
    +6 / 0
    Does the freesat plugin work as well? Now
     
  5. clarkey2r

    clarkey2r Portal Pro

    Joined:
    February 9, 2009
    Messages:
    215
    Likes Received:
    3
    Ratings:
    +3 / 1
    Home Country:
    United Kingdom United Kingdom
    Give it a whirl?
     
  6. DJBlu

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
    This still has the same grab time fault. I will be sorting it later. Its a quick fix so check back later.
     
  7. bob808
    • Premium Supporter

    bob808 MP Donator

    Joined:
    June 14, 2008
    Messages:
    295
    Likes Received:
    16
    Gender:
    Male
    Location:
    Hampshire
    Ratings:
    +17 / 0
    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...
     
  8. icam2

    icam2 Portal Pro

    Joined:
    March 7, 2011
    Messages:
    204
    Likes Received:
    34
    Ratings:
    +35 / 0
    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.

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

    DJBlu Portal Pro

    Joined:
    August 14, 2007
    Messages:
    1,670
    Likes Received:
    789
    Location:
    Llanelli
    Ratings:
    +894 / 1
    Home Country:
    United Kingdom United Kingdom
    Bob808 have you increased the grab time?
     
  10. bob808
    • Premium Supporter

    bob808 MP Donator

    Joined:
    June 14, 2008
    Messages:
    295
    Likes Received:
    16
    Gender:
    Male
    Location:
    Hampshire
    Ratings:
    +17 / 0
    Home Country:
    United Kingdom United Kingdom
    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
     
  11. icam2

    icam2 Portal Pro

    Joined:
    March 7, 2011
    Messages:
    204
    Likes Received:
    34
    Ratings:
    +35 / 0
    Home Country:
    United Kingdom United Kingdom
    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.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!