Example #1
0
#!/usr/bin/python
# epgdat.py  by Ambrosa http://www.dreamboxonline.com
# Heavily modified by MiLo http://www.sat4all.com/
# Lots of stuff removed that i did not need.

import os
import sys
import codecs
import struct
from datetime import datetime

try:
    import dreamcrc
    crc32_dreambox = lambda d,t: dreamcrc.crc32(d,t) & 0xffffffff
    print "[EPGImport] using C module, yay"
except:
    print "[EPGImport] failed to load C implementation, sorry"

    # this table is used by CRC32 routine below (used by Dreambox for
    # computing REF DESC value).
    # The original DM routine is a modified CRC32 standard routine,
    # so cannot use Python standard binascii.crc32()
    CRCTABLE=(
            0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9,
            0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
            0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
            0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
            0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9,
            0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
            0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011,
            0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
Example #2
0
#!/usr/bin/python
# epgdat.py  by Ambrosa http://www.dreamboxonline.com
# Heavily modified by MiLo http://www.sat4all.com/
# Lots of stuff removed that i did not need.

import os
import sys
import codecs
import struct
from datetime import datetime

try:
    import dreamcrc
    crc32_dreambox = lambda d, t: dreamcrc.crc32(d, t) & 0xffffffff
    print "[EPGImport] using C module, yay"
except:
    print "[EPGImport] failed to load C implementation, sorry"

    # this table is used by CRC32 routine below (used by Dreambox for
    # computing REF DESC value).
    # The original DM routine is a modified CRC32 standard routine,
    # so cannot use Python standard binascii.crc32()
    CRCTABLE = (
        0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
        0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
        0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, 0x4C11DB70, 0x48D0C6C7,
        0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
        0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3,
        0x709F7B7A, 0x745E66CD, 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039,
        0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, 0xBE2B5B58, 0xBAEA46EF,
        0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,