TOOLSP
"
WELCOME !

Please ! Use [CODE] tags for your LINKS and CODE.
Favor usar balisas [CODE] para sus vínculos y código.
Merci d'utiliser les balises [CODE] pour vos liens et code.

[code]http://Thank.you[/code]
"
*** GITHUB ***
.
.
URL Resolver [GIT]
.
.
.
.
Jx Update [REDIRECT]
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
Latest topics
» SportsDevil back on Mega
Yesterday at 14:38 by skyhigh

» SportsDevil back on Mega
Fri 17 Nov - 5:30 by jairoxyz

» youtube playlists
Tue 14 Nov - 2:43 by jujuuj

» afromotion
Thu 9 Nov - 13:59 by doctor4979

» ? works on VLC, but not on kodi ?
Mon 6 Nov - 13:06 by jujuuj

» how make a request.post to get a repond
Tue 31 Oct - 16:01 by jujuuj

» how to play this in kodi
Tue 31 Oct - 15:21 by jujuuj

FRIENDS / PARTNERS

forum

créer un forum


Epg item in LSP

View previous topic View next topic Go down

Epg item in LSP

Post by Sylphilds on Mon 17 Apr - 19:30

Hi

I tried to make epg in LSP with lsp function with no success
the examples of them are not working
Code:
https://dl.dropboxusercontent.com/u/117805169/Livestreams/LiveTVxmlm3u/epgtest.xml
and
Code:
https://github.com/thismustbetheplace/_/blob/master/_epg/guide.zip?raw=true

can you explain us with real url

i use
Code:
[http://www.webgrabplus.com/
and  this sitieini.pack from france : tv.orange.fr.channels.xml
and i've got a guide.xml on my HDD locate on "T:\EPG\WebGrab+Plus\WebGrab++.config.xml"
the guide gives  =
Code:
<channel id="TF1">
   <display-name lang="fr">TF1</display-name>
   <icon src="http://media3.woopic.com/api/v1/images/201%2Fchannel%2Fec6%2F02e%2F07a1aa287be0a65eb2c37ab427%2Ftf1%7Cclair_192.png?facedetect=1&amp;quality=85" />
   <url>http://www.tv.orange.fr</url>
 </channel>

can i use the locate guide on my HDD or i need to grab it from link on
Code:
http://programme-tv.orange.fr/
    ??????????

can you please edit an item files for it  which will works like:
Code:
<item>
<title></title>
<link>hXXp://175.198.34:8080/TF1.ts</link>
<epg>
   <tvgurl>HTTP</tvgurl>
<tvgshift>1</tvgshift>
</epg>
<epgitem><title>TF1</title>
<</epgitem><thumbnail></thumbnail>
</item>

thanks for the answer - it will be much appreciated


Last edited by Sylphilds on Tue 18 Apr - 17:48; edited 7 times in total

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by vbprofi on Wed 3 May - 10:47

Hello,
I will use EPG too. Have you an working solution for testing?

vbprofi

Messages : 17
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by jujuuj on Sun 7 May - 13:23

Well ... I can show you two examples.
But I dont use no <EPG> tag...

First one is a makelist, so when it grab the list of channels, links and thumbs, it also grab a fourth param that is the EPG (of the same site).
Then it simply returns in <title> the name of channel + the EPG of the channel ...   Not really what u asked ...
Code:

<item>
<title>  v4  WIIZ.TV  FR  &  Francophones  & intl   EPG </title>
<link>$doregex[makelist-EPG]</link>
<regex>
<name>makelist-EPG</name>
<listrepeat><![CDATA[
<title>[makelist-EPG.param5] [COLOR lightblue] [makelist-EPG.param3]
   [makelist-EPG.param6]   [makelist-EPG.param7][/COLOR] </title>
<link>$doregex[getUrl]</link>
<thumbnail>[makelist-EPG.param1]</thumbnail>
<fanart>[makelist-EPG.param2]</fanart>
]]></listrepeat>               thumb                                     fanart        horaire                                       lien      chaine                 titre1        titre2
<expres><![CDATA[(?s)img src="([^"]+)"\s*class="chainehautv".*?img src="([^"]+)".*?">(\s*\d*:\s*\d*\s*-\s*\d*:\d*)<\/h3>\s*<a href="([^"]+[\/_](.*?)\.php)".*?<strong>(.*?)<\/strong>(.*?)\s*<\/h4]]></expres>  
 <page>http://www.wiiz.tv/direct.php</page>
  </regex>
 <regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,urllib
def GetLSProData(page_data,Cookie_Jar,m):
  f4m = re.findall('src="(http.+?token[^"]+)',page_data)[0]
  return f4m + '|Referer=http://www.wiiz.tv/wp-content/plugins/fv-wordpress-flowplayer/flowplayer/flowplayerhls.swf?ver=6.0.5.17'
]]></expres>
<page>[makelist-EPG.param4]</page>
<referer>http://www.wiiz.tv/direct.php</referer>
<cookieJar></cookieJar>
</regex>
<thumbnail></thumbnail>
</item>


for this second one, u will need the VERY last LSP : it allows us to call a regex in <title> tag.
Code:

<item>
<title>6ter ($doregex[prog])      </title>
<link>plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&amp;url=http://live.artv.ga/6ter/index.m3u8</link>

<regex>
<name>prog</name>
<expres><![CDATA[<em>Programme 6ter<.+title="(.+)">]]></expres>
<page>http://www.programme-television.org/programme-television-maintenant?bouquet=canalsat&amp;ts=?#tous</page>
<agent>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0</agent>
<referer></referer>
</regex>

</item>

To use a local  EPG (in your PC),

you just have to adapt the page tag : examples,
<page>home/userlinux/my-local-epg.txt</page>
<page>c\documents\my-local-epg.doc</page>
<page>T:\EPG\WebGrab+Plus\WebGrab++.config.xml</page> EDIT : \...\guide.xml
!! No idea if the use of  "+" is possible !? ...
(i don't use windowz, so i don't remember if you have to write T:\ or just T\ or may be t\ ... )

and, of course, you'll have to adapt the <expres> too ...

Good luck ! Tell us ...


Last edited by jujuuj on Wed 10 May - 17:58; edited 1 time in total
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Mon 8 May - 10:03

thanks for answer
yes we can call regex in title but it is not possible to call plugin in link
it works for
Code:

<item>
<title>6ter ($doregex[prog])      </title>
<link>http://live.artv.ga/6ter/index.m3u8</link>

<regex>
<name>prog</name>
<expres><![CDATA[<em>Programme 6ter<.+title="(.+)">]]></expres>
<page>http://www.programme-television.org/programme-television-maintenant?bouquet=canalsat&amp;ts=?#tous</page>
<agent>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0</agent>
<referer></referer>
</regex>

i failed to use <page>T:\guidetv.xml</page> with modified expres

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Tue 9 May - 0:44

jujuuj wrote:
To use a local  EPG (in your PC),

you just have to adapt the page tag : examples,
<page>home/userlinux/my-local-epg.txt</page>
<page>c\documents\my-local-epg.doc</page>
<page>T:\EPG\WebGrab+Plus\WebGrab++.config.xml</page>
!! No idea if the use of  "+" is possible !? ...
(i don't use windowz, so i don't remember if you have to write T:\ or just T\ or may be t\ ... )

and, of course, you'll have to adapt the <expres> too ...

Good luck ! Tell us ...

There is no reason what so ever for you to ever call WebGrab++.config.xml from LSP. This file does NOT contain EPG data. It is the config file for Webgrab++. You use this file to configure Webgrab++. Once configured you can execute Webgrab++ and it will create the file containing the EPG Data. Usually named Guide.xml, but you can give it any name you want.


Sylphilds wrote:
. . .
i failed to use <page>T:\guidetv.xml</page> with modified expres

I've never been able to read from a local file this way. I've heard it mentioned many times. So I don't know if it is really possible or just misinformation. I use python to read local files. I've made the below code where it is easy to modify. Just change 2 lines.
On the first line put the path to the local file you wish to read between the apostrophes. On the second line put the regex for grabbing the desired data from the local file. Please note that if you have an apostrophe as part of your path or regex it will need to be escaped with backslash so to prevent it from thinking it is the end of the string. I hardly use Windows, but I believe python allows you to use forward slashes instead of backslashes in path / filenames. Which makes things a lot easier.

Code:
  epgfile = '/path/to/guide.xml'
  regex = 'put your regex here.'
example:
Code:
  epgfile = '/path/to/guide.xml'
  regex = 'title>(.+)<\/title'

here's the code. $doregex is in Title, and link is blank.
Code:
<item>
<title>$doregex[test]</title>
<link>N/a</link>

<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import re
  epgfile = '/path/to/guide.xml'
  regex = 'put your regex here.'
  f = open(epgfile, 'r')
  data = f.read()
  f.close()
  return re.findall(regex, data)[0]
]]></expres>
<page></page>
</regex>
</item>
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Tue 9 May - 9:34

thanks twogun

i tried bu not sure to have understand
as you know the guide.xml gives a channel ; date and hour for the good progtv
i'm not sure to put the good 'title regex ' too

i upload the guide.xml on pastebin
Code:
https://pastebin.com/dLZThKzx

so it will be :

Code:
<item>
<title> TF1 $doregex[test]</title>
<link>plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=http://www.streaming-hub.com/tf1-direct/</link>


<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import re
  epgfile = 'T:\guide.xml'
  regex = 'title lang="fr">(.+)<\/title'
  f = open(epgfile, 'r')
  data = f.read()
  f.close()
  return re.findall(regex, data)[0]
]]></expres>
<page></page>
</regex>
</item>

i will see if the answer of regex gives the good progtv all day long

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Tue 9 May - 17:35

The example was just to show that you can read from a local file.  To grab actually epg data you will need to generate a timestamp for the current time/date in the same format as the one use in guide.xml.  Then you will need a formula to find the current program, and if desired the next.  Here are 2 example.  The first one using the pastebin and the second on uses the local file you defined previously.  Take note this is only the regex block and not the complete code.  Also this code does not correct any time offsets cause by location or other such reason.

Code:
  updated version below

Here is an example using the local file
Code:
  updated version below


Last edited by twogun on Tue 9 May - 21:41; edited 1 time in total (Reason for editing : Order of the King)
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Tue 9 May - 19:34

thanks twogun for new edit

i tried with epg ='http://pastebin" but no succes it can't load and have no prog data in answer

i could see prog tv from TF1 in local HDD

i upload ne new pastebin with many channels
Code:
https://pastebin.com/WY9vbyHe

so i wrote this for different channels

Code:
<item>
<title>[b][color=undefined]•[/color][/b] TNT: [b][color=undefined]TF1 [color=undefined]CAL [b][color=undefined][HD] [b][color=undefined](m3u8)[/color][/b]$doregex[test]</title>
<link>plugin://plugin.video.SportsDevil/?mode=1&amp;maxbitrate=6000000&amp;item=catcher%3dstreams%26url=http://www.streaming-hub.com/tf1-direct/</link>
<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import time, requests, re, HTMLParser
  from bisect import bisect_left
  time = time.strftime("%Y%m%d%H%M%S", time.gmtime())
  try:
   epgfile = 'T:\guide.xml'
   f = open(epgfile, 'r')
   source = f.read()
   f.close()
   ch = 'TF1'
   start = re.findall('start="(\d+?) .+?channel="TF1"', source)
   pos = (bisect_left(start, time))
   t1 = start[pos]
   t2 = start[pos + 1]
   regex = 'start="' + t1 + '.+?channel="' + ch + '">\n.+?title lang="fr">(.+?)<'
   now = re.findall(regex, source)[0]
   regex = 'start="' + t2 + '.+?channel="' + ch + '">\n.+?title lang="fr">(.+?)<'
   next = re.findall(regex, source)[0]
   return 'NOW: ' + HTMLParser.HTMLParser().unescape(now) + ' NEXT: ' + HTMLParser.HTMLParser().unescape(next)
  except:
   return ' [color=undefined]No program data[/color]'
  return '[color=undefined]NOW: [/color]' + HTMLParser.HTMLParser().unescape(now) + '\n[color=undefined] NEXT: [/color]' + HTMLParser.HTMLParser().unescape(next)
]]></expres>
<page></page>
</regex>
</item>

<item>
<title>[b][color=undefined]•[/color][/b] TNT: [b][color=undefined]FRANCE 2 [color=undefined]streaming-hub [b][color=undefined][HD] [b][color=undefined](DVB-T)[/color][/b]</title>
<link>plugin://plugin.video.SportsDevil/?mode=1&amp;maxbitrate=6000000&amp;item=catcher%3dstreams%26url=http://www.streaming-hub.com/france-2-live/</link>
<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import time, requests, re, HTMLParser
  from bisect import bisect_left
  time = time.strftime("%Y%m%d%H%M%S", time.gmtime())
  try:
   epgfile = 'T:\guide.xml'
   f = open(epgfile, 'r')
   source = f.read()
   f.close()
   ch = 'FRANCE 2'
   start = re.findall('start="(\d+?) .+?channel="FRANCE 2"', source)
   pos = (bisect_left(start, time))
   t1 = start[pos]
   t2 = start[pos + 1]
   regex = 'start="' + t1 + '.+?channel="' + ch + '">\n.+?title lang="fr">(.+?)<'
   now = re.findall(regex, source)[0]
   regex = 'start="' + t2 + '.+?channel="' + ch + '">\n.+?title lang="fr">(.+?)<'
   next = re.findall(regex, source)[0]
   return 'NOW: ' + HTMLParser.HTMLParser().unescape(now) + ' NEXT: ' + HTMLParser.HTMLParser().unescape(next)
  except:
   return ' [color=undefined]No program data[/color]'
  return '[color=undefined]NOW: [/color]' + HTMLParser.HTMLParser().unescape(now) + '\n[color=undefined] NEXT: [/color]' + HTMLParser.HTMLParser().unescape(next)
]]></expres>
<page></page>
</regex>
</item>

but with no luck for the second channel "FRANCE 2" it gives the progtv for TF1 instead again

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Tue 9 May - 21:36

CODE UPDATE: May 11, 2017.
*  Bug fix = If the time code used to search the title was used in a channel listed earlier in th xml it would return the first program title for the channel (correct channel/wrong program)
* Moved the ch = line higher to make it easier to find.
* To allow easier editing I added a comment next to the ch = line with the list of channels in the xml file.
* added note:  Waiting on Shani's response concerning LSP odd behavior with this code that cause all regex  title in an xml to display the results of the first regex title.  (so all entries in the xml show the same data in the title)


I goofed when I created the orginal code.  I did not use the raw pastbin.  This is why the local worked, but the pastebin version caused problems.  So I fixed the bug and made a few changes that should make it easier to use.

Pastebin version and local version below.

pastebin version:
Code:
 .  .  .  Updated version below  .  .  .

May 11 update: local version:
Code:
 .  .  .  Updated version below  .  .  .

On a final note I've noticed so odd behavior from LSP if you have more then one item in the same xml that calls regex from the title.  Just a warning.  separate xml files my be needed
Also there is still no time correction.  Is the guide correct for you?  If not can you figure out how many hours/min it is off?


Last edited by twogun on Sat 13 May - 6:41; edited 4 times in total (Reason for editing : updated code.)
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Wed 10 May - 12:44

the time seems correct

i make tests (android tv box and win7)-
i wrote 3 differents guidetv with in each one channel
and no luck !!
it gives always the first progtv so TF1 what ever the channel changes
curious??


i couldnot use pastebin it fails


thanks so much TWOGUN for the time you spent

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by jujuuj on Wed 10 May - 17:53

Sylphilds wrote:

i failed to use <page>T:\guidetv.xml</page> with modified expres

not sure it is possible ...   I only used <link>T:   and never   <page>T:

but ...  Thinking it TWICE ...  you should write the \ twice  
... as the first one will inform that the second one is a real \

so you should try  things as  t:\\way\\file.xml  T:\\way\\file.xml   or ...  t\\way\\file.xml  ( with no " : " ) ... or .txt equally ...


! and change all [ESPACE] for a %20 example \\my%20way\\file.xml
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Wed 10 May - 18:20

jujuuj wrote:
. . . Do we really need a quote when it right above this message? . . .

@jujuuj. One of us should come up with a windows machine to test with. It would make it a lot easier to answer questions. I've tried using a virtual machine, but I've never been able to get kodi working in a VM. Of course I guess I could still use a VM just to test python code under windows. It's a start.

As I said before I believe Python automatically determines the path component separator. Allowing you to use slash instead of backslash in windows file paths. I'm just not sure where it is allowed in code. Maybe all the time, or maybe only under certain conditions? All I can say is give it a try because backslashes can cause headache.

Also LSP behaves oddly with my code above. It works fine if it is the only item in the xml with regex in title. But if you have 2 or more (example same code, but one for TF1 and another for France 2) then all items will receive the same title data as the first.

I've presented my finding and code to Shani. Hopefully he will have an answer.


Last edited by twogun on Wed 10 May - 18:22; edited 1 time in total (Reason for editing : establishing herd dominance.)
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Thu 11 May - 19:28

The problem is fixed with LSP 2.7.9 . I got a reply from Shani and he confirmed that it is a bug with LSP. He has fixed the bug. If you have the repository installed you system should eventually update I had to force the update. I also had to restart kodi for it to work. But it does work correctly with the above code. Just make sure you have the new updated version of the code up above, and the new updated LSP 2.7.9 . Both released to day.

I've tested both the pastebin and the local version and they work correctly.
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Fri 12 May - 7:21

Many many Thanks

can you tell me how to change hours ? the timeset is gmt

i have update LSP

i update a new guide.xml https://pastebin.com/raw/gw4KHFUA

i've got still errors when you add all the channel items in one file for LSP when you combinate TF1 & FRANCE 2 & CANAL\+ on follow
i tried to mix codes with local file and pastebin in the same file for LSP and unlucky too

i'm not understand why perhaps of a bad win7 install? i'm asking me....


Last edited by Sylphilds on Sat 13 May - 14:47; edited 5 times in total (Reason for editing : l)

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Sat 13 May - 6:38

This should be the final fix.  Here's the update.   While LSP 2.7.9 was an improvement it did not fully fix the problem.  After reporting this to Shani he was quick with the fix. Isn't he great!  In older version of LSP  pythonfunctions are stores and retrieves in a single file.  The shared file was causing the problem because it was reusing the same function instead of reloading the new one.  The new LSP 2.8.0 isolates pythonfunctions in their own file.

So with this new LSP version and this new code which offers time correction everything should be perfect.

List of variables in the following code:

  • ch = name of channel as it appears in your guide
  • epg = url of guide.xml
  • epgfile = local filename of guide.xml
  • offset = time correction in hours. can be positive or negative.



Pastebin version:
Code:
<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import datetime, requests, re, HTMLParser
  from bisect import bisect_left
  ch = 'TF1'   # Use one of these values: 'TF1' , 'FRANCE 2', 'CANAL\+', 'France 3 Corse Via Stella'
  epg = 'https://pastebin.com/raw/gw4KHFUA'
  offset = 1
  time = str(datetime.datetime.now() + datetime.timedelta(hours=offset))[:-7].replace(' ','').replace('-','').replace(':' ,'')
  try:
   source = requests.get(epg).text
   regex = 'start="(\d+?) .+?channel="' + ch
   start = re.findall(regex, source)
   pos = (bisect_left(start, time))
   t1 = start[pos]
   t2 = start[pos + 1]
   regex = 'start="' + t1 + '.+?channel="' + ch + '">[\\n\\r]*.+?title lang="fr">(.+?)<'
   now = re.findall(regex, source)[0]
   regex = 'start="' + t2 + '.+?channel="' + ch + '">[\\n\\r]*.+?title lang="fr">(.+?)<'
   next = re.findall(regex, source)[0]
  except:
   return ' - [COLOR green]No program data[/COLOR]'
  return ' [COLOR lightgreen]NOW[/COLOR] - ' + HTMLParser.HTMLParser().unescape(now) + '\n ' + '[COLOR green]' + t2[8:10] + ':' + t2[10:12] + '[/COLOR] - ' + HTMLParser.HTMLParser().unescape(next)
]]></expres>
<page></page>
</regex>

Local file version:
Code:
<regex>
<name>test</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
  import datetime, requests, re, HTMLParser
  from bisect import bisect_left
  ch = 'FRANCE 2'  # Use one of these values: 'TF1' , 'FRANCE 2', 'CANAL\+', 'France 3 Corse Via Stella'
  offset = 1
  epgfile = '/home/riot/strm/00test.xml'
  time = str(datetime.datetime.now() + datetime.timedelta(hours=offset))[:-7].replace(' ','').replace('-','').replace(':' ,'')
  try:
   f = open(epgfile, 'r')
   source = f.read()
   f.close()
   regex = 'start="(\d+?) .+?channel="' + ch
   start = re.findall(regex, source)
   pos = (bisect_left(start, time))
   t1 = start[pos]
   t2 = start[pos + 1]
   regex = 'start="' + t1 + '.+?channel="' + ch + '">[\\n\\r]*.+?title lang="fr">(.+?)<'
   now = re.findall(regex, source)[0]
   regex = 'start="' + t2 + '.+?channel="' + ch + '">[\\n\\r]*.+?title lang="fr">(.+?)<'
   next = re.findall(regex, source)[0]
  except:
   return ' - [COLOR green]No program data[/COLOR]'
  return ' [COLOR lightgreen]NOW[/COLOR] - ' + HTMLParser.HTMLParser().unescape(now) + '\n ' + '[COLOR green]' + t2[8:10] + ':' + t2[10:12] + '[/COLOR] - ' + HTMLParser.HTMLParser().unescape(next)
]]></expres>
<page></page>
</regex>
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Sat 13 May - 7:42

Thanks twogun for this new version
I'm really happy with your help

I was wondering how this works for my own epg
If you could offer to others a script for everyone
to know
Retrieve the file on = http://xmltv.dtdns.net/download/complet.zip
That python will make sure to unzip it to read it and display the TV program

I know we are all taken by time and it is precious
Thanks in advance for what you can do

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by twogun on Sat 13 May - 20:20

I recommend linking to an uncompressed text so LSP can read directly from the url.  But with that said I have created an "update epg" regex that will download and extract the file for you.  You can change the paths so it will save where you want it.  I've made it save it in the Download folder of the user's home folder.

Code:
<item>
<title>[COLOR red] update epg [/COLOR]</title>
<link>$doregex[extract]</link>

<regex>
<name>extract</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,):
 import urllib2, zipfile
 from os.path import expanduser
 home = expanduser('~')
 url = 'http://xmltv.dtdns.net/download/complet.zip'
 f = urllib2.urlopen(url)
 data = f.read()
 with open(home + '/Downloads/complet.zip', 'wb') as tools:
    tools.write(data)
 with zipfile.ZipFile(home + '/Downloads/complet.zip', 'r') as z:
    z.extractall(home + "/Downloads")
 return 'N/A'
]]></expres>
<page></page>
</regex>
</item>
avatar
twogun

Messages : 33
Date d'inscription : 2017-04-03

View user profile

Back to top Go down

Re: Epg item in LSP

Post by jujuuj on Sun 14 May - 1:09

Thank you so much, Twogun, for your help here, and this great stuf !

@sylphids ... on compte sur toi pour un petit tuto (pourquoi pas traduit en Fr ...) quand ça tournera !
(même sans les flux .. si tu préfères)
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Sylphilds on Mon 15 May - 7:35

here you have a regex (made by pustule - thanks to him) for progtv found on tvguide

note:
for canal+ you must write = canal\+
for l'equipe21 it is 'L & # 039;EQUIPE' without space !!

Code:

<item>
<title>[B][COLOR lawngreen]•[/B][COLOR][/COLOR] TNT: [B][COLOR white]TF1 [COLOR blue]streaming-hub [B][COLOR green][HD] [B][COLOR red](m3u8)[/B][/COLOR][B][COLOR yellow]($doregex[prog])[/B][COLOR]</title>
<link>plugin://plugin.video.SportsDevil/?mode=1&amp;item=catcher%3dstreams%26url=http://www.streaming-hub.com/tf1-direct/</link>
<regex>
<name>prog</name>
<expres><![CDATA[<em>Programme TF1<.+title="(.+)">]]></expres>
<page>http://www.programme-television.org/programme-television-maintenant?bouquet=canalsat&ts=?#tous</page>
<agent>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0</agent>
<referer></referer>
</regex>
<referer></referer>
<thumbnail>http://static1.purepeople.com/articles/0/31/84/0/@/219205-logo-tf1-950x0-1.jpg<thumbnail>
</item>
<item>
<title>[B][COLOR lawngreen]•[/B][/COLOR] FR: [B][COLOR white]CANAL+ CINÉMA [B][COLOR green][SD] [B][COLOR red](F4M)[/B][/COLOR][B][COLOR yellow] - $doregex[prog][/B][/COLOR]</title>
<link>hXXp://liveserveur/canalpluscinema/tracks-v1a1/index.m3u8</link>
<regex>
<name>prog</name>
<expres><![CDATA[<em>Programme Canal\+ Cinéma<.+title="(.+)">]]></expres>
<page>http://www.programme-television.org/programme-television-maintenant?bouquet=canalsat&ts=?#tous</page>
<agent>Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0</agent>
<referer></referer>
</regex>
<thumbnail>https://upload.wikimedia.org/wikipedia/fr/thumb/1/13/Canal%2B_Cin%C3%A9ma_(2003-2005).svg/1280px-Canal%2B_Cin%C3%A9ma_(2003-2005).svg.png</thumbnail>
</item>

Sylphilds

Messages : 13
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: Epg item in LSP

Post by solved on Tue 27 Jun - 0:43


Merci !


solved

Messages : 35
Date d'inscription : 2017-06-27

View user profile

Back to top Go down

Re: Epg item in LSP

Post by Pibox on Wed 4 Oct - 1:39

Sylphilds wrote:here you have a regex (made by pustule - thanks to him) for progtv found on tvguide


Hey, I AM pustule Smile

merci du merci Very Happy

Pibox

Messages : 10
Date d'inscription : 2017-04-16

View user profile

Back to top Go down

Re: Epg item in LSP

Post by solved on Wed 11 Oct - 15:59

solved ? ... probably ...

solved

Messages : 35
Date d'inscription : 2017-06-27

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum