LSP Regex & Makelist Discussion.

vbprofi

Member
Feb 9, 2016
82
3
8
Hello dear experts,
I need your help to solve a problem. I want to get to the link of the second stream (Stream 2). Can somebody help me with it?
Code:
https://live-tv-channels.org/livetv/de-cira-tv.html
Many thanks in advance!
 

m5Germany

Active member
Mar 20, 2014
309
97
28
This has been Tested using Kodi 19.1 w/ LSPro ver:3.0.0~alpha4 on Windows 10 system and Android system.
If you are using an older version of Kodi or LSPro you may need to upgrade. I can not retrograde Code.
LSP3 XML:
<item>
<title>de-cira-tv Stream 2</title>
<fanart></fanart>
<thumbnail></thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://karwan.tv&amp;Referer=https://karwan.tv/live/cira-tv.php</link>
<regex>
<name>m5</name>
<expres>source[\w\W]*?src="([^"]+)</expres>
<page>https://karwan.tv/live/cira-tv.php</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://live-tv-channels.org/</referer>
</regex>
</item>
 

nkt9911

Member
May 22, 2021
31
0
6
USA
Hello all.
I need a help from site & tks!
Code:
https://photocall.tv/o6tq/spi?ch=fightbox
 

m5Germany

Active member
Mar 20, 2014
309
97
28
This has been Tested using Kodi 19.1 w/ LSPro ver:3.0.0~alpha4 on Windows 10 system and Android system.
If you are using an older version of Kodi or LSPro you may need to upgrade. I can not retrograde Code.
LSP3 XML:
<item>
<title>FightBox photocall.tv</title>
<fanart>https://www.linuxadictos.com/wp-content/uploads/photocall-tv.jpg</fanart>
<thumbnail>https://ia801801.us.archive.org/34/items/screenshot-20201110-175356-2/Screenshot_20201110-175356~2.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://photocall.tv&amp;Referer=https://photocall.tv/</link>
<regex>
<name>m5</name>
<expres>$pyFunction:base64.b64decode('$doregex[m4]').decode('utf8')</expres>
<page></page>
</regex>
<regex>
<name>m4</name>
<expres>var\s*str\s*=\s*window.atob.'([^']+)</expres>
<page>https://photocall.tv/o6tq/spi?ch=fightbox|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://photocall.tv/</referer>
</regex>
</item>
 
  • Like
Reactions: nkt9911

m5Germany

Active member
Mar 20, 2014
309
97
28
LSP3 XML:
<item>
<title>FightBox photocall.tv</title>
<fanart>https://www.linuxadictos.com/wp-content/uploads/photocall-tv.jpg</fanart>
<thumbnail>https://ia801801.us.archive.org/34/items/screenshot-20201110-175356-2/Screenshot_20201110-175356~2.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://photocall.tv&amp;Referer=https://photocall.tv/</link>
<regex>
<name>m5</name>
<expres>$pyFunction:base64.b64decode('$doregex[m4]').decode('utf8')</expres>
<page></page>
</regex>
<regex>
<name>m4</name>
<expres>var\s*str\s*=\s*window.atob.'([^']+)</expres>
<page>https://photocall.tv/$doregex[m3]|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://photocall.tv/</referer>
</regex>
<regex>
<name>m3</name>
<expres>href="(.*?fightbox)"</expres>
<page>https://photocall.tv/|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
</regex>
</item>
 
  • Like
Reactions: nkt9911

m5Germany

Active member
Mar 20, 2014
309
97
28
See the pattern? The RegEx catures everything after href=" but has to include fightbox, stars, abc6_wpvi, cbssportshq.
So - the RegEx <expres>href="(.*?fightbox)"</expres> captures o6tq/spi?ch=fightbox
So - o6tq/spi?ch="value" "value" being either fightbox, stars, abc6_wpvi, cbssportshq. Should work for most ch=

href="o6tq/spi?ch=fightbox" equal to href="(.*?fightbox)"
href="o6tq/spi?ch=stars" equal to href="(.*?stars)"
href="o6tq/l1?ch=abc6_wpvi" equal to href="(.*?abc6_wpvi)"
href="o6tq/l1?ch=cbssportshq" equal to href="(.*?cbssportshq)"
 

m5Germany

Active member
Mar 20, 2014
309
97
28
There are many way's to write an <expres> for the info you are trying to capture. Here's a funny long one.

href=[\/123'"abc](.{11,13}(?!a-e|A-E|g-z|G-Z)i.{1,2}t(?!A|a|C-Z|c-z)(?:B|b|c|d|C-Z|a|c-z|1-99).{2})[^\w\d\s]

captures o6tq/spi?ch=fightbox
 

cezi1

Member
Aug 1, 2017
31
1
8
Hi gujal can u create the regex code for the 3 movies please?

Code:
https://bit.ly/3l3Se96

https://bit.ly/3moBTLP

https://bit.ly/3FfsQFB

thank you
cezi1
 

skyhigh

Member
Jan 11, 2015
62
1
8
So the first one looks like its a static link, as for the others, there to much pop up ads to dig into it.

Code:
<item>
<title>[COLOR dodgerblue][B]Imagine That[/B][/COLOR]</title>
<link>https://beststreamprovider.xyz/078/tt0780567/1080p.tr.m3u8</link>
<thumbnail>https://www.filmmodu.net/uploads/movie/poster/10932/thumb_lyCTP5C3raH46hJNS9WfBSnWHsG.jpg</thumbnail>
<fanart></fanart>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
Annem (2019)

LSP XML:
<item>
<title>Annem (2019)</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re, requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  mID=re.findall('name="idpost"\s*value="(\d+)',page_data)[0]
  source=requests.get('https://www.setfilmizlee.com/play/play.php?ser=%s&name=SetPlay&partKey='%mID,headers={'user-agent':'Mozilla/5.0','referer':'https://www.setfilmizlee.com/film/annem-izle-2019-yerli-film-full-hd/','accept':'*/*'}).text
  url=re.findall('iframe\s*src="([^"]+)',source)[0]
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':'https://www.setfilmizlee.com/','accept':'*/*'}).text.replace('\\','')
  link=re.findall('"videoSources":.{"file":"([^"]+)',source)[0]
  strurl='https://stfplay.xyz/'+re.findall('(cdn.*)',link)[0]+'?s=2'
  source=requests.get(strurl,headers={'user-agent':'Mozilla/5.0','host':'stfplay.xyz','referer':url,'accept':'*/*'}).text
  if 'x1080' in source:
    return re.findall('x1080.*\n(.*)',source)[0]+'|user-agent=ipad&referer='+url
  elif 'x7200' in source:
    return re.findall('x720.*\n(.*)',source)[0]+'|user-agent=ipad&referer='+url
  else:
    return re.findall('x480.*\n(.*)',source)[0]+'|user-agent=ipad&referer='+url
]]></expres>
<page>https://www.setfilmizlee.com/film/annem-izle-2019-yerli-film-full-hd/</page>
</regex>
</item>
 

undpnd tqucbo

Member
Jan 25, 2021
137
2
18
I need help for site.tk!
Code:
https://netondemand.mt
 

m5Germany

Active member
Mar 20, 2014
309
97
28
This has been Tested using Kodi 19.1 w/ LSPro ver:3.0.0~alpha4 on Windows 10 system and Android 11 system.
If you are using an older version of Kodi or LSPro you may need to upgrade. I can not retrograde Code.
LSP3 XML:
<item>
<title>https://netondemand.mt</title>
<fanart>https://cdn.netnews.com.mt/wp-content/uploads/2019/03/18164243/Webp.net-resizeimage1.jpg</fanart>
<thumbnail>https://netondemand.mt/images/nettv_poster.jpg</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://netondemand.mt&amp;Referer=https://netondemand.mt/</link>
<regex>
<name>m5</name>
<expres>sourceURL":"([^"]+)</expres>
<page>https://netondemand.mt/|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://netondemand.mt/</referer>
<cookiejar>$doregex[m4]</cookiejar>
</regex>
<regex>
<name>m4</name>
<expres></expres>
<page>https://netondemand.mt/episode/live</page>
<accept>*/*</accept>
<x-req>XMLHttpRequest</x-req>
<referer>https://netondemand.mt/</referer>
<cookiejar></cookiejar>
</regex>
</item>
 
  • Like
Reactions: undpnd tqucbo

nkt9911

Member
May 22, 2021
31
0
6
USA
Hello.Can anyone help me for this?
Code:
https://api.euronews.com/v2/apps/iphoneEuronews-3.11/languages/en/livestream
 

m5Germany

Active member
Mar 20, 2014
309
97
28
These (2) Codes are for/from parsatv not euronews.
LSP3 XML:
<item>
<title>Euronews-English | www.parsatv.com | static .m3u8</title>
<fanart>http://www.parsatv.com/index_files/channels/euronews.png</fanart>
<thumbnail>http://www.parsatv.com/index_files/channels/euronews.png</thumbnail>
<link>https://euronews-euronews-world-1-au.samsung.wurl.com/manifest/playlist.m3u8|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=http://www.parsatv.com</link>
</item>

<item>
<title>Euronews-English | www.parsatv.com</title>
<fanart>http://www.parsatv.com/index_files/channels/euronews.png</fanart>
<thumbnail>http://www.parsatv.com/index_files/channels/euronews.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=http://www.parsatv.com</link>
<regex>
<name>m5</name>
<expres>setup.*\n.*?file:\s*"([^"]+)</expres>
<page>https://www.parsatv.com/name=Euronews-English|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://www.parsatv.com/</referer>
<cookiejar>$doregex[getCookie]</cookiejar>
</regex>
<regex>
<name>getCookie</name>
<expres></expres>
<page>https://www.parsatv.com/name=Euronews-English|Upgrade-Insecure-Requests=1</page>
<referer>https://www.parsatv.com/</referer>
<cookiejar></cookiejar>
</regex>
</item>
 

Doom

Member
Sep 16, 2019
318
21
18
Hi guys how can i play this in LSP 19 & thanks
LSP XML:
plugin://plugin.video.sling/?url=http://cbd46b77.cdn.cms.movetv.com/cms/api/channels/6f6788bea06243da873b8b3450b4aaa0/schedule/now/playback_info.qvt&mode=play&name=ABC+News+Live
 

dantas1990

Member
Apr 10, 2020
62
1
8
Hi
Below is the URL of the image. I wonder what's going on. Who uses or tests and please confirm if you can install plugins on KODI 18.9 on windows, it is failing in any add-on you install.

 

gujal

Developer
Dec 26, 2013
574
319
63
Is that Windows PC or XBox?
Kodi on XBox is as of now completely broken because of DST Root X3 CA certificate expiring on 30Sep2021
Kodi have submitted 19.2 to Microsoft to certify and include in the store. 18.9 on XBox will not be fixed and is retired
Kodi 19.2 will showup on the store once Microsoft approves and it could take anywhere upto 2 weeks
 
  • Like
Reactions: dantas1990

undpnd tqucbo

Member
Jan 25, 2021
137
2
18
Can someone help me a site & tk!
Code:
https://www.lared.cl/senal-online
 

m5Germany

Active member
Mar 20, 2014
309
97
28
Seems to work - but - I noticed that the iut= has 54 alphanumeric characters that change\dynamic. Can't see it in the source or Fiddler.
Token is from h tps://past-server.nedp.io/token/cl-lared-lared?rsk=d71019564adb5402b4246a68aaed1e6d39f857c0
Where rsk= is dynamic. Can't see it - so can't RegEx it. Maybe a Python Coder will take a look.
Notice:
iut=eyJwYXJhbXMiOnsiZXhwIjoxNjM0MTM2OTY2LCJzZXNzaW9uIjoiNjguMTM0LjU1LjIwNSIsIndoaXRlbGlzdCI6WyI2OC4xMzQuNTUuMjA1Il19LCJzaWduYXR1cmUiOiJmODViMjU2NzQzZjVkMGQ3ZWEyMjgxN2JjMjQ5MTA2ODczNjFiNjI0In0=
iut=eyJwYXJhbXMiOnsiZXhwIjoxNjM0MTM2MjQ1LCJzZXNzaW9uIjoiNjguMTM0LjU1LjIwNSIsIndoaXRlbGlzdCI6WyI2OC4xMzQuNTUuMjA1Il19LCJzaWduYXR1cmUiOiI0MGY3NmE1OWRiM2RmM2FlY2YzNGRkODIzMGYyYThkMGEyZTAxZTVjIn0=
iut=eyJwYXJhbXMiOnsiZXhwIjoxNjM0MjA1OTE4LCJzZXNzaW9uIjoiNjguMTM0LjU1LjIwNSIsIndoaXRlbGlzdCI6WyI2OC4xMzQuNTUuMjA1Il19LCJzaWduYXR1cmUiOiIzMzBmMGYwZDI2YjYxYzkzMjEzMzRjNzk5ZGFmOWZkNDZkNjk3YTU5In0=
iut=eyJwYXJhbXMiOnsiZXhwIjoxNjM0MjExNTEwLCJzZXNzaW9uIjoiNjguMTM0LjU1LjIwNSIsIndoaXRlbGlzdCI6WyI2OC4xMzQuNTUuMjA1Il19LCJzaWduYXR1cmUiOiIwODkyY2M4ZWQyOGE4YjI3Y2I3MTk5ZmIwMWZiNTc0NzkyNTRlNTczIn0=
LSP3 XML:
<item>
<title>https://www.lared.cl/senal-online</title>
<fanart>https://ohcbrands.com/wp-content/uploads/2018/05/black-background.jpg</fanart>
<thumbnail>https://www.lared.cl/wp-content/themes/lared2021/img/logo-bajada-verde.png</thumbnail>
<link>$doregex[m5]?iut=eyJwYXJhbXMiOnsiZXhwIjoxNjM0MTM2OTY2LCJzZXNzaW9uIjoiNjguMTM0LjU1LjIwNSIsIndoaXRlbGlzdCI6WyI2OC4xMzQuNTUuMjA1Il19LCJzaWduYXR1cmUiOiJmODViMjU2NzQzZjVkMGQ3ZWEyMjgxN2JjMjQ5MTA2ODczNjFiNjI0In0=|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://www.lared.cl&amp;Referer=https://www.lared.cl/&amp;verify=false</link>
<regex>
<name>m5</name>
<expres>LIVE_URL\s*=\s*'([^']+)</expres>
<page>https://www.lared.cl/senal-online|Upgrade-Insecure-Requests=1</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9</accept>
<referer>https://www.lared.cl/</referer>
<cookiejar>$doregex[getCookie]</cookiejar>
</regex>
<regex>
<name>getCookie</name>
<expres></expres>
<page>https://www.lared.cl/senal-online|Upgrade-Insecure-Requests=1</page>
<referer>https://www.lared.cl/</referer>
<cookiejar></cookiejar>
</regex>
</item>
 

regixman

Member
May 30, 2018
37
1
8
does not work anymore
need help.Thank


Code:
<item>
<title>[COLOR white]Bein-Sport-1[/COLOR]</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests, time
  try:
    from urllib.parse import urlencode
  except:
    from urllib import urlencode
 
  eurl = re.findall('<iframe.+?src="([^"]+)', page_data)[0]
  if 'telerium' in eurl:
    headers = {
      'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0',
      'Referer': 'https://teleriumtv.com/'
    }
    cid = eurl.split('/')[-1].split('.')[0]
    ctime = int((time.time() + 86400) * 1000)
    curl = 'https://teleriumtv.com/streams/{0}/{1}.json'.format(cid, ctime)
    r = requests.get(curl, headers=headers).json()
    surl = r.get('url')
    turl = r.get('tokenurl')
    if turl:
      surl += requests.get('https://teleriumtv.com' + turl, headers=headers).json()[10][::-1]
    surl = surl if surl.startswith('http') else 'https:' + surl
    return '{0}|{1}'.format(surl, urlencode(headers))
  return
]]></expres>
<page>https://embed-channel.stream/stream/bein_1.php|Upgrade-Insecure-Requests=1</page>
</regex>
<thumbnail></thumbnail>
</item>
 

streamwatcher2013

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

LSP XML:
<item>
<title>beIN 1</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,jsunpack
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://embed-channel.stream/stream/bein_1.php',headers={'user-agent':'Mozilla/5.0','referer':'https://embed-channel.stream/','accept':'*/*'}).text
  link=re.findall('[^-]+<iframe.src="([^"]+)',source)[0]
  source=requests.get(link,headers={'user-agent':'Mozilla/5.0','referer':'https://embed-channel.stream/stream/bein_1.php','accept':'*/*'}).text
  url=re.findall('<iframe.src="([^"]+)',source)[0]
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':'https://allfoot.info','accept':'*/*'}).text
  strurl=jsunpack.unpack(re.findall('(eval.*m3u8.*)',source)[0])
  return re.findall('var(?:.|)src(?:.|)=(?:.|)"(.+?m3u8[^"]+)',strurl)[0]+'|user-agent=ipad&origin=https://ragnarp.net&referer=https://ragnarp.net/'
]]></expres>
<page></page>
</regex>
</item>
 
  • Like
Reactions: regixman

streamwatcher2013

Well-known member
Oct 24, 2013
962
434
63
USA
Change this line

return re.findall('var(?:.|)src(?:.|)=(?:.|)"(.+?m3u8[^"]+)',strurl)[0]+'|user-agent=ipad&origin=https://ragnarp.net&referer=https://ragnarp.net/'

to this

return re.findall('var(?:.|)src(?:.|)=(?:.|)"(.+?m3u8[^"]+)',strurl)[0]+'|user-agent=ipad&referer='+url
 
  • Like
Reactions: regixman

Catmantx

Member
Nov 2, 2020
67
3
8
Dear @m5Germany ,
You helped me with this code that is pulling list from YT and still works.
HTML:
<item>
<title>[COLOR yellow]MSMBC[/COLOR][COLOR red][B]  [YT][/B][/COLOR]   [Latest]</title>
<thumbnail>https://yt3.ggpht.com/ytc/AKedOLQhAREYb8vSKigSn2-v33vVpvPAcSp1XXzYbup2XJM=s48-c-k-c0x00ffffff-no-rj</thumbnail>
<fanart></fanart>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR cyan]([makelist.param2])[COLOR gold][makelist.param1][/COLOR]</title>
  <info>Telejurnalul orei 20 [makelist.param2]</info>
  <utube>[makelist.param3]</utube>
  <thumbnail>https://i.ytimg.com/vi/[makelist.param3]/hqdefault.jpg</thumbnail>
  <fanart></fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,urllib
def GetLSProData(page_data,Cookie_Jar,m):
  page_data=urllib.urlopen('https://www.youtube.com/playlist?list=PLDIVi-vBsOEzibUME62Me2e9GKQj6G4o1').read()
  jdata=re.findall('"sectionListRenderer":{"contents"(?s)(.*?)id="container"',page_data)[0].replace('\u0026','&').replace('\\','')
  YTid=re.findall('"playlistVideoRenderer":{"videoId":"([^"]+)',jdata)
  title=re.findall('"playlistVideoRenderer":{"videoId":[\w\W]+?"accessibilityData":{"label":"(.+?)\sby',jdata)
  duration=re.findall('"playlistVideoRenderer":{"videoId":[\w\W]+?},"simpleText":"([^"]+)',jdata)
  return zip(title,duration,YTid)
]]></expres>
<page></page>
</regex>
</item>
The problem I encounter for the last 1-2 months it's playback.
It is struggling to play the video and seems to get worts every day.
Played with setting from YT addon with no help. (lowered the quality to 480p).

Can you help, please?

Thank you.

PS: Kodi 18.9
Live Streams Pro2.9.7
 

m5Germany

Active member
Mar 20, 2014
309
97
28
Catmantx, Couple of things. Please ask for Code help to the Forum as a whole - moving forward\in the future.
Secondly, I do not do a lot w/ utube since they require a key/api. Additionally, any Code I write\test will be
written for Kodi 19.1 (until 19.2) w/ LSPro ver: 3.0.0~alpha4 on Windows 10 and Android 11 systems and not
retrograded to earlier versions. So this may\may not work. If Code doesn't work, I can not help any further.

That being said: Since you have a "key/api" try this as I have no way of testing.
LSP3 XML:
<item>
<title>MSNBC Latest</title>
<utube><![CDATA[FTNh3gWq84I&list=PLDIVi-vBsOEzibUME62Me2e9GKQj6G4o1]]></utube>
</item>
 
  • Like
Reactions: Catmantx

thingy

Member
May 9, 2018
76
1
8
this code gives me syntax error in lSP matrix xml, could you help me find the error?
Code:
<item>
<title>Prueba</title>
<link>$doregex[play]|User-Agent=iPad</link>
<regex>
<name>play</name>
<expres><![CDATA[#$pyFunction
import re,requests,urllib
def GetLSProData(page_data,Cookie_Jar,m):
  link = re.findall('"hls":"(.*?)"', page_data)[0].replace('\/','/')
  return link
]]></expres>
<page>https://mdstrm.com/live-stream/5d88dd2229b0890723df2165?jsapi=true&autoplay=false&volume=70</page>
<referer>https://www.telemetro.com/endirecto</referer>
</regex>
<thumbnail>https://upload.wikimedia.org/wikipedia/commons/thumb/1/17/Logo-telemetro.svg/1200px-Logo-telemetro.svg.png</thumbnail>
<fanart>https://www.medcom.com.pa/site/assets/files/1141/telemtro.jpg</fanart>
</item>
 

gujal

Developer
Dec 26, 2013
574
319
63
there are two issues
import re,requests,urllib is the first issue.
Change it to import re

Secondly the page tag has a url that include &. As per XML standards, all bare use instances of & should be replaced with &amp;
 

m5Germany

Active member
Mar 20, 2014
309
97
28
Another way of sayin it:
Knowing that when accessing: h tps://www.telemetro.com/endirecto that I receive: Este contenido no está disponible en tu región
If your Code worked with an older version of LSPro and you are now using LSPro ver: 3.0.0~alpha4 w\ Kodi 19.1 (19.2 is available)
and I have it installed on a Windows 10 PC system. Was able to install over 19.1 w/ no problems as Kodi board expressed.
The one thing I see: LSPro 3-a4 is not as forgiving w/ how Code is written. Meaning - & , < and > must be escaped or enclosed in:
<![CDATA[your value - whatever]]>
Try replacing your:
LSP3 XML:
<page>https://mdstrm.com/live-stream/5d88dd2229b0890723df2165?jsapi=true&autoplay=false&volume=70</page>
to
<page><![CDATA[https://mdstrm.com/live-stream/5d88dd2229b0890723df2165?jsapi=true&autoplay=false&volume=70]]></page>
 

gujal

Developer
Dec 26, 2013
574
319
63
As per XML Standard, this is how you would write it
XML:
<page>https://mdstrm.com/live-stream/5d88dd2229b0890723df2165?jsapi=true&autoplay=false&volume=70</page>
to
<page>https://mdstrm.com/live-stream/5d88dd2229b0890723df2165?jsapi=true&amp;autoplay=false&amp;volume=70</page>
 

undpnd tqucbo

Member
Jan 25, 2021
137
2
18
Can i get help for site & tk.
Code:
https://sepehr.irib.ir/live/play/55
 

m5Germany

Active member
Mar 20, 2014
309
97
28
Please ask the Forum as a whole for help w/ Code.
For your edification - generally - I look at all Code request.
If I do not reply w/ a solution it means that I can not Code a solution and asking me personally will not change that.
That being said - the stream is hidden (made private by site Coder\Owner) meaning that it can not be Coded.
Similar to other Code Obfuscation Techniques like Cloudflare - If I can't access the file containing the info needed,
I can not Code it.
The info to Code the stream is located:
h tps://sepehrapi.irib.ir/v3/channels/?list=55&include_media_resources=true&include_details=true
w/
{"list":[{"id":55,"uid":"tamasha","cuid":69,"name":"\u062a\u0645\u0627\u0634\u0627","number":18,"type":"TV","hd":true,"broadcasting":true,"activated":null,"deactivated":null,"programRecordable":true,"timeshift":true,"pauseAndResume":true,"instantRecordable":true,"voidEpgPopup":false,"ageRating":0,"icon":"h tps:\/\/sepehr.irib.ir\/uploads\/channel\/tamasha-min.png","poster":"h tps:\/\/sepehr.irib.ir\/uploads\/channel\/tamasha-min.png","cover":null,"preview":"h tps:\/\/s-cloud.irib.ir\/img\/preview\/tamasha_lo.jpg","previewDuration":60,"localRecordable":true,"is_favorited":false,"streams":[{"src":"h tps:\/\/s-cloud.irib.ir\/securelive3\/tamasha\/tamasha.m3u8?s=QKp6S3VJLv89DMejd17XzA&t=1634472201","provider":"LiveMajazi_IRIBCDN","protocolStack":"http,hls","location":null,"profiles":null,"capabilities":null,"other":null,"duration":0,"offset":0,"protocol":null,"dialect":null,"oTag":"","signOauth":false,"isPublic":true}],"pipStreams":null,"currentProgram":{"id":99499416,"seriesId":null,"start":1634464326000,"duration":26,"channelId":55,"barred":false,"recordable":true,"ageRating":0,"title":"\u0627\u062f\u0627\u0645\u0647 \u0631\u0648\u06cc\u0627\u06cc \u0641\u0631\u0645\u0627\u0646\u0631\u0648\u0627\u06cc \u0628\u0632\u0631\u06af \u0642\u0633\u0645\u062a38","descSummary":"\u06a9\u0627\u0631\u06af\u0631\u062f\u0627\u0646 : \u0634\u06cc\u0646 \u0686\u0627\u0646\u06af \u0633\u0648\u06a9 \/\u06a9\u06cc\u0645 \u0633\u0627\u0646\u06af \u0647\u0648\u06cc \u2013 \u0628\u0627\u0632\u06cc\u06af\u0631\u0627\u0646 : \u0686\u0648\u06cc \u0633\u0648 \u062c\u0648\u0646\u06af \u060c \u06a9\u06cc\u0645 \u06cc\u0648 \u0633\u0648\u06a9\u060c \u067e\u0627\u0631\u06a9 \u062c\u0648 \u0645\u06cc \u2013 \u0645\u062d\u0635\u0648\u0644 \u0633\u0627\u0644 2012\u06a9\u0634\u0648\u0631 \u06a9\u0631\u0647 \u062c\u0646\u0648\u0628\u06cc","descFull":"\u06a9\u0627\u0631\u06af\u0631\u062f\u0627\u0646 : \u0634\u06cc\u0646 \u0686\u0627\u0646\u06af \u0633\u0648\u06a9 \/\u06a9\u06cc\u0645 \u0633\u0627\u0646\u06af \u0647\u0648\u06cc \u2013 \u0628\u0627\u0632\u06cc\u06af\u0631\u0627\u0646 : \u0686\u0648\u06cc \u0633\u0648 \u062c\u0648\u0646\u06af \u060c \u06a9\u06cc\u0645 \u06cc\u0648 \u0633\u0648\u06a9\u060c \u067e\u0627\u0631\u06a9 \u062c\u0648 \u0645\u06cc \u2013 \u0645\u062d\u0635\u0648\u0644 \u0633\u0627\u0644 2012\u06a9\u0634\u0648\u0631 \u06a9\u0631\u0647 \u062c\u0646\u0648\u0628\u06cc","imageUrl":null,"current":true,"state":"now"}}],"rowCount":1,"pageNumber":1,"pageSize":500,"nextPageLink":null}

Look at "streams":[{"src":" - in the Code above.

Can see it - but - can not Code it.
 
  • Like
Reactions: undpnd tqucbo

streamwatcher2013

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

On requests.get you need to feed all the authorization key,token, signature values...... to the server and that is the tough part may be from javascript before you can get that stream value.
"streams":[{"src":"h ttps://s-cloud.irib.ir/securelive3/tamasha/tamasha.m3u8?s=Q4rOKDAi63br00xulzFU7g&t=1634577119"



LSP XML:
https://sepehrapi.irib.ir/v3/channels/?list=55&include_media_resources=true&include_details=true
GET /v3/channels/?list=55&include_media_resources=true&include_details=true HTTP/1.1
Host: sepehrapi.irib.ir
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Origin: https://sepehr.irib.ir
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
Authorization: OAuth oauth_consumer_key="84ALFkdjpBX0DSR3DsaLo364lKs1hTGq", oauth_nonce="Do6dcdspOnCXkkkOWboWkIZVpVWwuZDd", oauth_signature="OGUzYWY4NGE2ZTE2YzRmOTJjMmY3YTA0MTFmZjc3ODUzNjIwMTJhZg%3D%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1634569918", oauth_token="b49255684ad9347386d890a04a642bfa7052d69ca568938b622ca7d84ed93972", oauth_version="1.0"
Referer: https://sepehr.irib.ir/
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
 

undpnd tqucbo

Member
Jan 25, 2021
137
2
18
Can you help me for site & tk!

Code:
https://www.tvm.com.mt/mt/tvmi/live/tvm/
 

m5Germany

Active member
Mar 20, 2014
309
97
28
Coded from the api. Too many variables for me to Code back to Original Page and will need someone to write Python.
Additionally, there are (two) resolutions. chunklist_b928000 RESOLUTION=640x360 and chunklist_b2128000.m3u8 RESOLUTION=1280x720
1st Code will play either RESOLUTION (depending on your connection speed\server) and 2nd will play only RESOLUTION=1280x720
LSP3 XML:
<item>
<title>TVM  www.tvm.com.mt</title>
<fanart>https://ohcbrands.com/wp-content/uploads/2018/05/black-background.jpg</fanart>
<thumbnail>https://assets.tvm.com.mt/mt/wp-content/themes/tvm/dist/images/tvm-logo-2021.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://media.tvm.com.mt&amp;Referer=https://media.tvm.com.mt/</link>
<regex>
<name>m5</name>
<expres>text.*?event",\s*"hls_url":\s*"([^"]+)</expres>
<page><![CDATA[https://media.tvm.com.mt/api/concatenate?callback=visualplatformconcat_0&format=json&playersettings_0=/api/player/settings?player_id=0&parameters=source=embed&live_id=71154069&tvm_location=tvm1_live&livelist_1=/api/live/list?include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&upcoming_p=1&ordering=streaming&player_id=0&photolist_2=/api/photo/list?size=10&include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&player_id=0]]></page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>*/*</accept>
<referer><![CDATA[https://media.tvm.com.mt/v.ihtml/player.html?source=embed&live_id=71154069&tvm_location=tvm1_live]]></referer>
</regex>
</item>

<item>
<title>TVM  www.tvm.com.mt RESOLUTION=1280x720</title>
<fanart>https://ohcbrands.com/wp-content/uploads/2018/05/black-background.jpg</fanart>
<thumbnail>https://assets.tvm.com.mt/mt/wp-content/themes/tvm/dist/images/tvm-logo-2021.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://media.tvm.com.mt&amp;Referer=https://media.tvm.com.mt/</link>
<regex>
<name>m5</name>
<expres>$pyFunction:'$doregex[m4]'.replace('playlist','chunklist_b2128000')</expres>
<page />
</regex>
<regex>
<name>m4</name>
<expres>text.*?event",\s*"hls_url":\s*"([^"]+)</expres>
<page><![CDATA[https://media.tvm.com.mt/api/concatenate?callback=visualplatformconcat_0&format=json&playersettings_0=/api/player/settings?player_id=0&parameters=source=embed&live_id=71154069&tvm_location=tvm1_live&livelist_1=/api/live/list?include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&upcoming_p=1&ordering=streaming&player_id=0&photolist_2=/api/photo/list?size=10&include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&player_id=0]]></page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>*/*</accept>
<referer><![CDATA[https://media.tvm.com.mt/v.ihtml/player.html?source=embed&live_id=71154069&tvm_location=tvm1_live]]></referer>
</regex>
</item>
 
  • Like
Reactions: undpnd tqucbo

gujal

Developer
Dec 26, 2013
574
319
63
@m5Germany You were close :)
Enjoy!

LSP XML:
<item>
<title>TVM  www.tvm.com.mt</title>
<fanart>https://ohcbrands.com/wp-content/uploads/2018/05/black-background.jpg</fanart>
<thumbnail>https://assets.tvm.com.mt/mt/wp-content/themes/tvm/dist/images/tvm-logo-2021.png</thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Referer=https://media.tvm.com.mt/</link>
<regex>
<name>m5</name>
<expres>hls_url="([^"]+)</expres>
<page>https://media.tvm.com.mt/api/live/list?live_id=$doregex[m4]</page>
</regex>
<regex>
<name>m4</name>
<expres>live_id=(\d+)</expres>
<page>https://www.tvm.com.mt/mt/tvmi/live/tvm/</page>
</regex>
</item>
 
  • Like
Reactions: undpnd tqucbo

m5Germany

Active member
Mar 20, 2014
309
97
28
Hmmm, Interesting. Using Fiddler it never captured:
h tps://media.tvm.com.mt/api/live/list?live_id=71154069
Would you share how you deducted\captured that value?
 

gujal

Developer
Dec 26, 2013
574
319
63
It is just a bit of creative thinking ;)
you had the page as
hxxps://media.tvm.com.mt/api/concatenate?callback=visualplatformconcat_0&format=json&playersettings_0=/api/player/settings?player_id=0&parameters=source=embed&live_id=71154069&tvm_location=tvm1_live&livelist_1=/api/live/list?include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&upcoming_p=1&ordering=streaming&player_id=0&photolist_2=/api/photo/list?size=10&include_actions_p=1&source=embed&live_id=71154069&tvm_location=tvm1_live&player_id=0

I just used that highlighted stuff
 
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5