LSP Regex & Makelist Discussion.

thingy

Member
May 9, 2018
58
0
6
I need you to help me see if it is possible to obtain the regex for this channel 6 preferably, I have been using this file directly with a referer but lately they have been changing the referer
Code:
hxxp://xxx.repretel.com/envivo
 

gujal

Developer
Dec 26, 2013
526
290
63
Enjoy!
Will work on LSP2.9.0 with Kodi 18.3



Code:
<item>
<title>Repretel</title>
<link>$doregex[makelist]</link>
<thumbnail>https://cdn.repretel.com/2018/v3/images/logo.png</thumbnail>
<fanart>https://cdn.repretel.com/files/2019/07/09/conductoresgrande.png</fanart>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param1][/COLOR]</title>
  <inputstream>$doregex[url]</inputstream>
  <thumbnail>[makelist.param2]</thumbnail>
  <fanart>https://cdn.repretel.com/files/2019/07/09/conductoresgrande.png</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  chs = re.findall(r'<button\s*class\s*=\s*"btn.+?name="([^"]+)".+?src="([^"]+/([^\.]+)[^"]+)', page_data)
  channels = []
  for title, thumb, cid in chs:
    turl,secdiv = re.findall(r'{}"\s*value="([^"]+)"'.format(cid), page_data)
    secret = re.findall(r"var\s*{}.+?Date\.now[^']+'([^']+)".format(secdiv), page_data)[0]
    channels.append((title, thumb, turl, secret))
  return channels
]]></expres>
<page>https://www.repretel.com/envivo</page>
</regex>
<regex>
  <name>url</name>
  <expres><![CDATA[#$pyFunction
def GetLSProData(page_data, Cookie_Jar,m):
  import re, requests
  def rsk(s):
    import time
    def decrypt(v1, v2):
      lv2 = len(v2)
      sv2 = list(v2)
      for i in range(lv2-1, -1, -1):
        t1 = i * v1 % lv2
        t2 = sv2[i]
        sv2[i] = sv2[t1]
        sv2[t1] = t2
      s1 = ''.join(sv2)
      s2 = s1[0:lv2 - 2] if s1[lv2 - 2:lv2] == 'OK' else None
      return s2
    tval = int(time.time()/3600)
    t = decrypt(tval, s) or decrypt(tval-1, s)
    return t
  hdr = {'User-Agent': 'iPad'}
  cname = '[makelist.param1]'.lower()
  surl = re.findall(r'{}"\s*:\s*"([^"]+)'.format(cname), page_data)[0]
  turl = '[makelist.param3]'
  secret = '[makelist.param4]'
  turl += rsk(secret)
  token = requests.get(turl, headers=hdr).json()['token']
  surl += '?iut={}'.format(token)
  return surl
]]></expres>
  <page>https://d353843ckd0sex.cloudfront.net/player_cr_repretel.html</page>
</regex>
</item>
 

udomrat

New member
Nov 10, 2016
19
5
3
thailand
Hi. streamwatcher

from this code.(Old forlums)
something wrong with another language and musics don't play. i showed you from pic.

Code:
<item>
<title>http://slider.kz/</title>             
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param3][/COLOR]</title>
  <link>$doregex[getUrl]</link>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests,urllib,xbmcgui,xbmc,xbmcaddon,time
def GetLSProData(page_data, Cookie_Jar,m,itxt='Name of Song:'):#streamwatcher
  addon = xbmcaddon.Addon('plugin.video.live.streamspro')
  addon_version = addon.getAddonInfo('version')
  profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))
  solver = InputWindow(txt=itxt);solution= solver.get()
  list=requests.get('http://slider.kz/vk_auth.php?q=%s'%solution,headers={'user-agent':'Mozilla/5.0','referer':'http://slider.kz/','x-requested-with':'XMLHttpRequest'}).content.replace('\\','')
  return re.findall('"id":"(.*?)".+?":(\d+).+?art":"(.*?)".+?":"(.*?)".+?":"([^"]+)',list)
class InputWindow(xbmcgui.WindowDialog):
  def __init__(self, *args, **kwargs):
     self.txt = kwargs.get('txt','')
     xbmcgui.WindowXMLDialog.__init__(self)
     path = xbmcaddon.Addon().getAddonInfo('path')
     self.kbd = xbmc.Keyboard()
     self.kbd.setHeading( self.txt)
  def get(self):
     self.show()
     time.sleep(2)
     self.kbd.doModal()
     if (self.kbd.isConfirmed()):
        text = self.kbd.getText()
        self.close()
        return text
     self.close()
     return False
]]></expres>
<page></page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,urllib
def GetLSProData(page_data, Cookie_Jar,m):#streamwatcher
  title=urllib.quote_plus('[makelist.param3]')
  return 'http://slider.kz/download/[makelist.param1]/[makelist.param2]/[makelist.param4]/%s.mp3?extra=[makelist.param5]'%title
]]></expres>
<page></page>
</regex>
<thumbnail>http://slider.kz/media/images/logo.png</thumbnail>
</item>
kodi


web


i used kodi 18.3 thai interface.
thank.
 

streamwatcher2013

Well-known member
Oct 24, 2013
914
398
63
USA
I saw many info to load the Thai character with Arialuni or Arial font and I tried on mine and it doen't work even the log show the Thai character but it will not display on the Kodi.
Check it out from regex101. The title shows correctly in the log file but on the Kodi only capture the English title like "Labanoon - Miss Call" and ignore the Thai title. If the title not showing the Thai character then the mp3 won't play

Code:
https://regex101.com/r/WQWDOd/4
 

gujal

Developer
Dec 26, 2013
526
290
63
That is because streamwatcher's code is ripping out the unicode escape and leaving them undecodable. If the code is done correctly, then it looks like this
 
  • Like
Reactions: udomrat

gujal

Developer
Dec 26, 2013
526
290
63
And here is the correct code. The MP3 files are pulled correctly but Kodi complains of some server error.
Code:
<item>
<title>http://slider.kz/</title>            
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param1][/COLOR]</title>
  <link>[makelist.param2]</link>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests,urllib,xbmc
def GetLSProData(page_data, Cookie_Jar,m,itxt='Name of Song:'):
  def get_SearchQuery():
    keyboard = xbmc.Keyboard()
    keyboard.setHeading('Search Song or Artist')
    keyboard.doModal()
    if keyboard.isConfirmed():
        search_text = urllib.quote_plus(keyboard.getText())
    return search_text
  search_text = get_SearchQuery()
  headers = {'User-Agent':'Mozilla/5.0',
             'Referer':'http://slider.kz/',
             'X-Requested-With':'XMLHttpRequest'}
  jd = requests.get('http://slider.kz/vk_auth.php?q=%s'%search_text,headers=headers).json()
  key = jd['audios'].keys()[0]
  tracks = jd['audios'][key]
  songs = []
  surl = 'http://slider.kz/download/{0}/{1}/{2}/{3}.mp3?extra={4}'
  for t in tracks:
    title = t['tit_art'].encode('utf8')
    url = surl.format(t['id'], t['duration'], t['url'], urllib.quote(title), t['extra'])
    songs.append((title, url))
  return songs
]]></expres>
<page></page>
</regex>
<thumbnail>http://slider.kz/media/images/logo.png</thumbnail>
</item>
The fonts are displayed correctly even if system is English and Kodi is English as long as the Kodi font is selected as "Arial based". Below is with system and Kodi in English
 

gujal

Developer
Dec 26, 2013
526
290
63
In the above code, change this line
def GetLSProData(page_data, Cookie_Jar,m,itxt='Name of Song:'): to def GetLSProData(page_data, Cookie_Jar,m): as the variable itxt is not used in my code
Also you can remove re from the imports as it is not used either
 
  • Like
Reactions: udomrat

udomrat

New member
Nov 10, 2016
19
5
3
thailand
thanks streamwatcher2013,gujal

yesterday my friend fixed it from frist code by streamwatcher2013
list=requests.get('hxxp://slider.kz/vk_auth.php?q=%s'%solution,headers={'user-agent':'Mozilla/5.0','referer':'hxxp://slider.kz/','x-requested-with':'XMLHttpRequest'}).content.replace('\\','')
to
list=requests.get('hxxp://slider.kz/vk_auth.php?q=%s'%solution,headers={'user-agent':'Mozilla/5.0','referer':'hxxp://slider.kz/','x-requested-with':'XMLHttpRequest'}).content.decode('unicode-escape')
code complete.
 
Last edited by a moderator:

boomski

New member
Mar 23, 2017
24
1
3
Hi, anyone can help me with this site
hxxp://www.myvideo.ge/tv/
 

gujal

Developer
Dec 26, 2013
526
290
63
Enjoy!


Code:
<item>
<title>MyVideo Georgia</title>
<link>$doregex[makelist]</link>
<thumbnail>https://lh3.googleusercontent.com/o2H3yNdM_su514ZIpLUbg_8QblRKApqGjjaJXXxcrYtEp2tGP29aLVMuT_6rf8Rq1w</thumbnail>
<fanart>https://live-tv-channels.org/pt-data/uploads/logo/ge-myvideo-tv.jpg</fanart>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param1]   [COLOR cyan][I][makelist.param2][/I][/COLOR]</title>
  <link>$doregex[url]</link>
  <thumbnail>[makelist.param3]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data, Cookie_Jar,m):
  import requests
  turl = 'http://api.myvideo.ge/api/v1/auth/token'
  churl = 'http://api.myvideo.ge/api/v1/channel?type=tv'
  headers = {'Referer': 'http://tv.myvideo.ge/',
             'Origin': 'http://tv.myvideo.ge'}
  data = {'client_id': 7,
          'grant_type': 'client_implicit'}
  tdata = requests.post(turl, data=data, headers=headers).json()
  token = '{0} {1}'.format(tdata['token_type'], tdata['access_token'])
  headers.update({'authorization': token})
  items = requests.get(churl, headers=headers).json()['data']
  channels = []
  for item in items:
    slug = item['attributes']['slug']
    name = item['attributes']['name']
    icon = item['relationships']['logo']['data']['relationships']['sizes']['data']['original']['attributes']['url']
    try:
      epg = item['relationships']['currentProgram']['data']['attributes']['name']
    except TypeError:
      epg = ''
    channels.append((name, epg, icon, slug, token))
  return channels
]]></expres>
<page></page>
</regex>
<regex>
<name>url</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data, Cookie_Jar,m):
  import requests
  url = 'http://api.myvideo.ge/api/v1/channel/chunk/{}'.format('[makelist.param4]')
  headers = {'Referer': 'http://tv.myvideo.ge/',
             'Origin': 'http://tv.myvideo.ge',
             'authorization': '[makelist.param5]'}
  item = requests.get(url, headers=headers).json()
  surl = item['data']['attributes']['file']
  return surl
]]></expres>
<page></page>
</regex>
</item>
 

efradncr

Member
Mar 26, 2018
60
1
8
es posible que me ayuden con un código regex para este sitio?
Code:
hxxp://www.tv-onlinehd.com/discovery-home-and-health-en-vivo.html
 

myosmc

Member
May 18, 2018
56
1
8
Have you tried regex this server?
Code:
hxxps://ok.ru/videoembed/1851134909995?nochat=1&autoplay=1
Code:
https://pastebin.com/raw/2uTs7XnW
 

streamwatcher2013

Well-known member
Oct 24, 2013
914
398
63
USA
Try this:

Code:
<item>
<title>https://ok.ru/videoembed/1851134909995</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):
  source=requests.get('https://ok.ru/videoembed/1851134909995').content.replace('&quot;','"')
  return re.findall('hlsMasterPlaylistUrl.+?"(htt[^\?"]+)',source)[0]+'?p|user-agent=iapd&referer=https://ok.ru/videoembed/1851134909995'
]]></expres>
<page></page>
</regex>
</item>
 

gujal

Developer
Dec 26, 2013
526
290
63
Why so serious:p
Code:
<item>
<title>OK.RU</title>
<urlsolve>https://ok.ru/videoembed/1851134909995</urlsolve>
</item>
 

gujal

Developer
Dec 26, 2013
526
290
63
@streamwatcher2013
My code will work on the LSP versions 2.8.3 onwards. LSP v2.8.1 has a bug with urlsolve tag which I fixed in the later versions. And the later versions use ResolveURL instead of URLResolver.
 

omoobatv

New member
Feb 15, 2018
22
0
1
Hi, can someone please help me with this link.

Code:
http://yrsprts.xyz/spr.php?id=skysports1
Thanks
 

gujal

Developer
Dec 26, 2013
526
290
63
Enjoy!

Code:
<item>
  <title>Sky Sports 1</title>
  <link>$doregex[url]</link>
  <thumbnail></thumbnail>
  <regex>
    <name>url</name>
    <expres><![CDATA[#$pyFunction
def GetLSProData(page_data, Cookie_Jar,m):
  import re
  server = re.findall(r"rewrittenUrl\.replace[^,]+.'(//[^/']+/)", page_data)[0]
  var_name, sval = re.findall(r'([A-Za-z]*)\.forEach.+Int[^\d]+(\d+)', page_data)[0]
  vals = re.findall(r'{}=\[([^\]]+)'.format(var_name), page_data)[0]
  items = vals.split(',')
  html = ''
  for item in items:
    html += chr(int(item) - int(sval))
  surl = re.findall(r'source:\s*"([^"]+)', html)[0]
  if surl.startswith('///'):
    surl = 'http:'+ surl.replace('///', server)
  return surl
]]></expres>
    <page>http://yrsprts.xyz/spr.php?id=skysports1</page>
  </regex>
</item>
 
  • Like
Reactions: omoobatv

umonkey

Member
Sep 18, 2012
70
0
6
Good Morning guys and gals,

can anyone regex this site hxxps://www.3donlinefilms.com/

Many Thanks :)
 

umonkey

Member
Sep 18, 2012
70
0
6
Streamwatcher2013 banging the regex out!!
Thanks again my friend this works flawlessly as always. Yes they are 3D movies was building a list of 3D movies and found this site.
Thanks again for your help i just can't seem to get my head around regex.
 

efradncr

Member
Mar 26, 2018
60
1
8
Would you help me start this code?
Code:
<item>
<title>canal 9</title>
<link>https://ar-elnueve-elnueve-live.ned.media/elnueve/smil:elnueve.smil/chunklist_b2200000.m3u8?iut=$doregex[tok]|User-Agent=ipad&Referer=https://www.elnueve.com.ar/en-vivo/</link>
<regex>
  <name>tok</name>
  <expres>"token":"(.*?)"</expres>
  <page>https://past-server.nedp.io/token/ar-elnueve-elnueve?rsk=9263508ca1eb8eb431842ed25a7e62888a9464be</page>
  <referer>https://www.elnueve.com.ar/en-vivo/</referer>
</regex>
</item>
 

gujal

Developer
Dec 26, 2013
526
290
63
That code you have there will never work as the rsk value changes every hour
Here is the correct code. Enjoy!
It will work on LSP 2.9.0 with Kodi 18

Code:
<item>
<title>canal 9</title>
<inputstream>$doregex[url]</inputstream>
<thumbnail>https://www.elnueve.com.ar/wp-content/themes/elnueve-ned-theme/img/logo.png</thumbnail>
<regex>
  <name>url</name>
  <expres><![CDATA[#$pyFunction
def GetLSProData(page_data, Cookie_Jar,m):
  import re, requests
  def rsk(s):
    import time
    def decrypt(v1, v2):
      lv2 = len(v2)
      sv2 = list(v2)
      for i in range(lv2-1, -1, -1):
        t1 = i * v1 % lv2
        t2 = sv2[i]
        sv2[i] = sv2[t1]
        sv2[t1] = t2
      s1 = ''.join(sv2)
      s2 = s1[0:lv2 - 2] if s1[lv2 - 2:lv2] == 'OK' else None
      return s2
    tval = int(time.time()/3600)
    t = decrypt(tval, s) or decrypt(tval-1, s)
    return t
  hdr = {'User-Agent': 'iPad'}
  surl = re.findall("LIVE_URL\s*=\s*'([^']+)", page_data)[0]
  turl = re.findall("jQuery\.get\('([^']+)", page_data)[0]
  secret = re.findall(r"Date\.now[^']+'([^']+)", page_data)[0]
  turl += rsk(secret)
  token = requests.get(turl, headers=hdr).json()['token']
  surl += '?iut={}'.format(token)
  if surl.startswith('//'):
    surl = 'https:' + surl
  return surl
]]></expres>
  <page>https://www.elnueve.com.ar/en-vivo/</page>
</regex>
</item>
 
  • Like
Reactions: phabos

tobotminer

Member
Jan 26, 2018
49
4
8
hi all, i got this code from @streamwatcher2013 last time in old forum. anyone can help me fix it. can call the menu but failed to play.

Code:
<item>
<title>GHOST IN THE SHELL</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>Server: [COLOR gold][makelist.param2][/COLOR]</title>
  <link>$doregex[getUrl]</link>       
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data, Cookie_Jar,m):#streamwatcher
  return re.findall('href="(\?[^"]+).+?"title(?:cur|mor)">[^<]+.+?>([^<]+)',re.findall('class="innermirrorcon">(?s)(.*?)</(?:iframe|IFRAME)',page_data)[0])
]]></expres>
<page>https://animeindo.co/ghost-in-the-shell-arise-border3-ghost-tears/?mirror=3</page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data, Cookie_Jar,m):#streamwatcher
  from urlresolver.plugins.lib import jsunpack   # If you have urlresolver
#  from resolveurl.plugins.lib import jsunpack   # If you have resoleUrl
  url='https://'+re.findall('id="videoplayer"[\w\W]*?(?:source|SOURCE|src|SRC).+?//([^"]+)',page_data)[0]
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':'https://animeindo.co/ghost-in-the-shell-arise-border3-ghost-tears/'}).content.decode('ascii','ignore')
  if 'gdriveplayer' in url:
    packed=re.findall('(eval.*)',source)[0];gm3u8=jsunpack.unpack(packed).replace('\\', '')
    if '1080' in gm3u8:
      return re.findall('label:.720..{4}file:\s*[\'"](h[^\'"]+)',gm3u8)[0]+'|user-agent=ipad'
    elif '720' in gm3u8:
      return re.findall('label:.480..{4}file:\s*[\'"](h[^\'"]+)',gm3u8)[0]+'|user-agent=ipad'
    else:
      return re.findall('label:.360..{4}file:\s*[\'"](h[^\'"]+)',gm3u8)[0]+'|user-agent=ipad'
  elif 'rapidvideo' in url:
    return re.findall('<video[\w\W]*?(?:source|src)=[\'"]([^\'"]+)',source)[0]
  elif 'mp4upload' in url:
    packed=re.findall('(eval.*)',source)[0];gm3u8=jsunpack.unpack(packed).replace('\\', '')
    return re.findall('player.src\("(https:[^"]+)',gm3u8)[0]
  else:
    return source#re.findall('file:\s*[\'"](h[^\'"]+)',source)[0]
]]></expres>
<page>https://animeindo.co/ghost-in-the-shell-arise-border3-ghost-tears/[makelist.param1]</page>
</regex>
</item>
 

tungbeng95

Member
Oct 25, 2018
366
11
18
Hi.Can u help me this regex: hxxp://tvsod.tv/player?tv_id=158
 

adrianhn

New member
Mar 20, 2014
25
4
3
hi , any help with

Code:
hxxps://soloveo.com/foxsports2.php
thks for advance
 

gujal

Developer
Dec 26, 2013
526
290
63
Enjoy!

Code:
<item>
<title>Fox Sports 2</title>
<link>$doregex[url]</link>
<thumbnail></thumbnail>
<regex>
<name>url</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  from resolveurl.plugins.lib import jsunpack
  import re, requests, urllib
  edata = re.findall('(eval\(function\(p,a,c,k,e,d.*)', page_data)[0]
  epage = jsunpack.unpack(edata).replace('\\', '')
  svar = re.findall('location,(\w+),', epage)[0]
  server = re.findall('{}="([^"]+)'.format(svar), epage)[0].decode('base64')
  tsvar, ttvar = re.findall('atob\(([^\)]+)\)\..+?atob\(([^\)]+)', epage)[0]
  tserver = re.findall('{}="([^"]+)'.format(tsvar), epage)[0].decode('base64')[8:]
  ttoken = re.findall('{}="([^"]+)'.format(ttvar), epage)[0].decode('base64')
  turl = 'http://telerium.tv{}{}'.format(tserver,ttoken)
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1',
             'Referer': 'http://telerium.tv/',
             'X-Requested-With': 'XMLHttpRequest'}
  cookies = {'volume': '100',
             'DelMarLaVi': '100'}
  token = requests.get(turl, headers=headers, cookies=cookies).json()[-1][::-1]
  headers.pop('X-Requested-With')
  url='http:{}{}|{}'.format(server,token, urllib.urlencode(headers))
  return url
]]></expres>
<page>http://telerium.tv/embed/53858.html</page>
<referer>http://soloveo.com/foxsports2.php</referer>
</regex>
</item>
 

Download

New member
Jun 16, 2016
19
7
3
Japan
Hi brother, anyone can help me get this play on LPS.
I tried but it can be played.
Code:
<item>
<title>TV</title>
<link>ws://dosod.tv:8081/live/KBS_HD=$doregex[get-url]|User-Agent=iPad</link>
<regex>
  <name>get-url</name>
  <expres>source:\s*'([^']+)</expres>
  <page>http://tvsod.tv/player?tv_id=154</page>
  <referer>http://tvsod.tv/</referer>
</regex>
<thumbnail>http://tvsod.tv/image/1156042132KBS.png</thumbnail>
</item>
Thank you!
 

boomski

New member
Mar 23, 2017
24
1
3
Hi can someone make a regex for this
Code:
https://www.mediaklikk.hu/m4-elo/
Thanks!
 

udomrat

New member
Nov 10, 2016
19
5
3
thailand
Code:
<item>
<title>mtv4</title>
<link>https:$doregex[Url]|User-Agent=iPad</link>
<thumbnail></thumbnail>
<regex>
<name>m3u8</name>
<expres>file": "(.*?)"</expres>
<page>https://player.mediaklikk.hu/playernew/player.php?video=mtv4live</page>
<referer>https://player.mediaklikk.hu/</referer>
<cookieJar></cookieJar>
</regex>
<regex>
<name>Url</name>
<expres>$pyFunction:'$doregex[m3u8]'.replace('\/','/')</expres>
<page></page>
</regex>
</item>
 
  • Like
Reactions: boomski
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5