LSP Regex & Makelist Discussion.

adriansyafiq

Member
Jan 3, 2016
35
2
8
hi gurus,

how do i write the license key for KID and Key correctly for clearkey types?

#KODIPROP:inputstream.adaptive.license_type=org.w3.clearkey
#KODIPROP:inputstream.adaptive.license_key=
 

gujal

Developer
Dec 26, 2013
590
327
63
AFAIK The only DRM that Inputstream adaptive supports is widewine. There is no support for Clearkey, Playready or Fairplay in IA
 

undpnd tqucbo

Member
Jan 25, 2021
160
2
18
Too hard to help me this site?
Code:
https://stream.nbcsports.com/data/live_sources_2002936.json
 

gujal

Developer
Dec 26, 2013
590
327
63
That is not a site but a partial json data file. Unless you provide a webpage which is playing the stream, it is nigh impossible to build the url from a json data file
 

gujal

Developer
Dec 26, 2013
590
327
63
There are three steps happening
1. backend Verizon authentication to get verizon auth token
2. Using Verizon token to request stream token auth from Adobe
3. Adobe stream token auth is passed to Akamai to get the actual stream url with token.

Cant capture the first Verizon auth as it happens on the backend, so cant do it in LSP
 

m5Germany

Active member
Mar 20, 2014
327
105
43
Greetings, Any chance getting the Code for MLB Kategori=6 Looking to change to NFL Kategori=8 when games become avaiable.
When I view source no errors - When I sniff, I get Cloudflare Protection? Would be nice to Code in advance of NFL Season.
Thanks, m5

Here's what I have:
LSP3 XML:
mlb: https://www.streameast.live/AjaxYeni.php?Neresi=Maclar&Sayfa=1&Kategori=6&TakimID=0&ZamanAraligi=-4&Canli=0
nfl: https://www.streameast.live/AjaxYeni.php?Neresi=Maclar&Sayfa=1&Kategori=8&TakimID=0&ZamanAraligi=-4&Canli=0

From: https://www.streameast.live/reddit-mlb-streams/

<item>
<title>new-york-yankees-seattle-mariners</title>
<fanart></fanart>
<thumbnail></thumbnail>
<link>$doregex[m5]|User-Agent=Mozilla/5.0&amp;Accept=*/*&amp;Origin=https://www.streameast.live&amp;Referer=https://www.streameast.live/</link>
<regex>
<name>m5</name>
<expres>source:"([^"]+)</expres>
<page>https://www.streameast.live/mlb/new-york-yankees-seattle-mariners-3/|User-Agent=Mozilla/5.0&amp;Referer=https://www.streameast.live/mlb/new-york-yankees-seattle-mariners-3/</page>
<connection>keep-alive</connection>
<agent>Mozilla/5.0</agent>
<accept>application/json,text/javascript,*/*;q=0.01</accept>
<x-req>XMLHttpRequest</x-req>
<referer>https://www.streameast.live/mlb/new-york-yankees-seattle-mariners-3/</referer>
</regex>
</item>
 

posadka

New member
Jun 10, 2021
14
10
3
You have to have a mlb.com account then we would have to scrape that for the key which changes every 3-4 hours. We can make a script to pull it and then write the stream east site but firs thing is that key
 

m5Germany

Active member
Mar 20, 2014
327
105
43
Info:
Sorry, Can't see that anyone needs to have a mlb.com account in the Code? Please be specific and show screen shots of any error.
You could upload your kodi.log   

https://www.streameast.live/AjaxYeni.php?Neresi=Maclar&Sayfa=1&Kategori=6&TakimID=0&ZamanAraligi=-4&Canli=0

Next opportunity to sniff/Code is MLB Cleveland Indians - Cincinnati Reds 09.08.2021 6:10 PM. m5
 

posadka

New member
Jun 10, 2021
14
10
3
The link that StreamEast is using is a encrypted mlb.com link in order for it to work you need the Auth key from Mlb.Com which is why you have to be a member of it to sniff it out. It is also behind Cloudflare so I added the newest cfscrape to the modules from Venomous but in order for this to work you have to have the token

Code:
<item>
    <title>StreamEast MLB</title>
<link>$doregex[makelist]</link>
<regex>
  <name>makelist</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,url = ''):
    import re
    from resources.lib import cfscrape
    token = ''
    scraper = cfscrape.create_scraper()
    page_data = scraper.get('https://www.streameast.live/mlb/cleveland-indians-cincinnati-reds/').text
    r = re.findall('source:"([^"]+)', page_data)[0]
    r = r.replace('master_desktop_complete_gdfp','5600K/5600_slide')
    return r + '|Cookie=Authorization=' + token
]]></expres>
<page></page>
</regex>
</item>
 
  • Like
Reactions: m5Germany

regixman

Member
May 30, 2018
37
1
8
please help me with this

Code:
https://s1-tv.blogspot.com/p/stream.html?https://tinyurl.com/yytyusdu
 

m5Germany

Active member
Mar 20, 2014
327
105
43
LSP3 XML:
Original Code by Gujal, m5 modified for this channel

<item>
    <title>bein_1.php | teleriumtv.com</title>
    <fanart>https://ohcbrands.com/wp-content/uploads/2018/05/black-background.jpg</fanart>
    <thumbnail>https://assets.bein.com/mena/sites/3/2015/06/beIN_SPORTS1_DIGITAL_Mono.png</thumbnail>
    <link>$doregex[m5]</link>
    <regex>
        <name>m5</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',
      'Accept': '*/*',
      'Origin': 'https://teleriumtv.com',
      'Referer': 'https://teleriumtv.com/embed/55048.html',
      'Cookie': 'volume=0'
    }
    cid = eurl.split('/')[-1].split('.')[0]
    ctime = int(round(time.time(), -1) + 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}55048|{1}'.format(surl, urlencode(headers))
  return
]]>
        </expres>
        <page>https://embed-channel.stream/stream/bein_1.php|Upgrade-Insecure-Requests=1</page>
    </regex>
</item>
 

regixman

Member
May 30, 2018
37
1
8
Code:
https://s1-tv.blogspot.com/p/stream.html?https://tinyurl.com/yytyusdu

does not work makelist
LiveStreampro error
 

tungbeng95

Member
Oct 25, 2018
391
15
18
@regixman try it,working for me
Code:
<item>
<title>Bein Sports 1</title>
<link>$doregex[getURL]</link>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m, url='https://telerium.digital/embed/55048.html'):
  import requests, time, urllib
  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://telerium.digital'}
  atime = '/{0}.json'.format(int((int(time.time()) + 86400) * 1000))
  eurl = url.replace('/embed/', '/streams/').replace('.html', atime)
  r = requests.get(eurl, headers=headers).json()
  strurl = r.get('url')
  if r.get('tokenurl'):
    strurl += requests.get('https://telerium.digital/' + r.get('tokenurl'), headers=headers).json()[10][::-1]
  strurl = strurl if strurl.startswith('http') else 'https:' + strurl
  return strurl + '|{0}'.format(urllib.urlencode(headers))
]]></expres>
<page></page>
</regex>
</item>
 

m5Germany

Active member
Mar 20, 2014
327
105
43
From Post: 1,338
Greetings, Do I need to check my version of cfscrape.py I've only seen it used about 5 times
Seems useful when code requires The latest version I see is cfscrape 2.1.1 Released: Feb 22, 2020
Is this something I have to update or is it included w/ Kodi 19
Does anyone have a working stream which uses cfscrape.create_scraper() so I can see how it works?
Thanks, m5
 

thingy

Member
May 9, 2018
80
1
8
Could you tell me where I'm failing with this regex? tvm
Code:
<item>
<title>[COLORwhite][cine][/COLOR]  </title>
<link>$doregex[url]</link>
<regex>
<name>url</name>
<expres>href="(http.*?)"</expres>
<page>https://S*renotv.com/?action=getembedcode&v=14338</page>
</regex>
<thumbnail></thumbnail><fanart></fanart>
</item>
 

Minde95s

New member
Mar 19, 2021
2
1
3
XML:
<item>
<thumbnail></thumbnail>
<fanart></fanart>
<title>[COLORwhite][cine][/COLOR]  </title>
<link>$doregex[url]</link>
<regex>
<name>url</name>
<expres>href="(http.*?m3u8)"</expres>
<page><![CDATA[https://S*renotv.com/?action=getembedcode&v=14338]]></page>
</regex>
</item>
Here you go, in <expres> you failed to capture stream link, and in <page> I added CDATA so it won't freak out when "&" in address. I'm noob in this too but hey as long as it works.
 

undpnd tqucbo

Member
Jan 25, 2021
160
2
18
@streamwatcher2013 the old code working but no channel apprear.Can please fix it & tk!
Code:
<item>
<title>https://allplay.uz/c/93/luxtv</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>[makelist.param2]</title>
  <link>$doregex[getUrl]</link>
  <thumbnail>[makelist.param4]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://allplay.uz/channel/list',headers={'user-agent':'Mozilla/5.0','referer':'https://allplay.uz/','x-requested-with':'XMLHttpRequest'}).text.replace('\\','')
  return re.findall('"id":(\d+).+?"name":"([^"]+).+?"slug":"([^"]+).+?"url_500x500":"([^"]+)',source)
]]></expres>
<page></page>
</regex>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  return re.findall('"url":"([^"]+)',page_data)[0].replace('\\','')+'|user-agent=ipad&referer=https://allplay.uz/c/[makelist.param1]/[makelist.param3]'
]]></expres>
<page>https://allplay.uz/channel/play/[makelist.param1]</page>
<referer>https://allplay.uz/c/[makelist.param1]/[makelist.param3]</referer>
<x-req>XMLHttpRequest</x-req>
<accept>*/*</accept>
<cookieJar>$doregex[getLogin]</cookieJar>
</regex>
<regex>
<name>getLogin</name>
<expres></expres>
<page>https://allplay.uz/login</page>
<referer>https://allplay.uz/login</referer>
<rawpost>_token=$doregex[logtok]&amp;email=hoanganhkyc2hlbn%40bacninh.edu.vn&amp;password=kyhoang64</rawpost>
<cookieJar></cookieJar>
</regex>
<regex>
<name>logtok</name>
<expres><![CDATA[csrfToken:\s*[\'"]([^\'"]+)]]></expres>
<page>https://allplay.uz/login</page>
<referer>https://allplay.uz/c/93/luxtv</referer>
</regex>
</item>
the page seems redirect for new site: https://allplay.uz/c/93
 

nkt9911

Member
May 22, 2021
39
0
6
USA
Hi.Can possible for the site??
Code:
https://uztv.tv/channels/sport
 

gujal

Developer
Dec 26, 2013
590
327
63
There is a 40,000 line javascript code https://uztv.tv/javascript/shell-content.0e520b9182bffcc01857.bundle.js which contains the logic that genrates the device_id, client_id and push_token required to fetch the stream url. Will take too long to sift through that code to figure out the logic
 

gujal

Developer
Dec 26, 2013
590
327
63
I meant it will take me a long time to figure out the logic as I am not a Javascript developer. Sorry, I cant help
 

nkt9911

Member
May 22, 2021
39
0
6
USA
Maybe i will find someone else who can help me when i just found this .json file:
Code:
https://api.uztv.tv/v1/channels/6f24c0e3-539f-460f-b0c2-8d2d2d0cd9ec/stream.json?expand%5Bstream%5D=analytics&protocol=hls&video_codec=h264&audio_codec=mp4a&drm=spbtvcas&client_id=0b47f1fb-e8e7-4a39-bfc9-e0ee028a3d72&client_version=1.19.2&device_token=589a8ef2-147e-43be-8f0c-fa60795b2dcf&locale=en_US&screen_height=2208&screen_width=1242&timezone=25200
Tks for take look!👆👍
 

m5Germany

Active member
Mar 20, 2014
327
105
43
When I sniff the stream, I do not see the api protocol=hls. I see api drm. So, If value(s) change - my code will fail.
Additionally, since I can't see your api protocol=hls, if code fails, I can not RegEx and/or fix code/write a makelist.
Using your .json - you can write it like this for Kodi 19 w/LSPro3:
LSP3 XML:
<item>
  <title>https://uztv.tv/channels/sport</title>
  <fanart>https://play-lh.googleusercontent.com/hqlSYc72XDjXBYLO1dK8iUOiYcc4sXY6EB-adLeurmsZN7jxokx3yJSV0PJB8KwBWnA</fanart>
  <thumbnail>https://s3.uztv.tv/rosing/8755813b2e1220a6859e.png</thumbnail>
  <inputstream>$doregex[m5]</inputstream>
    <regex>
      <name>m5</name>
      <expres>url":"([^"]+).+p</expres>
      <page><![CDATA[https://api.uztv.tv/v1/channels/6f24c0e3-539f-460f-b0c2-8d2d2d0cd9ec/stream.json?expand%5Bstream%5D=analytics&protocol=hls&video_codec=h264&audio_codec=mp4a&drm=spbtvcas&client_id=0b47f1fb-e8e7-4a39-bfc9-e0ee028a3d72&client_version=1.19.2&device_token=589a8ef2-147e-43be-8f0c-fa60795b2dcf&locale=en_US&screen_height=2208&screen_width=1242&timezone=25200]]></page>
      <connection>keep-alive</connection>
      <agent>Mozilla/5.0</agent>
      <accept>application/json</accept>
      <referer>https://uztv.tv/</referer>
    </regex>
</item>
 
  • Like
Reactions: nkt9911

m5Germany

Active member
Mar 20, 2014
327
105
43
I've tested this in theory. Would someone write the <name>m4</name>? I think that should work. m5
LSP3 XML:
POST https://api.uztv.tv/v1/devices?client_id=66797942-ff54-46cb-a109-3bae7c855370 HTTP/1.1
Host: api.uztv.tv
Connection: keep-alive
Content-Length: 394
sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
Accept: application/json
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36
Content-Type: application/json
Origin: https://uztv.tv
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://uztv.tv/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

{"model":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","os_name":"Windows","device_id":"36a6dad0-8b68-908d-909d-a9206a32781e","push_token":"69a2ad81-f56f-dcfa-f538-7ca9dad3cc3b","os_version":"7","type":"browser","locale":"ru-RU","client_version":"0.0.1","timezone":-14400,"client_id":"66797942-ff54-46cb-a109-3bae7c855370"}


Access-Control-Max-Age: 7200
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
ETag: W/"b59152d84b50f53e3e4bc9b8669dfa12"
Cache-Control: max-age=0, private, must-revalidate
Vary: Origin
X-Request-Id: 05732c97-8350-4fba-b235-0d099c39da16
X-Runtime: 0.012670
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range
Content-Length: 132

{"data":{"device_token":"35518a4b-dfed-41c9-be2b-0d861086bf51","token_type":"bearer","object":"device_token"},"meta":{"status":201}}

<item>
  <title>https://uztv.tv/channels/sport</title>
  <fanart>https://play-lh.googleusercontent.com/hqlSYc72XDjXBYLO1dK8iUOiYcc4sXY6EB-adLeurmsZN7jxokx3yJSV0PJB8KwBWnA</fanart>
  <thumbnail>https://s3.uztv.tv/rosing/8755813b2e1220a6859e.png</thumbnail>
  <inputstream>$doregex[m5]</inputstream>
    <regex>
      <name>m5</name>
      <expres>url":"([^"]+).+p</expres>
      <page><![CDATA[https://api.uztv.tv/v1/channels/6f24c0e3-539f-460f-b0c2-8d2d2d0cd9ec/stream.json?expand%5Bstream%5D=analytics&protocol=hls&video_codec=h264&audio_codec=mp4a&drm=spbtvcas&client_id=0b47f1fb-e8e7-4a39-bfc9-e0ee028a3d72&client_version=1.19.2&device_token=$doregex[m4]&locale=en_US&screen_height=2208&screen_width=1242&timezone=25200]]></page>
      <connection>keep-alive</connection>
      <agent>Mozilla/5.0</agent>
      <accept>application/json</accept>
      <referer>https://uztv.tv/</referer>
    </regex>
    <regex>
      <name>m4</name>
      <expres>device_token":"([^"]+)</expres>
      <page>https://api.uztv.tv/v1/devices?client_id=66797942-ff54-46cb-a109-3bae7c855370</page>
      <Referer>https://uztv.tv/</Referer>
      <Origin>https://uztv.tv</Origin>
      <rawpost>"model":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36","os_name":"Windows","device_id":"36a6dad0-8b68-908d-909d-a9206a32781e","push_token":"69a2ad81-f56f-dcfa-f538-7ca9dad3cc3b","os_version":"7","type":"browser","locale":"ru-RU","client_version":"0.0.1","timezone":-14400,"client_id":"66797942-ff54-46cb-a109-3bae7c855370"</rawpost>
      <cookieJar></cookieJar>
  </regex>
</item>
 

thingy

Member
May 9, 2018
80
1
8
is a regex possible for this site?
Code:
hxxps://live.fc2.com/embedPlayer/?id=58854808&lang=es&suggest=1&thumbnail=1&adultaccess=1
 
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5