[OLD/CLOSED] PseudoTV Live - Set-Top box solution
(2014-08-07, 22:06)Lunatixz Wrote:
(2014-08-07, 20:23)bry- Wrote:
(2014-08-07, 19:26)Lunatixz Wrote: I've seen this before, from my knowledge it parses XMLTV data... Which PTVL already does... what would be the benefit of adding this module?

Ah I was thinking that PTVL could eventually handle all xmltv data with a python wrapper. I did some googling and found that there is 1 for zap2it and one for schedules direct.

Add an option to control the amount of data being pulled into the xmltv file and limit complaints of slow loading/scanning times perhaps. (thinking out loud) of course.

Aside from Schdedulesdirect... the projects I've found are not true wrappers and are more or less just xmltv parsers... I've searched for over a year for a true wrapper so I can have PseudoTV Live request xmltv data on the fly directly from (mc2xml, zap2it, etc)... but no luck Sad

Thanks for the suggestions...
could this be of any use? maybe to modify for zap2it if anything?

edit: or this http://sourceforge.net/projects/pytvgrab/files/
Code:
# This module retrieves SchedulesDirect XML data using a hand-coded SOAP request.
#
# The code is released into the Public Domain.  If you break it, you own both halves.
#
# Original Code by Keith Medcalf, [email protected]

import codecs
import encodings
import gzip
import string
import sys
import time
import urllib2
import urlparse

def FetchXML(userName,
             passWord,
             URL='http://webservices.schedulesdirect.tmsdatadirect.com/schedulesdirect/tvlistings/xtvdService',
             Realm='TMSWebServiceRealm',
             predays=0,
             postdays=14,
             fileName='ddata.xml',
             fileCoding='latin-1',
             gzipped = False):
    cur = time.time()
    startTime = time.strftime( '%Y-%m-%dT00:00:00Z', time.gmtime( cur +  ( predays * 86400.0 ) ) )
    endTime   = time.strftime( '%Y-%m-%dT00:00:00Z', time.gmtime( cur + ( postdays * 86400.0 ) ) )
    strSoap = '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' \
              ' <SOAP-ENV:Body>\n' \
              '  <m:download xmlns:m="urn:TMSWebServices" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' \
              '   <startTime xsi:type="xsd:dateTime">' + startTime + '</startTime>\n' \
              '   <endTime xsi:type="xsd:dateTime">' + endTime + '</endTime>\n' \
              '  </m:download>\n' \
              ' </SOAP-ENV:Body>\n' \
              '</SOAP-ENV:Envelope>'
    print '#', time.strftime('%Y/%m/%d %H:%M:%S'), "Retrieving DataDirect TV Schedules"
    print '#', time.strftime('%Y/%m/%d %H:%M:%S'), "Requesting", startTime, "to", endTime
    authinfo = urllib2.HTTPDigestAuthHandler()
    authinfo.add_password(Realm, urlparse.urlparse(URL)[1], userName, passWord)
    request = urllib2.Request(URL, strSoap)
    if gzipped:
        request.add_header('Accept-encoding', 'gzip')
        if fileName[-3:].lower() == '.gz':
            fileName = fileName[:-3]
        fileName += '.gz'
    opener = urllib2.build_opener(authinfo)
    urllib2.install_opener(opener)
    print '#', time.strftime('%Y/%m/%d %H:%M:%S'), 'Saving XML to File: ' + fileName + ', Encoding: ' + fileCoding
    fileObj = None
    if fileCoding == 'native':
        urldata = opener.open(request)
        outfile = open(fileName,'wb',262144)
        repenc = False
    elif not gzipped:
        urldata = codecs.getreader('utf-8')(opener.open(request), errors='replace')
        outfile = codecs.open(fileName,'wb', fileCoding, 'replace', 262144)
        repenc = True
    else:
        raise ValueError('Codepage Translation of GZIP data not supported')
    print '#', time.strftime('%Y/%m/%d %H:%M:%S'), 'Receiving XML Data', ' '*30,
    fmt = ('\b'*30) + '%6d KB, %3d KB/s, %3d KB/s'
    data = 'X'
    bytes = 0
    currb = 0
    first = time.time()
    last = time.time() - 1
    while data:
        data = urldata.read(8192)
        b = len(data)
        bytes += b
        currb += b
        if repenc:
            data = string.replace(data, "encoding='utf-8'", "encoding='"+fileCoding+"'")
            repenc = False
        if data:
            outfile.write(data)
        curr = time.time()
        diff = curr - last
        if diff >= 0.999:
            print fmt % ((bytes//1024), currb//1024//(curr-last), bytes//1024//(curr-first)),
            last = curr
            currb = 0
    urldata.close()
    outfile.close()
    if fileObj:
        fileObj.close()
    print fmt % ((bytes//1024), 0, bytes//1024//(curr-first))
    print '#', time.strftime('%Y/%m/%d %H:%M:%S'), "Data Retrieval Complete"

if __name__ == '__main__':
    userName = "<username>"
    password = "<password>"
    FetchXML(userName, password)
first_time_user (wiki) | free content (wiki) | forum rules (wiki) | PVR (wiki) | Debug Log (wiki)

IMPORTANT:
The official Kodi version does not contain any content what so ever. This means that you should provide your own content from a local or remote storage location, DVD, Blu-Ray or any other media carrier that you own. Additionally Kodi allows you to install third-party plugins that may provide access to content that is freely available on the official content provider website. The watching or listening of illegal or pirated content which would otherwise need to be paid for is not endorsed or approved by Team Kodi.


Messages In This Thread
RE: [FORK] - by jcaa6479 - 2013-07-16, 23:25
Re: RE: - by bry - 2013-07-19, 08:42
Audio Muting Consistently ? - by gjwAudio - 2013-08-18, 08:25
PTVL Anomalies... - by gjwAudio - 2013-08-25, 01:15
Help Find The BAD Channel... - by gjwAudio - 2013-08-27, 02:12
RE: - by DLWhittet - 2013-10-13, 02:48
Problems with Pseudo TV Live - by media-mogul - 2013-11-07, 22:45
Setup wifi cam stream - by rebelmaveric19 - 2013-12-12, 00:54
Black Screen - by Antisthenes - 2014-03-03, 02:06
RE: [FORK] - by Lunatixz - 2014-03-25, 18:21
Re: RE: - by Lunatixz - 2014-04-26, 17:10
Update breaks autostart? - by grumpygamer - 2014-07-12, 11:48
Re: RE: Update breaks autostart? - by bry - 2014-07-12, 13:44
PseudoTV Live + HDHomerun Tutorial - by bry - 2014-07-25, 23:17
RE: [FORK] "PseudoTV Live" w/ LiveTV, InternetTV and added Strm Support - by bry - 2014-08-08, 17:58
RE: [FORK] - by tromy - 2014-09-22, 19:14
Custom Live Channel - by GavinCampbell - 2014-11-01, 18:20
Options menu? - by Pendragon445 - 2014-11-02, 20:23
Prevent Stop Button - by GavinCampbell - 2014-11-13, 22:45
RE: [FORK] - by herpkektop - 2015-02-11, 11:22
RE: [FORK] - by herpkektop - 2015-02-11, 17:55
PseudoTv issue - by adamp237 - 2015-03-02, 03:41
No Guide - Android Arm - by MoRbIdBoY - 2015-03-14, 20:26
Chanel Issues - by BlueKalel - 2015-05-03, 07:23
RE: donation - by gkithes - 2015-06-11, 02:27
RE: donation - by bornagainpenguin - 2015-06-11, 03:55
Channel Sharing Feature Freezing - by RORO-RR - 2015-07-11, 18:48
Logout Mark Read Team Forum Stats Members Help
[OLD/CLOSED] PseudoTV Live - Set-Top box solution45