LSP Regex & Makelist Discussion.

boul

Member
Nov 24, 2017
34
0
6
hi guru, please need help to this
hxxp://photocall.tv/h7b3/l1?ch=et
Thank
 

makal

Member
Jul 23, 2014
62
16
8
Enjoy!!
Code:
<item>
<title>ET - live</title>
<link>https://etlive-mediapackage-fastly.cbsaavideo.com/dvr/manifest.m3u8</link>
</item>
 
  • Like
Reactions: boul

gladio

New member
Oct 14, 2018
23
3
3
Can you make this page regex .. Thanks

hxxps://www.open-live.org/it/rsi-la-2-diretta-italia-estero/
 

makal

Member
Jul 23, 2014
62
16
8
Enjoy!!
Code:
<item>
<title>ok.ru</title>
<link>$doregex[m3u8]</link>
<regex>
<name>m3u8</name>
<expres>$pyFunction:'$doregex[jsonurl]'.replace('\/','/')</expres>
<page></page>
</regex>
<regex>
<name>jsonurl</name>
<expres>hlsMasterPlaylistUrl.*?\;(https.*?)\\&</expres>
<page>https:$doregex[embed]</page>
<referer>https://easysite.one/z/Player/embed/Native/RsiLa2.php</referer>
<cookieJar></cookieJar>
</regex>
<regex>
<name>embed</name>
<expres>iframe.*?src="(.*?)"</expres>
<page>https://easysite.one/z/Player/embed/Native/RsiLa2.php</page>
<referer>https://www.open-live.org/it/rsi-la-2-diretta-italia-estero/</referer>
<cookieJar></cookieJar>
</regex>
<thumbnail></thumbnail>
</item>
 
  • Like
Reactions: gladio

tobotminer

Member
Jan 26, 2018
49
4
8
hi @gujal , is lsp latest version on your repo can be used on kodi 19?
 

gujal

Developer
Dec 26, 2013
574
318
63
No not yet, will get to it soon. Was busy converting ResolveURL and Videodevil to Kodi 19, which is now completed.
problem with LSP is that it uses 10 year old libraries, some of which are not applicable to Python 3, so will need a rewrite :confused:
 

gujal

Developer
Dec 26, 2013
574
318
63
The idea would be to keep the XML code compatible. the fundamental way LSP parses the XML code needs to be done using different libraries in Python3, as the library BeautifulStoneSoup is not available in Python3
 

tungbeng95

Member
Oct 25, 2018
386
13
18
I need help some this and thanks: hxxps://vertelevision.tv/ver-telemundo-en-vivo-online-gratis-por-internet/
and hxxps://polonia.tvp.pl/sess/TVPlayer2/embed.php?ID=47094327
 

urualf

Member
Jan 19, 2016
42
0
6
need help for open this in lsp thanks in advanced

Code:
hxxps://www.youtube.com/user/piscuajo
 

redota

New member
Jul 3, 2016
23
2
3
thanks for this regex work perfect but my question is , this user in youtube have 406 videos and this regex is not for all video ,is possible all 406 videos open in lsp with this regex?
 

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
@redota

Use this for your case. Increase count's value for more links and pages. I set it to 4 so you should only see 400 videos (1 page=100 videos)

LSP XML:
<item>
<title>Piscuajo</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param1] [COLOR cyan]([makelist.param2])[/COLOR]</title>
  <info>[makelist.param3]</info>
  <urlsolve>https://www.youtube.com/watch?v=[makelist.param4]</urlsolve>
  <thumbnail>https://i.ytimg.com/vi/[makelist.param4]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data, Cookie_Jar, m):#streamwatcher2013
  count=4;pn=1;jdata=[]   # each page contains 100 videos | 4x100=400
  while pn <= int(count):
    source=requests.get('https://www.youtube.com/list_ajax?style=json&action_get_list=1&list=UUbCPvPqkfDJctEBkcnniL_g&index='+str(pn), headers={'user-agent':'Mozilla/5.0'}).json()
    jdata +=source.get('video');pn +=1
    lists=[]
    for j in jdata:
      title=j.get('title')
      vid=j.get('encrypted_id')
      inf=j.get('description')
      dura=j.get('duration')
      lists.append((title,dura,inf,vid))
  return lists
]]></expres>
<page></page>
</regex>
<thumbnail>https://yt3.ggpht.com/a-/AAuE7mB3skyUrW8ehn9dErqXOTojOyfgJH4UtkXs0w=s240-mo-c-c0xffffffff-rj-k-no</thumbnail>
</item>
 
  • Like
Reactions: redota

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
@tobotminer

Don't be seriously. Read above 3 posts #821, #823 and #825. Do you see any of these guys @boul @gladio @nipon0007 following the guideline or they were posting the same way? With me as long as member don't post the live link it should be fine.
 
  • Like
Reactions: nipon0007

gujal

Developer
Dec 26, 2013
574
318
63
two things
1. no live link in forum
2. post inside codebox or icode so that lazy guys like me can copy and paste the link, it is a pain replacing hxxps with https manually :ROFLMAO:
 

tungbeng95

Member
Oct 25, 2018
386
13
18
I sorry. I edit it:
https://polonia.tvp.pl/sess/TVPlayer2/embed.php?ID=47094327
 

gujal

Developer
Dec 26, 2013
574
318
63
Enjoy!

LSP XML:
<item>
<title>TVP Kultura 2</title>
<thumbnail>https://s.tvp.pl/files/portale-v4/tvpkultura/gfx2/logo2.png</thumbnail>
<inputstream>$doregex[getURL]|Origin=https://polonia.tvp.pl&amp;User-Agent=iPad</inputstream>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  strurl = re.findall(r'url":"([^"]+)', page_data)[0]
  return strurl.replace('\\','')
]]></expres>
<page>https://polonia.tvp.pl/sess/TVPlayer2/embed.php?ID=47094327</page>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

tungbeng95

Member
Oct 25, 2018
386
13
18
https://vertelevision.tv/ver-telemundo-en-vivo-online-gratis-por-internet/:
 

gujal

Developer
Dec 26, 2013
574
318
63
Enjoy!

LSP XML:
<item>
<title>Telemundo</title>
<thumbnail></thumbnail>
<link>https:$doregex[getURL]|Origin=https://vergol.com&amp;Referer=https://vergol.com/&amp;User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres>{\s*source:\s*'(.*?)',\s*parent</expres>
<page>https://vergol.com/canales228/live1/telemundo.php</page>
<post>manzana66:12345</post>
<referer>https://vergol.com/</referer>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

elite_commando1

New member
Aug 15, 2020
6
0
1
I can get Fox News working via this post -> https://www.tvaddons.co/community/posts/435330 (e.g. "123tvnow.com/watch/fox-news-hd")

The same code does not work for this link, though -> "123tvnow.com/watch/nhl-network"

Can somebody please assist me in modifying the code in that post to work with the above NHL URL?
Thanks in advance.
 

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
Just make small change and see how it works

Code:
 headers = {'User-Agent': 'iPad',
        'Origin': 'http://123tvnow.com',
        'Referer': 'http://123tvnow.com/'}
  url = requests.get(surl, headers=headers).content
  return re.findall('"file":"(h[^"]+)',url)[0].replace('\\','')
 
  • Friendly
Reactions: elite_commando1

elite_commando1

New member
Aug 15, 2020
6
0
1
hey @streamwatcher2013

can you please try downloading it in LSP via youtube-dl (the accompanying plugin) to see if it works on your end? and if it does, what versions of Kodi/LSP/youtube-dl do you have as mine doesn't seem to download... it says "Download Failed ... ERROR: m3u8 detected but..." (no more detail) and then "failed to move to downloads folder - leaving in temp" in "youtube-dl" prompts. Log file is below:
CPythonInvoker(62): Script invoked without an addon. Adding all addon modules installed to python path as fallback. This behaviour will be removed in future version.
NOTICE: script.module.youtube.dl: youtube_dl core version: 2020.06.16.1
NOTICE: script.module.youtube.dl: DOWNLOAD SERVICE: START
NOTICE: script.module.youtube.dl: Loading from queue. #1 this session
NOTICE: script.module.youtube.dl: DOWNLOAD SERVICE: FINISHED

I have LSP 2.9.6 by Shani on Kodi 18.1
 

gujal

Developer
Dec 26, 2013
574
318
63
Getting youtube-dl to download m3u8 is a mission. You need to setup ffmpeg installed and configured in youtube-dl so that it can capture the individual segments of m3u8 and string them together. I tried it a long while ago but gave up as it doesnt work easily
 
  • Like
Reactions: elite_commando1

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
@elite_commando1

Try this to see it works for you. I set my download folder same as it's configure's path location. If you don't set any thing it should save the file on it's own userdata/.../tmp folder (see image 3&4)

LSP XML:
<item>
<title>Patrick Kane Demo - Ice Time</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import YDStreamUtils,YDStreamExtractor
YDStreamExtractor.disableDASHVideo(True)
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  url='https://www.youtube.com/watch?v=60SO06m1_Ms'
  vid=YDStreamExtractor.getVideoInfo(url,quality=1)  # 2=1080, 1=720, 0=480
  path='I:\Youtube-DL'
  with YDStreamUtils.DownloadProgress() as dlproc:
    try:
       YDStreamExtractor.setOutputCallback(dlproc)
       result=YDStreamExtractor.downloadVideo(vid,path)
       if result:
          full_path_to_file=result.filepath
       elif result.status != 'canceled':
          error_message=result.message
    finally:
       YDStreamExtractor.setOutputCallback(None)
]]></expres>
<page></page>
</regex>
</item>
 
  • Like
Reactions: elite_commando1

tungbeng95

Member
Oct 25, 2018
386
13
18
Can help me this final:
https://www.ligotv4.com/tr/izle/s-sport-2
 

BymemoLee

Member
Apr 30, 2018
92
18
8
HTML:
<item>
<title>[B][COLOR cyan]SSPORT-2[/COLOR][/B]</title>
<link>$doregex[getURL]</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,url = 'https://www.ligotv4.com/tr/channel/s-sport-2'):
   import requests
   import re
   import base64
   source = requests.get(url,headers={'User-Agent':'Mozilla/5.0','Referer':'https://www.ligotv4.com/tr/channel/s-sport-2','Origin':'https://www.ligotv4.com','Content-Type':'text/plain','Accept':'*/*','X-Requested-With':'XMLHttpRequest','X-isApp':'false'}).content
   encoded = base64.b64decode(re.findall('atob\([\'"]([^\'"]+)',source)[0])
   return re.findall('src\s*:\s*[\'"]([^\'"]+)', encoded)[0]+'|User-Agent=Mozilla/5.0&Referer='+url
]]></expres>
<page></page>
<referer></referer>
<cookieJar></cookieJar>
</regex>
</item>
 

Giorgio1v

New member
Jun 10, 2019
6
1
3
good evening is the first time I write, if I have the wrong section forgive me, I ask the masters of the regex if it is possible to extract the code of this page hxxps://zonadeportiva.info/ for LSP.thank you in advance
 
  • Like
Reactions: GIORGIO

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
Try this:

LSP XML:
<item>
<title>https://zonadeportiva.info/</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>([makelist.param2])  [COLOR gold][makelist.param4]][/COLOR] | [makelist.param3]</title>
  <link>$doregex[getUrl]</link>
  <thumbnail>https://zonadeportiva.info/[makelist.param1]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,datetime
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  today=datetime.datetime.now().strftime('%d/%m/%Y')
  tomorrow=datetime.datetime.now()+datetime.timedelta(days=1);tomorrow=tomorrow.strftime('%d/%m/%Y')
  list=re.findall('%s(?s)(.*?)%s'%(today,tomorrow),page_data)[0]
  return re.findall('(?s)<h4.+?url.([^\)]+).+?<b>.+?(\d+.\d+)\s*([^<]+).+?<br>(?:\s*|)([^\n]+).*?href="([^"]+)',list)
]]></expres>
<page>https://zonadeportiva.info/</page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,jsunpack
def GetLSProData(page_data, Cookie_Jar, m):#streamwatcher2013
  link=re.findall('iframe\s*src=[\'"]([^\'"]+)',page_data)[0]
  source=requests.get(link,headers={'user-agent':'Mozilla/5.0','referer':'[makelist.param5]','accept':'*/*'}).content
  if 'p,a,c,k,e,d' in source:
     decod=jsunpack.unpack(re.findall('(eval.*m3u8.*)',source)[0])
     return re.findall('(?:P|p)layer[\w\W]*?(?:source|src|file):\s*[\'"]([^\'"]+)',decod)[0]+'|user-agent=iapd&referer='+link
  elif 'atob' in source:
     return re.findall('atob.[\'"]([^\'"]+)',source)[0].decode('base64')+'|user-agent=iapd&referer='+link
]]></expres>
<page>[makelist.param5]</page>
<referer>https://zonadeportiva.info/</referer>
</regex>
<thumbnail>https://pbs.twimg.com/profile_images/1191867883787296768/vJBioGbU_400x400.jpg</thumbnail>
</item>
 

redota

New member
Jul 3, 2016
23
2
3
please need help with this link

Code:
https://canal11.uy/
Code:
https://5e50264bd6766.streamlock.net:443/canal11ury/videocanal11ury/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9OC8xOS8yMDIwIDEyOjMxOjI2IEFNJmhhc2hfdmFsdWU9aGdBTk1HbHAwNnRJQ09QQlJCUllMUT09JnZhbGlkbWludXRlcz01JmlkPQ==[/code
 

makal

Member
Jul 23, 2014
62
16
8
Enjoy!!
Code:
<item>
<title>canal11</title>
<thumbnail></thumbnail>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres>file:\s"(.*?)"</expres>
<page>https://conceptoweb-studio.com/radio/video/canal11ury/</page>
<referer>https://canal11.uy/</referer>
</regex>
</item>
 
  • Like
Reactions: redota

Lacasitos74

Member
Nov 21, 2016
43
1
8
Hy
Can you help me please with this.
hxxp://www.tvsinacio.com/vip.php

Thanks a lot
 

gujal

Developer
Dec 26, 2013
574
318
63
Enjoy!

LSP XML:
<item>
<title>SportTV</title>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests
  headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3',
             'Referer': 'https://embed.ucplayer.xyz'}
  path = re.findall(r'hlsUrl\s*=\s*"[^"]+"[^"]+"([^"]+)', page_data)[0]
  token = re.findall(r'enable.+?"([^"]+)', page_data)[0]
  token = token[:53] + token[54:]
  lburl, val = re.findall(r'url:\s*"([^"]+)"\s*\+\s*(\d+)', page_data)[0]
  server = requests.get(lburl + val, headers=headers).text.split('=')[-1]
  return 'https://' + server + path + token
]]></expres>
<page>https://embed.ucplayer.xyz/hembedplayer/sp2107/4/640/360</page>
<referer>http://tvdesporto.live/</referer>
</regex>
</item>
 
  • Like
Reactions: Download

TheusZs

New member
Aug 16, 2020
3
0
1
Hello, I managed to solve the problem with Gdrive but the links do not work when placed in a playlist window. Can anybody help me?

LSP CODE:
<item>
<title>MULTILINK VIDEO</title>
<thumbnail></thumbnail>
<link>$doregex[url]|Cookie=$get_cookies$$$lsname=1080p</link>
<link>$doregex[url2]|Cookie=$get_cookies$$$lsname=720p</link>
<link>$doregex[url3]|Cookie=$get_cookies$$$lsname=360p</link>
<regex>
<name>url</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
    import re
    fmturl = re.findall('37\|(.*?)"', page_data)[0].replace('\\u0026', '&').replace('\\u003d', '=')
    return fmturl
]]></expres>
<page>https://drive.google.com/file/d/1eQPJZ1_PqkK-oBdq9NUCjZvKmkUhiz7n/view</page>
<cookieJar></cookieJar>
</regex>
<regex>
<name>url2</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
    import re
    fmturl = re.findall('22\|(.*?),', page_data)[0].replace('\\u0026', '&').replace('\\u003d', '=')
    return fmturl
]]></expres>
<page>https://drive.google.com/file/d/1eQPJZ1_PqkK-oBdq9NUCjZvKmkUhiz7n/view</page>
<cookieJar></cookieJar>
</regex>
<regex>
<name>url3</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
    import re
    fmturl = re.findall('18\|(.*?),', page_data)[0].replace('\\u0026', '&').replace('\\u003d', '=')
    return fmturl
]]></expres>
<page>https://drive.google.com/file/d/1eQPJZ1_PqkK-oBdq9NUCjZvKmkUhiz7n/view</page>
<cookieJar></cookieJar>
</regex>
</item>
 
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5