LSP Regex & Makelist Discussion.

papaya

Member
Apr 4, 2018
41
1
8
hi @gujal

do you know how to parse mpd file and inputstream.adaptive.license_key to lsp?

example :

Code:
inputstream.adaptive.license_key=http://1.9.58.113:8063?deviceId=OTE0ZmFiNmItNmNkYi0zNzZkLWEyYzctMzM0YTc3MWJjZDI4
url=http://1.9.62.158/PLTV/88888888/224/3221227507/3221227507.mpd
 

tungbeng95

Member
Oct 25, 2018
250
7
18
I need help this:
HTML:
http://www.telecongo.tk/tele-congo/
 

gujal

Developer
Dec 26, 2013
446
221
43
Enjoy!

LSP XML:
<item>
<title>Congo TV</title>
<thumbnail>http://telecongo.easybroadcast.fr/wp-content/uploads/2019/08/tvcongo-300x172.png</thumbnail>
<inputstream>https://cdnamd-hls-globecast.akamaized.net/live/ramdisk/congo_tv/hls_video_token/index.m3u8?$doregex[getToken]</inputstream>
<regex>
<name>getToken</name>
<expres>(.*)</expres>
<page>https://token.kube.easybroadcast.fr/akamai/telecongo</page>
<referer>http://www.telecongo.tk/</referer>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

Doom

Member
Sep 16, 2019
197
20
18
@streamwatcher2013 @gujal Code stopped working could i get fix & thanks.
Code:
<item>
<title>televisiongratishd</title>
<link>$doregex[makelist]</link>
<thumbnail></thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param2][/COLOR]</title>
  <link>$doregex[getM3U8]</link>
  <thumbnail>https://www.televisiongratishd.com/img/[makelist.param3].png</thumbnail>
  <fanart>https://3.bp.blogspot.com/-HG6MRbQMVFE/XFLv7CmQcKI/AAAAAAAAB90/HsBpbI_OEOURxauXB8gWJUwrB4vyYHQfACEwYBhgL/s1600/maxresdefault.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):
  list=re.findall('href="(.*?)".*?alt="(.*?)".*?src="img\/(.*?).png"',re.findall('channelstv">(?s)(.*?)desde este lugar',page_data)[0])
  return list
]]></expres>
<page>https://www.televisiongratishd.com/parrilla-gratis.html</page>
</regex>
<regex>
<name>getM3U8</name>
<expres><![CDATA[#$pyFunction
import re,requests,jsunpack
def GetLSProData(page_data,Cookie_Jar,m):
    idlink=re.findall('iframe src="(.*?)"',page_data)[0]
    url=requests.get(idlink,cookies=Cookie_Jar,headers={'user-agent':'Mozilla/5.0','referer':'https://www.televisiongratishd.com/live/[makelist.param3]1.php'}).content
    stream=jsunpack.unpack(re.findall('(eval.*(?:m3u8|mp4).*)',url)[0])
    link=re.findall('source:"(.*?)"',stream)[0]
    return link
]]></expres>
<page>https://www.televisiongratishd.com/live/[makelist.param3]1.php</page>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
Try this:

LSP XML:
<item>
<title>televisiongratishd</title>
<link>$doregex[makelist]</link>
<thumbnail></thumbnail>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param2][/COLOR]</title>
  <link>$doregex[getM3U8]</link>
  <thumbnail>[makelist.param3]</thumbnail>
  <fanart>https://3.bp.blogspot.com/-HG6MRbQMVFE/XFLv7CmQcKI/AAAAAAAAB90/HsBpbI_OEOURxauXB8gWJUwrB4vyYHQfACEwYBhgL/s1600/maxresdefault.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  return re.findall('href="([^"]+).*?alt="([^"]+)\s*en.+?src="([^"]+)',re.findall('channelstv.>(?s)(.*?)desde este lugar',page_data)[0])
]]></expres>
<page>https://www.televisiongratishd.com/parrilla-gratis.html</page>
</regex>
<regex>
<name>getM3U8</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  link=re.findall('(?:href|src)="(.*?/live[^#"]+)',page_data)[0]
  source=requests.get(link,headers={'user-agent':'Mozilla/5.0','referer':'[makelist.param1]'}).content
  stream=re.findall('(?:href|src)="(.*?/live[^#]+)',source)[0]
  source = requests.get(stream,headers={'user-agent':'Mozilla/5.0','referer':'[makelist.param1]'}).content
  return re.findall('id=.player[\w\W]*?(?:source|src|file):.+?[\'"]([^\'"]+)',source)[0]+'|user-agent=ipad&referer='+stream
]]></expres>
<page>[makelist.param1]</page>
</regex>
</item>
 
  • Winner
Reactions: Doom

tungbeng95

Member
Oct 25, 2018
250
7
18
Can help me this code?
HTML:
http://www.elahmad.com/tv/arabic-tv-online.php?id=cnarabia
 

gujal

Developer
Dec 26, 2013
446
221
43
Enjoy!

LSP XML:
<item>
<title>CN Arabia</title>
<link>$doregex[getURL]|User-Agent=iPad&amp;Referer=http://www.elahmad.com/</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  items = re.findall(r'=\s*(\[[^;]+)', page_data)[0]
  items = re.findall(r'"(.+?)"', items)
  spread = int(re.findall(r'_64.+?-\s*(\d+)', page_data)[0])
  srp = ''
  for item in items:
    srp += chr(int(re.sub(r'[^\d]', '', item.decode('base64'))) - spread)
  link = re.findall(r'streamUrl\s*=\s*"([^"]+)', srp)[0]
  return link
]]></expres>
<page>http://www.elahmad.com/tv/arabic-tv-online.php?id=cnarabia</page>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

gujal

Developer
Dec 26, 2013
446
221
43
They have added even more obfuscation. Here is the new code

LSP XML:
<item>
<title>CN Arabia</title>
<link>$doregex[getURL]|User-Agent=iPad&amp;Referer=http://www.elahmad.com/</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  items = re.findall(r'=\s*(\[[^;]+)', page_data)[0]
  items = re.findall(r'"(.+?)"', items)
  spread = int(re.findall(r'_64.+?-\s*(\d+)', page_data)[0])
  srp = ''
  for item in items:
    srp += chr(int(re.sub(r'[^\d]', '', item.decode('base64'))) - spread)
  link = re.search(r'streamUrl\s*=\s*"([^"]+)', srp)
  if link:
    link = link.group(1)
  else:
    link = re.findall(r'parseJwt\("([^"]+)', srp)[0]
    link = link.split(".")[1].replace("-", "+").replace("_", "/")
    link = re.findall('link":"([^"]+)', link.decode('base64'))[0]
    link = link.replace('\\/', '/')
  return link
]]></expres>
<page>http://www.elahmad.com/tv/arabic-tv-online.php?id=cnarabia</page>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

m5Germany

Member
Mar 20, 2014
63
11
8
Sorry for the Nob Question - How is the captured decoded/read?

items = re.findall(r'=\s*(\[[^;]+)', page_data)[0]

var s = ["QjE0VA==", "QTExbA==", "ejYxeg==", "azExNlc=", "RTEwMHg=", "ZTExNXQ=", "ejEwNlQ=", "ZjExM2c=", "cTExN2Q=", "UDYzYQ==", "ajE0SA==", ETC.

As Always, Thanks.
m5
 

gujal

Developer
Dec 26, 2013
446
221
43
@m5Germany Each of the string has to base64 decoded, then pick only the number inside, then subtract the spread value and then treat the resulting number as ascii code and get the character corresponding to that. add all the characters and you get a html source from which you then regex further
 

atlantius21

New member
Aug 12, 2016
13
0
1
Can anybody help me with regex for this page:
Code:
https://steamcommunity.com/?subsection=broadcasts#scrollTop=400
Thanks
 

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
Try this:

LSP XML:
<item>
<title>https://steamcommunity.com</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[COLOR gold][makelist.param3][/COLOR]</title>
  <inputstream>$doregex[getUrl]</inputstream>
  <thumbnail>[makelist.param4]</thumbnail>
  <fanart>https://i.ytimg.com/vi/R_kHcFIeXHc/maxresdefault.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  url='https://steamcommunity.com/apps/allcontenthome/?l=english&browsefilter=trend&browsefilter=trend&appHubSubSection=13&forceanon=1&userreviewsoffset=0&broadcastsoffset=10&p={}'
  headers={'user-agent':'Mozilla/5.0','referer':'https://steamcommunity.com/?subsection=broadcasts','x-requested-with':'XMLHttpRequest','accept':'*/*'}
  data=[]
  for pn in range(1,10):
     source=requests.get(url.format(pn),headers=headers).content
     data +=re.findall('(?s)href="(.+?watch/(\d+[^"]+)).+?CardContentType">([^<]+).+?CardContentPreviewImage"\s*src="([^"]+)',source)
  return data
]]></expres>
<page></page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,json
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  url='https://steamcommunity.com/broadcast/getbroadcastmpd/?steamid=[makelist.param2]'
  return requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':'https://steamcommunity.com/broadcast/watch/[makelist.param2]','accept':'*/*'}).json()['hls_url']
]]></expres>
<page></page>
</regex>
<thumbnail>https://www.gamereactor.eu/media/11/vinterreansteamdragit_1351104b.jpg</thumbnail>
<fanart>https://i.ytimg.com/vi/R_kHcFIeXHc/maxresdefault.jpg</fanart>
</item>
 

thingy

Member
May 9, 2018
56
0
6
is a regex possible for this channel?
Code:
htxxs://megavision.univtec.com/#!/
 

gujal

Developer
Dec 26, 2013
446
221
43
Enjoy!


LSP XML:
<item>
<title>Canal 19 Univtec</title>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import json, requests
  headers = {'User-Agent': 'iPad',
             'Referer': 'https://megavision.univtec.com/'}
  channels = requests.get('https://megavision.univtec.com/api/live/list_channels', headers=headers).json()
  link = ''
  for channel in channels:
    if channel.get('title') == 'Canal 19':
      link = channel.get('HLSBlockedStream').get('url')
  return link
]]></expres>
<page></page>
</regex>
</item>

<item>
<title>Canal 21 Univtec</title>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import json, requests
  headers = {'User-Agent': 'iPad',
             'Referer': 'https://megavision.univtec.com/'}
  channels = requests.get('https://megavision.univtec.com/api/live/list_channels', headers=headers).json()
  link = ''
  for channel in channels:
    if channel.get('title') == 'Canal 21':
      link = channel.get('HLSBlockedStream').get('url')
  return link
]]></expres>
<page></page>
</regex>
</item>
 

thingy

Member
May 9, 2018
56
0
6
is a regex possible for this channel?
Code:
hxxps://canal6.com.hn/envivo
 

gujal

Developer
Dec 26, 2013
446
221
43
Enjoy!

LSP XML:
<item>
<title>Canal 6</title>
<thumbnail>https://cdn.canal6.com.hn/2020/08/unnamed-1.png</thumbnail>
<link>$doregex[getUrl]|User-Agent=iPad</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests, urlparse, jscrypto, random, time
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1',
             'Referer': 'https://canal6.com.hn/envivo'}
  url = 'https://ott.streann.com/s-secure/player.html?U2FsdGVkX18YtSWuAyvPGjbgX03eJfRUX2/GqWUXSJlkxChe2nlNCoJys5+M+zTrqmyaAX9NmzXbplkxo/0vB44TNQ0LHD5MFItofEhRaECc9b1UEnPeEK0x4zs8zDjM2YAqN0DsdOpnBdDLBdHLRi7yu1TEBgj6VzUkqHPoUrQ6cl2cFWVCdcNfSnZKkPVPJKjvpRNeqfrbOAMXgKHTR2DLdYKBxQGTBbHaqQiFdtam73cHw7bHOLvstc1Ilv1GljpEZDM4s7/jxQ80IMniZqxockkFIKMRLAVKdMuLiprRB8iT9+vXbDOR9WljeFNcaW2rJw6z9qt3gf+qxFkweA=='
  lbServerUrl, pars = url.split('?')
  lbServerUrl = 'https://{0}/'.format(urlparse.urlparse(lbServerUrl).netloc)
  secret = "5Y;WhLLj;q~K6{9q"
  pars = jscrypto.decode(pars, secret)
  pars = dict(urlparse.parse_qsl(pars))
  chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  pDeviceId = ''
  for _ in range(50):
    pDeviceId += chars[int(random.random() * len(chars))]
  url = lbServerUrl + "loadbalancer/services/web-players/" + pars['playerId'] + "/token/channel/" + pars['dataId'] + "/" + pDeviceId
  ctime = str(int(time.time()*1000))
  data = {'arg1': 'canal6.com.hn'.encode('base64'),
          'arg2': ctime.encode('base64')}
  cookies = {'deviceId': pDeviceId}
  headers.update({'Referer': lbServerUrl,
                  'X-Requested-With': 'XMLHttpRequest'})
  token = requests.post(url, data=data, cookies=cookies, headers=headers).json().get('token')
  surl = lbServerUrl + "loadbalancer/services/web-players/channels-reseller-secure/" + pars['dataId'] + "/" + pars['playerId'] + "/" + token + "/" + pars['resellerId'] + "/" + "playlist.m3u8"
  qs = {'date': ctime,
        'device-type': 'web',
        'device-name': 'web',
        'device-os': 'web',
        'device-id': pDeviceId}
  headers.pop('X-Requested-With')
  strurl = requests.head(surl, params=qs, cookies=cookies, headers=headers).headers.get('location')
  return strurl
]]></expres>
<page></page>
</regex>
</item>
 

tungbeng95

Member
Oct 25, 2018
250
7
18
I want to help this channel.
HTML:
https://www.npostart.nl/live/npo-politiek
 

gujal

Developer
Dec 26, 2013
446
221
43
Good Challenge. Enjoy!

LSP XML:
<item>
<title>NPO Politiek</title>
<thumbnail>https://www-assets.npo.nl/uploads/tv_channel/282/logo/larger_NPO_Politiek.png</thumbnail>
<inputstream>$doregex[getUrl]</inputstream>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests
  s = requests.session()
  burl = 'https://www.npostart.nl/'
  s.headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1',
             'Referer': burl,
             'X-Requested-With': 'XMLHttpRequest'}
  atoken = s.get(burl + 'api/token').json().get('token')
  token = s.post(burl + 'player/LI_NEDERLAND1_221675', data={'_token': atoken}).json().get('token')
  surl = 'https://start-player.npo.nl/video/LI_NEDERLAND1_221675/streams'
  s.headers.pop('X-Requested-With')
  qs = {'profile': 'dash-widevine',
        'quality': 'npo',
        'tokenId': token,
        'streamType': 'livetv'}
  sd = s.get(surl, params=qs).json().get('stream')
  surl = sd.get('src')
  wv = sd.get('keySystemOptions')[0].get('options')
  xcd = wv.get('httpRequestHeaders').get('x-custom-data')
  lurl = wv.get('licenseUrl')
  return '{0}$$lic={1}|x-custom-data={2}|R{{SSM}}|'.format(surl, lurl, xcd)
]]></expres>
<page></page>
</regex>
</item>
 
  • Winner
Reactions: tungbeng95

tungbeng95

Member
Oct 25, 2018
250
7
18
Wow.You’re wonderful!! I checked this site and see it’s very complicated of code.And I think who must be very good to writing code this site😊
 

m5Germany

Member
Mar 20, 2014
63
11
8
Greeting,

Still trying to figure this .decode stuff out. I've read other Code here that captures the ct":" and s":". Then you take those 2 values and .decode('hex')). That's where I'm stuck. I tried putting those values into a "Online Hex to Text Decoder" and get nothing. I'm obviously missing something in the process.

When time prevails would some Please let me know the proper steps and tools to use to fully understand. No rush - just would like to know.
Info:
str_url = jscrypto.decode(ct, key, salt.decode('hex'))

var encrypted  = '{"ct":"5i9NAVJ3Eq3Sd8UyT30W5+O9Bq23J8i2OL\/c7fIzoUzaK1yseANS4idrryhyMRVsk014GXzg9tUPitV5VrOMUU7x4eV5B9BW8syGHld1q2h1LVTP6udPtxwwTIeo8wRkJZ68A6px8kJc6dQ9jIdIPpu+ey7NZD03OxCzPR5yX1TKeTGSnRfAU0+rIAaINqCmvjqHnI+zBYNKN7bShcxgAazYC2MHzGhWu0R6aK2F5iDiZ0KoiD9dsLMvWbpNZjZncTicWn1LymjBrx4hxu5Dgw==","iv":"2c062e4471c36a7e13ae68954d093228","s":"e07c9bf1e859032e"}';var fallback_encrypted  = '{"ct":"gX8tb7jetV\/RePaN7Iy67o+JBRVrruyBo49woKlJNlGm0foOl1OVdkdc5plED8z4L9XfjSzDZzqjmMGKPKz4JHNiWP\/zkSe1kGqFzYJZx66F6IOhJc0UE7HoPPynycJpA8TFZNJiKboEsxM83Y7\/ATDnW5BpexuVwHYJwLcyYSnJESwlFe7AzEHMl0VOWQ8IJQvaK4\/s+qoTHcTzrTaAeQykUxN0kE5rJf0+KV1wX+zZjG\/tl5w+OmVzHasgiHWo","iv":"d4ddca68c5c7d5daacc0a91414659644","s":"b0a5200efa4d3702"}';var _0x5d5b=['{}.constructor(\x22return\x20this\x22)(\x20)','info','SbGkcemvn8Drj3RX','load','warn','constructor','decrypt','remove','Utf8','length','console','100%','table','Network\x20fatal\x20error.\x20Please\x20reload\x20this\x20page!','toString','log','AES','16:9','player','return\x20(function()\x20','enc','error','parse','apply','bind','__proto__','play','setup','prototype','trace'];(function(_0x5e14c8,_0x5d5bf8){var _0x12ed7e=function(_0x38d91c){while(--_0x38d91c){_0x5e14c8['push'](_0x5e14c8['shift']());}};_0x12ed7e(++_0x5d5bf8);}(_0x5d5b,0x1ef));var _0x12ed=function(_0x5e14c8,_0x5d5bf8){_0x5e14c8=_0x5e14c8-0x0;var _0x12ed7e=_0x5d5b[_0x5e14c8];return _0x12ed7e;};var _0x303129=function(){var _0x54aeec=!![];return function(_0x529c27,_0x1bf128){var _0x5d4c87=_0x54aeec?function(){if(_0x1bf128){var _0x20124b=_0x1bf128[_0x12ed('0x8')](_0x529c27,arguments);return _0x1bf128=null,_0x20124b;}}:function(){};return _0x54aeec=![],_0x5d4c87;};}(),_0x12cca7=_0x303129(this,function(){var _0x2faff4;try{var _0x5598d6=Function(_0x12ed('0x4')+_0x12ed('0xf')+');');_0x2faff4=_0x5598d6();}catch(_0x195a7d){_0x2faff4=window;}var _0x129879=_0x2faff4['console']=_0x2faff4[_0x12ed('0x19')]||{},_0x3279e1=[_0x12ed('0x0'),_0x12ed('0x13'),_0x12ed('0x10'),_0x12ed('0x6'),'exception',_0x12ed('0x1b'),_0x12ed('0xe')];for(var _0x48fdf9=0x0;_0x48fdf9<_0x3279e1[_0x12ed('0x18')];_0x48fdf9++){var _0x25be7b=_0x303129[_0x12ed('0x14')][_0x12ed('0xd')][_0x12ed('0x9')](_0x303129),_0x22acfa=_0x3279e1[_0x48fdf9],_0x3cbd52=_0x129879[_0x22acfa]||_0x25be7b;_0x25be7b[_0x12ed('0xa')]=_0x303129[_0x12ed('0x9')](_0x303129),_0x25be7b['toString']=_0x3cbd52[_0x12ed('0x1d')][_0x12ed('0x9')](_0x3cbd52),_0x129879[_0x22acfa]=_0x25be7b;}});_0x12cca7();var password=_0x12ed('0x11'),decrypted=CryptoJS['AES'][_0x12ed('0x15')](encrypted,password,{'format':CryptoJSAesJson})[_0x12ed('0x1d')](CryptoJS[_0x12ed('0x5')][_0x12ed('0x17')]),password2='HgAZ4LueCj8Pck33',decrypted2=CryptoJS[_0x12ed('0x1')][_0x12ed('0x15')](fallback_encrypted,password2,{'format':CryptoJSAesJson})[_0x12ed('0x1d')](CryptoJS[_0x12ed('0x5')][_0x12ed('0x17')]);r=0x0;var player=jwplayer(_0x12ed('0x3'));player[_0x12ed('0xc')]({'file':JSON[_0x12ed('0x7')](decrypted),'width':_0x12ed('0x1a'),'aspectratio':_0x12ed('0x2'),'autostart':![],'mute':![]}),player['on']('error',function(){r==0x4e20&&(player[_0x12ed('0x16')](),document['getElementById'](_0x12ed('0x3'))['innerHTML']=_0x12ed('0x1c')),setTimeout(function(){player[_0x12ed('0x12')]({'file':JSON[_0x12ed('0x7')](decrypted2)}),player[_0x12ed('0xb')]();},r),r=r+0x1388;});
As Always, Thanks in advance.
m5
 

gujal

Developer
Dec 26, 2013
446
221
43
ct is usually base64 encoded and the jscrypto function accepts ct as base64.
iv and salt are usually hex encoded because they are binary strings and jscrypto expects them in binary format, so you decode iv and salt from hex to binary and feed it to jscrypto
 

m5Germany

Member
Mar 20, 2014
63
11
8
Page: https://ustvgo.tv/fox-news-live-streaming-free/.
It is similar to the Code written for: https://ustv247.tv/foxnewslive/ which I tried to adapt unsuccessfully.
Thanks,
m5
 

thingy

Member
May 9, 2018
56
0
6
Could you help me with a regex for this channel?
Code:
hxxps://www.guatevision.com/en-vivo
 

gujal

Developer
Dec 26, 2013
446
221
43
Good Challenge. Enjoy!

LSP XML:
<item>
<title>Guatevision</title>
<thumbnail>https://www.guatevision.com/wp-content/uploads/sites/2/2019/09/logo-1.png</thumbnail>
<link>$doregex[getUrl]|User-Agent=iPad</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests, jscrypto, random, time
  import urlparse
  headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1',
             'Referer': 'https://www.guatevision.com/en-vivo'}
  url = re.findall("livestream-video.+?src','([^']+)", page_data)[0]
  lbServerUrl, pars = url.split('?')
  lbServerUrl = 'https://{0}/'.format(urlparse.urlparse(lbServerUrl).netloc)
  secret = "5Y;WhLLj;q~K6{9q"
  pars = jscrypto.decode(pars, secret)
  pars = dict(urlparse.parse_qsl(pars))
  chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  pDeviceId = ''
  for _ in range(50):
    pDeviceId += chars[int(random.random() * len(chars))]
  url = lbServerUrl + "loadbalancer/services/web-players/" + pars['playerId'] + "/token/channel/" + pars['dataId'] + "/" + pDeviceId
  ctime = str(int(time.time()*1000))
  data = {'arg1': 'www.guatevision.com'.encode('base64'),
          'arg2': ctime.encode('base64')}
  cookies = {'deviceId': pDeviceId}
  headers.update({'Referer': lbServerUrl,
                  'X-Requested-With': 'XMLHttpRequest'})
  token = requests.post(url, data=data, cookies=cookies, headers=headers).json().get('token')
  surl = lbServerUrl + "loadbalancer/services/web-players/channels-reseller-secure/" + pars['dataId'] + "/" + pars['playerId'] + "/" + token + "/" + pars['resellerId'] + "/" + "playlist.m3u8"
  qs = {'date': ctime,
        'device-type': 'web',
        'device-name': 'web',
        'device-os': 'web',
        'device-id': pDeviceId}
  headers.pop('X-Requested-With')
  strurl = requests.head(surl, params=qs, cookies=cookies, headers=headers).headers.get('location')
  return strurl
]]></expres>
<page>https://www.guatevision.com/en-vivo</page>
</regex>
</item>
 

m5Germany

Member
Mar 20, 2014
63
11
8
Greetings,

I searched for 'pagination' on this and other sites. I don't get it. I am not fluent with writing Python. Would someone Please write a Code to allow going to 'next page'. Here's what I have:
LSP XML:
<item>
<title>[COLOR=FF00FFFF]TEST |[COLOR=FF00FF00] Main Menu - [COLOR=FF00CCFF]iptvcat.com[/COLOR][/COLOR] | RegEx[/COLOR]</title>
<thumbnail>https://iptvcat.com/res/images/logo_iptvcat.png</thumbnail>
<fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR=FF00CCFF]TEST | [COLOR=FF00FF00][makelist.param1] ([COLOR=red][makelist.param2][/COLOR]) [makelist.param3] [COLOR=blue]Mbps[/COLOR][/COLOR] | RegEx[/COLOR]</title>
<link>$doregex[m5]</link>
<thumbnail>https://iptvcat.com/res/images/logo_iptvcat.png</thumbnail>
<fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[(?s)alt="us".*?>" title="([^"]+).*?title="Online".*?"to_hide">([^<]+).*?title="">([^<]+).*?clipboard-text="([^"]+)]]></expres>
<page>https://iptvcat.com/united_states_of_america_</page>
</regex>
<regex>
<name>m5</name>
<expres>$pyFunction: '$doregex[Final]|User-Agent=Mozilla/5.0&amp;Referer=https://iptvcat.com/' if not '$doregex[Final]|User-Agent=Mozilla/5.0&amp;Referer=https://iptvcat.com/'=='' else '$doregex[Final]|User-Agent=iPad&amp;Referer=https://iptvcat.com/' if not '$doregex[Final]|User-Agent=iPad&amp;Referer=https://iptvcat.com/'=='' else '$doregex[Final]|User-Agent=VLC&amp;Referer=https://iptvcat.com/'</expres>
<page></page>
</regex>
<regex>
<name>Final</name>
<expres>$pyFunction:'[makelist.param4]'.replace('?checkedby:iptvcat.com','')</expres>
<page></page>
</regex>
</item>
Thanks,
m5
 

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
@m5Germany
I don't think LSP does the next page. However you can do page by page with the last page info in source. Check the below code:

LSP XML:
<item>
<title>https://iptvcat.com/united_states_of_america_/</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>Page [makelist.param1]</title>
  <link>$doregex[makelist2]</link>
  <thumbnail>https://iptvcat.com/res/images/logo_iptvcat.png</thumbnail>
  <fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):
  lastpg=re.findall('data-ci-pagination-page="(\d+)"><i\s*class',page_data)[0]
  return [(str(pages),) for pages in range(1,int(lastpg)+1)]
]]></expres>
<page>https://iptvcat.com/united_states_of_america_/</page>
</regex>
<regex>
<name>makelist2</name>
<listrepeat><![CDATA[
  <title>[makelist2.param1]</title>
  <link>[makelist2.param2]|user-agent=VLC&amp;referer=https://iptvcat.com/united_states_of_america_/</link>
  <thumbnail>https://iptvcat.com/res/images/logo_iptvcat.png</thumbnail>
  <fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):
  return re.findall('(?s)</div>" title.+?>([^<]+).+?data-clipboard-text="([^"]+)',page_data)
]]></expres>
<page>https://iptvcat.com/united_states_of_america_/[makelist.param1]</page>
</regex>
<thumbnail>https://iptvcat.com/res/images/logo_iptvcat.png</thumbnail>
<fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
</item>
 
  • Like
Reactions: m5Germany and altug

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
@m5Germany

If you like Fox News on the IPTV. Here u go :LOL: . Me too

LSP XML:
<item>
<title>Fox News</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[makelist.param1]</title>
  <link>$doregex[getUrl]</link>
  <thumbnail>https://images-na.ssl-images-amazon.com/images/I/515hrZfxwrL.png</thumbnail>
  <fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):
  return re.findall('</div>"\s*title="([^"]+).>(?s)(.*?)</table',page_data)
]]></expres>
<page>https://iptvcat.com/united_states_of_america_/s/fox_news</page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,xbmcgui
def GetLSProData(page_data,Cookie_Jar,m):
  if '"Online"' in page_data:
    stream=re.findall('data-clipboard-text="([^"]+)',page_data)[0].replace(':8080','')
    if '.ts' in stream:
       return 'plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&name=Fox News&url=%s|user-agent=VLC&origin=https://iptvcat.com&https://iptvcat.com/united_states_of_america_/s/fox_news'%stream
    else:
       return '%s|user-agent=VLC&origin=https://iptvcat.com&https://iptvcat.com/united_states_of_america_/s/fox_news'%stream
  else:
    txt1="IPTVCat - streamwatcher2013"
    txt2="[COLOR lime]\n\n[B]  Live stream is currently not available![/B][/COLOR]"
    return xbmcgui.Dialog().ok(txt1,txt2)
]]></expres>
<page>[makelist.param2]</page>
</regex>
<thumbnail>https://images-na.ssl-images-amazon.com/images/I/515hrZfxwrL.png</thumbnail>
<fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
</item>
 
  • Like
  • Like
Reactions: Catmantx and altug

m5Germany

Member
Mar 20, 2014
63
11
8
Greetings, Took a cursory look at your Code. That's what I was looking to do - f4mTester - but had not gotten there yet. Seems like using
'user-agent=VLC' is not working for me on all streams . Additionally, there are some streams which do not play for me. Here are a couple of streams that do not work with VLC: https://c , http://p , http://b , http://m - at least on my side. Not sure about the 'dialogue box' feature - although might be useful .
I'll take a further look tomorrow.
As Away's, Thanks.
m5
 

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
@m5Germany

I nailed it down to simplest code. It will pick the stream which is online.

LSP XML:
<item>
<title>Fox News - IPTVCAT</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[makelist.param1]</title>
  <link>plugin://plugin.video.f4mTester/?streamtype=TSDOWNLOADER&amp;name=[makelist.param1]&amp;iconImage=https://images-na.ssl-images-amazon.com/images/I/515hrZfxwrL.png&amp;url=[makelist.param2]|user-agent=VLC</link>
  <thumbnail>https://images-na.ssl-images-amazon.com/images/I/515hrZfxwrL.png</thumbnail>
  <fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,urllib
def GetLSProData(page_data,Cookie_Jar,m):
  list=re.findall('"streams_table">(?s)(.*?)</tbody',page_data)[0]  #id="get_stream"
  stream=re.findall('data-clipboard-text="([^"]+)',list)
  for s in stream:
    gstream=urllib.quote_plus(s)
    list=list.replace(s,gstream)
  return re.findall('(?s)</div>"\s*title="([^"]+).{220,250}title="Online".+?data-clipboard-text="([^"]+)',list)
]]></expres>
<page>https://iptvcat.com/united_states_of_america_/s/fox_news</page>
</regex>
<thumbnail>https://images-na.ssl-images-amazon.com/images/I/515hrZfxwrL.png</thumbnail>
<fanart>http://catfishing-uk.com/wp-content/uploads/2020/09/depositphotos_76034327-stock-photo-web-design-concept-iptv-on.jpg</fanart>
</item>
 

Doom

Member
Sep 16, 2019
197
20
18

tungbeng95

Member
Oct 25, 2018
250
7
18
Can help me this code final?
HTML:
http://ontivi.net/sony-channel.html
 

gujal

Developer
Dec 26, 2013
446
221
43
Enjoy!

LSP XML:
<item>
<title>Sony</title>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  link = re.findall("file:'#2([^']+)", page_data)[0]
  link = re.sub('//.{8}', '', link)
  return link.decode('base64')
]]></expres>
<page>http://ontivi.net/open?kes=688df5ff6956d38da0265b28e8f45e0dFF576</page>
</regex>
</item
 
  • Like
Reactions: tungbeng95

gujal

Developer
Dec 26, 2013
446
221
43
The code above needs slight tweaking, here is the updated code
LSP XML:
<item>
<title>Sony</title>
<link>$doregex[getURL]|User-Agent=iPad</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  link = re.findall("file:'#2([^']+)", page_data)[0]
  while '//' in link:
    link = re.sub('//[^/]{8}', '', link)
  return link.decode('base64')
]]></expres>
<page>http://ontivi.net/open?kes=688df5ff6956d38da0265b28e8f45e0dFF576</page>
</regex>
</item>
 
  • Like
Reactions: tungbeng95

m5Germany

Member
Mar 20, 2014
63
11
8
Try This:
LSP XML:
<item>
<title>Sony</title>
<link>$doregex[getURL]|User-Agent=iPad&amp;Referer=http://ontivi.net/</link>
<regex>
<name>getURL</name>
<expres><![CDATA[Playerjs\(\{file:'([^']+)]]></expres>
<page>http://ontivi.net/open?kes=$doregex[kes]</page>
<referer>http://ontivi.net/sony-channel.html</referer>
</regex>
<regex>
<name>kes</name>
<expres><![CDATA[get\("open",\{kes:'([^']+)]]></expres>
<page>http://ontivi.net/sony-channel.html</page>
<referer>http://ontivi.net/</referer>
</regex>
</item>
Enjoy,
m5
 
  • Like
Reactions: tungbeng95

Doom

Member
Sep 16, 2019
197
20
18

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
Try this:

LSP XML:
<item>
<title>subsmovies</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[makelist.param2]</title>
  <link>$doregex[makelist2]</link>
  <thumbnail>https://vignette.wikia.nocookie.net/lionheadthemovies/images/0/0b/The_movies_logo--screenshot_large.jpg</thumbnail>
  <fanart>https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/80-movies-1570826605.png</fanart>
]]></listrepeat>
<expres><![CDATA[(?s)id="menu-item-\d+.+?href="([^"]+).>([^<]+)]]></expres>
<page>https://subsmovies.club/</page>
</regex>
<regex>
<name>makelist2</name>
<listrepeat><![CDATA[
  <title>[makelist2.param2]</title>
  <link>$doregex[getUrl]</link>
  <thumbnail>[makelist2.param3]</thumbnail>
  <fanart>https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/80-movies-1570826605.png</fanart>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  msource=requests.get('[makelist.param1]',headers={'user-agent':'Mozilla/5.0','referer':'https://subsmovies.club/','accept':'*/*'},cookies=Cookie_Jar).content.replace('#038;','')
  if 'class="navigation"' in msource:
    lastpg=re.findall('>(\d+).+\n.+?Next',msource)[0]
    data=re.findall('(?s)"entry-title.+?href="([^"]+).\s*title="([^"]+).+?src="([^"]+)',msource)
    url='[makelist.param1]page/{}/'
    for pn in range(2,int(lastpg)):
       source=requests.get(url.format(pn),headers={'user-agent':'Mozilla/5.0','referer':'[makelist.param1]','accept':'*/*'}).content.replace('#038;','')
       data +=re.findall('(?s)"entry-title.+?href="([^"]+).\s*title="([^"]+).+?src="([^"]+)',source)
    return data
  else:
    return re.findall('(?s)"entry-title.+?href="([^"]+).\s*title="([^"]+).+?src="([^"]+)',msource)
]]></expres>
<page></page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  link=re.findall('src="(.+?video_embed.php[^"]+)',page_data)[0]
  source=requests.get(link,headers={'user-agent':'Mozilla/5.0','referer':'[makelist2.param1]','accept':'*/*'},cookies=Cookie_Jar).content
  url=re.findall('iframe.+?src="([^"]+)',source)[0]
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':link,'accept':'*/*'},cookies=Cookie_Jar).content
  return re.findall('id=.my-video[\w\W]+?(?:source|src|file)="([^"]+)',source)[0]
]]></expres>
<page>[makelist2.param1]</page>
<referer>[makelist.param1]</referer>
</regex>
<thumbnail>https://vignette.wikia.nocookie.net/lionheadthemovies/images/0/0b/The_movies_logo--screenshot_large.jpg</thumbnail>
<fanart>https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/80-movies-1570826605.png</fanart>
</item>
 
  • Winner
Reactions: Doom

aridjana

New member
Mar 3, 2016
1
0
0
Hello a help with this please: hxxps://www.streamaway.net/french-tv
thanks
 

streamwatcher2013

Well-known member
Oct 24, 2013
806
329
63
USA
Try this. Wonder why the gif file won't show on the thumbnail

LSP XML:
<item>
<title>FRENCH Channel</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[makelist.param1]</title>
  <link>$doregex[makelist2]</link>
  <thumbnail>https://liberador.net/media/images/France.tv.max-640x640.jpg</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://www.streamaway.net/french-tv',headers={'user-agent':'Mozilla/5.0','referer':'https://www.streamaway.net/','accept':'*/*'}).content.decode('ascii','ignore')
  return re.findall('1>([^<]+)</h1>(?s)(.+?)(?:<h|footer)',source)
]]></expres>
<page></page>
</regex>
<regex>
<name>makelist2</name>
<listrepeat><![CDATA[
  <title>[makelist2.param2]</title>
  <link>$doregex[getUrl]</link>
  <thumbnail>https://www.streamaway.net[makelist2.param1]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  data=re.findall('gallery-cell.+?src="([^"]+).+?alt="([^"]+).+?src="([^"]+)',page_data)
  return sorted(data,key=lambda t: t[1])
]]></expres>
<page>[makelist.param2]</page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  stream=re.findall('id=.player[\w\W]*?(?:source|src|file):\s*[\'"]([^\'"]+)',page_data)[0]
  if 'nostream' in stream:
     return 'plugin://plugin.video.youtube/play/?video_id=IvHMIRKn8bQ'
  elif 'http' in stream:
     return '%s|user-agent=ipad&referer=https://www.streamaway.net[makelist2.param3]'%stream
  else:
     return 'https://www.streamaway.net%s|user-agent=ipad&referer=https://www.streamaway.net[makelist2.param3]'%stream
]]></expres>
<page>https://www.streamaway.net[makelist2.param3]</page>
<referer>https://www.streamaway.net/french-tv</referer>
</regex>
<thumbnail>https://liberador.net/media/images/France.tv.max-640x640.jpg</thumbnail>
</item>
 

gujal

Developer
Dec 26, 2013
446
221
43
To get the thumbnails,
change this line
Code:
<thumbnail>https://www.streamaway.net[makelist2.param1]</thumbnail>
to this
Code:
<thumbnail>https://www.streamaway.net[makelist2.param1]|User-Agent=iPad</thumbnail>
Also if you dont want screaming all caps in the channel names,
change this line
Code:
<title>[makelist.param1]</title>
to this
Code:
<title>$pyFunction:"[makelist.param1]".title()</title>
and this line
Code:
<title>[makelist2.param2]</title>
to this
Code:
<title>$pyFunction:"[makelist2.param2]".title()</title>
 

cearuchos

New member
Oct 30, 2019
20
1
3
Is it possible to get a Regex for the following....
Code:
hxxp://yoursports.stream/live?v=tvx2
 
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5