Kodi Community Forum
[RELEASE] myTV - TV Guide Script (with pluginsnew script) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] myTV - TV Guide Script (with pluginsnew script) (/showthread.php?tid=12895)



- smuto - 2005-08-08

i try to make my datasource- it's not easy btw
but i'm stuck in function def getchannel
i can't write regex to extract data title & description from doc file

description will be fetched as required from a link

html code from my site

with link
Quote:nowrap><b>06:05</b></td><td bgcolor="white" valign="top"><b><a href="javascript:okno('opis.html?pr_tele_id=3379075403',775,500,1);">wszystko w rodzinie </a></b>

without link
Quote:nowrap><b>06:55</b></td><td bgcolor="white" valign="top"><b>pogoda </b>

and now regex
Quote: findre = re.compile("nowrap><b>(\d\d:\d\d)???????????????????????????????????????", re.dotall + re.multiline + re.ignorecase)

can someone help me?


- BigBellyBilly - 2005-08-08

regex:

Quote:nowrap><b>(.+?)</b>(?:.*?)href(?:.*?)\">(.*?)</a

that will extract time and prog desc from your code sample.

you've also got pm.


- smuto - 2005-08-08

thx a lot
your is much more clear, but i'm still no step forward
i can't match title without link

my old regex try:

Quote:nowrap><b>(\d\d:\d\d)(?:.*?)b>(.*?)</b
shows realy all, but problem with positions contents link

Quote:nowrap><b>(\d\d:\d\d).*?<b><.*?>(.*?)</a></b>.*?
shows only positions with link, just like yours

ps tomorow i try once again


- dazinith - 2005-08-08

(bigbellybilly @ aug. 08 2005,09:39 Wrote:the time functions are based on pythons localtime function, so it should be ok.
i would have expected users from other euro countries to have the same problem (being at least 1 hour out) if i was using the wrong function - but i think it could be just a zap2it datasource problem.

give me some more details, ie your location (zipcode / tv provider) of your account and i'll try and replicate the problem.

thanks
i am using the zap2it service, zip code 70810, regular cable, on cox.

i dont recall any time zone settings on the xbox.. perhaps im just special?

thanks for any help you can give, and keep up the good work Smile


- BigBellyBilly - 2005-08-08

smuto: i'm a little unclear on which html code your trying to extract prog desc from. if you could send me the url of the page your processing i'll be able to have a better stab at it.

dazinith: thx for that info, i'll have ago with it.


- smuto - 2005-08-09

my "half way" datasource

datasource_wppl


- BigBellyBilly - 2005-08-09

smuto,
it took me a while, but i've found a regex solution.

Quote:"nowrap><b>(.+?)</b>(?:.*?)(?:<b><a href(?:.*?)id=(\d+)\'(?:.*?)\">|<b>)(.+?)</(?:.*?)sginfo\">(.*?)<"

i'm no regex expert, and there are probably better solutions that involve 'lookahead or lookback assertions' - but it works.
it extracts time, link id, title, desc (always 4 groups).

i hope you don't mind, but i've also made some other changes to the code and intend to include it (datasource_wppl - its for polish tv) in the next release.

thanks for taking the time to have-ago.


- Livin - 2005-08-10

bigbellybilly,
i have one feature request if i may...

i'd love to have http commands be able to be sent when choosing a program.

basically, i have a software package that can receive http commands and then do things from there. i'd like to send http commands to the software and have that software change the channels for me, via ir commands.

if xbmc (via your script) could send the http of my choice when i choose a progam to view this would accomplish my goal.

so if i chose a program that did not start for 30 minutes, i would choose the program to watch, and mytv would know it does not start for 30 minutes, so in 30 minutes it would send the http command(s). or if the show was already in progress it would send them immediately.

could you do something like this?


- BigBellyBilly - 2005-08-10

affini, errrr. really not sure about any of that...

delayed http sends: can a python script setup a timer that can exist in the background regardless of whatever the xbmc is doing ? or did you just mean aslong as your still running mytv script?

send http cmds: could you send / show me some example http cmds you'd like to send.
would using sending a post or get url to your http server work for you ?


- Livin - 2005-08-10

(bigbellybilly @ aug. 10 2005,02:48 Wrote:affini,  errrr. really not sure about any of that...

delayed http sends: can a python script setup a timer that can exist in the background regardless of whatever the xbmc is doing ?  or did you just mean aslong as your still running mytv script?

send http cmds:  could you send / show me some example http cmds you'd like to send.
would using sending a post or get url to your http server work for you ?
the commands are post. here's example code from an asp page i currently use...

Quote:<form method="post">
<td align=center width="100%">
<input type=hidden value='hs.triggerevent "default" : hs.setdevicestringbyname "house lighting status", "default"' name=commanddefault><input class=formbuttonbig type=submit value='default' name=action>
<br>
<input type=hidden value='hs.triggerevent "all lights on" : hs.setdevicestringbyname "house lighting status", "all lights on"' name=commandalllightson><input class=formbuttonbig type=submit value='all lights on' name=action>
<br>

as for the timer, i'd image that a separate timer script could be launched by mytv with the variables needed. this way if you leave the mytv interface then the http commands are still sent. but i don't know squat about python, only vbs & jscript.


- enigma9o7 - 2005-08-12

(dazinith @ aug. 08 2005,07:37 Wrote:right now my xbox clock is 1am (correct), but when i use mytv to browse i have to go to 6am to find the matching shows that are on tv right now.. this is 5 hours difference..

i am pretty sure i am 5 hours off of gmt, so i am assuming that mytv is going by gmt time.. is there a way to setup an offset on the times so that my 1am corresponds with the 1am in mytv? or am i experiencing something unique?
i'm having the exact same problem, except my listings are 8 hours off and im gmt -9 (according to windows).  i'm using zap2it from 99701 with gci cable, and if i check the regular zap2it.com on my pc the times are right.


- Asteron - 2005-08-14

(enigma9o7 @ aug. 12 2005,00:05 Wrote:i'm having the exact same problem, except my listings are 8 hours off and im gmt -9 (according to windows). i'm using zap2it from 99701 with gci cable, and if i check the regular zap2it.com on my pc the times are right.
yes i am having this problem as well. the zap2it data source is returning gmt time but not local.

also there is a flicker as the interface is redrawing the buttons when the page is scrolled (i think that if the data has already been parsed the gui should be locked so you dont see this updating.


- BigBellyBilly - 2005-08-15

i've released v1.07.
it doesnt fix the zap2it problem, but i've released it anyway as it was ready to go.

new datasource yahoo (uk,fr,de,it,ca)
new datasource wppl (polish)
new support for mytheater tv card for zap2it users - this translates the zap2it station id into the mytheater channel code. its not a complete list and would like some help on building the list (see inside the saveprogramme_mytheater.py)

zap2it: bit baffled by this tbh. althou i'm in the uk, using the emu, if i set my pc to a us timezone then dl zap2it data it appears to be the correct time. i use the python function localtime to establish date as part of the date range in the zap2it header request, so i dont see how i can be requesting gtm ? it does seem to be a zap2it prolem as users from other countries not reported times being out.

it would be helpfull if you could send me
1) your zap2it xml file
2) a subsequent parsed out channel file.
for a date in the future. then i could analyse it a bit more.
http://www.yousendit.com is good for sending large files.

gui flicker: if i lock the gui then you wouldnt get any dialog boxes informing you of whats going on as it blocks them too.
ie downloading channel xxx
its not all already parsed, if during the timeline draw i need more data (next days data) it has to go fetch at that point.
so, no its not perfect, and i doubt it ever will be.


- jj5768 - 2005-08-15

hey bbb, no matter, i think all are impressed by the time and work you've put into this script. thank you.

the work into getting tv cards working has made my year i think. i'm a little surprised its not been more widely picked up on, or maybe it has and it passed me by.

if it were to matter - there did seemt to be a percievable difference in the refresh when 1.06 came out ?

cheers. jj.


- enigma9o7 - 2005-08-16

(bigbellybilly @ aug. 15 2005,00:43 Wrote:zap2it: bit baffled by this tbh.  althou i'm in the uk, using the emu, if i set my pc to a us timezone then dl zap2it data it appears to be the correct time.  i use the python function localtime to establish date as part of the date range in the zap2it header request, so i dont see how i can be requesting gtm ?  it does seem to be a zap2it prolem as users from other countries not reported times being out.

it would be helpfull if you could send me
1) your zap2it xml file
2) a subsequent parsed out channel file.  
for a date in the future. then i could analyse it a bit more.
i just grabbed a few days ahead and sent my entire cache directory to the gmail address in the readme.txt file, hopefully this gets you what you need!

if it's a problem relative to gmt, it seems odd that i'm gmt -9 but i have to look 8 hours ahead to see what's on. or maybe that's related to dst or something. the reason i think i'm gmt -9 is because if i click on the time on my winxp taskbar, then click time zone, it says (gmt -09:00) alaska. i'm in alaska and my time/zone is set correctly in windows.