LSP Regex & Makelist Discussion.

tpoupi

Member
Jan 2, 2016
38
0
6
hi need regex please, thank for all.
hxxp://sentv.sn/direct#idscroll
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
Try this:

LSP XML:
<item>
<title>SenTV en Direct</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import json
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
   jdata=json.loads(page_data)
   return jdata['allitems'][0]['stream_url']+'|user-agent=ipad&origin=http://sentv.sn&referer=http://sentv.sn/direct'
]]></expres>
<page>https://sentv.acangroup.org/webapi/listLiveTV/json</page>
<referer>http://sentv.sn/direct</referer>
</regex>
<thumbnail>https://senego.com/wp-content/uploads/2019/02/sen-tv.jpg</thumbnail>
</item>
 
  • Like
Reactions: tpoupi

aridjana

New member
Mar 3, 2016
10
0
1
Hi guru, need regex for this :


hxxps://www.streamaway.net/hls/stream.php/http://edge9.iptvnetwork.net/live/france3/chunks.m3u8?nimblesessionid=208799295&wmsAuthSign=c2VydmVyX3RpbWU9My8yNS8yMDIxIDE6MzE6MTYgQU0maGFzaF92YWx1ZT1iV3lNUlYyYkZlQTlETjAwREk3cC9RPT0mdmFsaWRtaW51dGVzPTEw


from: hxxps://www.streamaway.net/french-tv

Thanks
 

aridjana

New member
Mar 3, 2016
10
0
1
Hi guru, need regex for this :


hxxps://www.streamaway.net/hls/stream.php/http://edge9.iptvnetwork.net/live/france3/chunks.m3u8?nimblesessionid=208799295&wmsAuthSign=c2VydmVyX3RpbWU9My8yNS8yMDIxIDE6MzE6MTYgQU0maGFzaF92YWx1ZT1iV3lNUlYyYkZlQTlETjAwREk3cC9RPT0mdmFsaWRtaW51dGVzPTEw


from: hxxps://www.streamaway.net/french-tv

Thanks
 

m5Germany

Active member
Mar 20, 2014
326
105
43
LSP XML:
<item>
<title>France 3 | streamaway.net</title>
<link>https://www.streamaway.net$doregex[m5]|User-Agent=Mozilla/5.0&amp;Referer=https://www.streamaway.net/</link>
<fanart></fanart>
<thumbnail>https://d24j9r7lck9cin.cloudfront.net/l/o/6/6840.1517257096.png</thumbnail>
<regex>
<name>m5</name>
<expres>source:\s*'([^']+)</expres>
<page>https://www.streamaway.net/fr/France3.php</page>
<referer>https://www.streamaway.net/french-tv</referer>
</regex>
</item>
m5
 

undpnd tqucbo

Member
Jan 25, 2021
157
2
18
Could I get help for 2 sites and tk...
Code:
hxxps://www.realmadrid.com/real-madrid-tv
hxxps://barcatvplus.fcbarcelona.com/es/live
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
Try this:

LSP XML:
<item>
<title>https://www.realmadrid.com/real-madrid-tv</title>
<inputstream>$doregex[getUrl]</inputstream>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  url='https://www.realmadrid.com/sv-st-rmtv?cp='+re.findall('data-sv=.(\d+)',page_data)[0]
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','referer':'https://www.realmadrid.com/real-madrid-tv'}).content
  return re.findall('es":"([^"]+)',source)[0]+'|user-agent=ipad&origin=https://www.realmadrid.com&referer=https://www.realmadrid.com/real-madrid-tv'
]]></expres>
<page>https://www.realmadrid.com/real-madrid-tv</page>
<referer>https://www.realmadrid.com/</referer>
</regex>
<thumbnail>https://cdn.cookielaw.org/logos/c046eb22-33d5-43cd-9e7b-28a54872fef2/420d22d9-3d74-4914-9f3d-29bfe7571867/acce18c5-183c-45e9-a9f7-e6ed0f2f776b/header_logo.jpg</thumbnail>
</item>

<item>
<title>https://barcatvplus.fcbarcelona.com/es/live</title>
<inputstream>$doregex[getUrl]</inputstream>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  url='https://token.fcb.pulselive.com/videotoken/'+re.findall('data-video-id=.(\d+)|$',page_data)[0]+'?memberUuid=&lang=es'
  source=requests.get(url,headers={'user-agent':'Mozilla/5.0','origin':'https://barcatvplus.fcbarcelona.com','referer':'https://barcatvplus.fcbarcelona.com/es/live'}).content
  link='https://open.http.mp.streamamg.com/p/3000707/sp/300070700/playManifest/entryId/0_fcq6zq7g/format/applehttp/protocol/https/uiConfId/30025311/a.m3u8?ks='+re.findall('ks":"([^"]+)',source)[0]
  m3u8=requests.get(link,headers={'user-agent':'Mozilla/5.0','referer':'https://barcatvplus.fcbarcelona.com/es/live'},allow_redirects=False).url
  return '%s|user-agent=ipad&referer=https://barcatvplus.fcbarcelona.com/es/live'%m3u8
]]></expres>
<page>https://barcatvplus.fcbarcelona.com/es/live</page>
</regex>
<thumbnail>https://barcatvplus.fcbarcelona.com/resources/v2.17.1-3917/i/favicon/favicon-196x196.png</thumbnail>
</item>
 

tungbeng95

Member
Oct 25, 2018
391
15
18
@m5Germany I need you help me fix my code...I understand why it not working for me.
Code:
<item>
<title>https://ethiov.com/single-channel/114</title>
<link>$doregex[getUrl]|User-Agent=Mozilla/5.0</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  return re.findall('var\s*src=[\'"]([^\'"]+)',source)[0]
]]></expres>
<page>https://ethiov.com/single-channel/114</page>
</regex>
</item>
 

PinkWave

New member
Jan 24, 2021
25
2
3
Hi to everybody
Someone can help me with tihis?

hxxps://mailocal2.xyz/lv/rsi-la-2/
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
It pull off stream from the other site. Try this:

LSP XML:
<item>
<title>Rai 2</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  cname=re.findall('channel=.([^\'"]+)',page_data)[0]
  source=requests.get('https://www.janjua.tv/hembedplayer/%s/3/800/456'%cname,headers={'user-agent':'Mozilla/5.0','referer':'https://easysite.one/z/Player/embed/Native/Rai2.php','accept':'*/*'}).content
  tok,lhtml,ids=re.findall('enableVideo.[\'"]([^\'"]+)[\w\W]+?ajax..url.+?[\'"](.+?\?(\d+))',source)[0]
  source=requests.get(lhtml,headers={'user-agent':'Mozilla/5.0','referer':'https://www.janjua.tv/hembedplayer/%s/3/800/456'%cname,'accept':'*/*'}).content
  m3u8='https://'+re.findall('=(.*)',source)[0]+':8088/live/%s/playlist.m3u8?id=%s&pk=%s'%(cname,ids,tok)
  return '%s|user-agent=ipad&referer=https://www.janjua.tv/hembedplayer/%s/3/800/456'%(m3u8,cname)
]]></expres>
<page>https://easysite.one/z/Player/embed/Native/Rai2.php</page>
<referer>https://www.livehere.one/rai-2-in-diretta-streaming/</referer>
</regex>
<thumbnail>https://www.easysite.one/img/Rai2.png</thumbnail>
</item>
 

Doom

Member
Sep 16, 2019
321
21
18
Could someone help me with a makelist and thanks!
hxxps://adictosalatele.com/
 

m5Germany

Active member
Mar 20, 2014
326
105
43
This is Coded for LSP 2.9.7 Kodi 18.* For LSP3 Kodi 19.0 you will need to replace:

<expres>$pyFunction:'$doregex[m6]' if '$doregex[m6]' != '' else 'https://www.streamaway.net/nostream/interlude.mp4'</expres>

Then fiquire out how to write this: <expres>$pyFunction:'$doregex[m5]'.replace('&','&amp;')</expres>

& is a special character and I do not know how to write it for LSP3.
LSP XML:
<item>
<title>[COLOR=FF00FFFF]Main Menu [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] adictosalatele.com[/COLOR][/COLOR]</title>
<fanart></fanart>
<thumbnail></thumbnail>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR=FF00FFFF][makelist.param2] [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] adictosalatele.com[/COLOR][/COLOR]</title>
<fanart></fanart>
<thumbnail>https://adictosalatele.com[makelist.param3]</thumbnail>
<link>$doregex[SelectServer]|user-agent=Mozilla/5.0&amp;origin=https://wigistream.to&amp;referer=https://wigistream.to/</link>
]]></listrepeat>
<expres>f="([^"]+).*?e="([^"]+)\se.*?c="([^"]+png)</expres>
<page>https://adictosalatele.com</page>
</regex>
<regex>
<name>SelectServer</name>
<expres>$pyFunction:'$doregex[m6]' if not '$doregex[m6]'=='' else 'https://www.streamaway.net/nostream/interlude.mp4'</expres>
<page></page>
</regex>
<regex>
<name>m6</name>
<expres>$pyFunction:'$doregex[m5]'.replace('&','&amp;')</expres>
<page></page>
</regex>
<regex>
<name>m5</name>
<expres>e:"([^"]+)",\w</expres>
<page>$doregex[m4]</page>   
<referer>https://wigistream.to/</referer>
</regex>
<regex>
<name>m4</name>
<expres>$pyFunction:get_unpacked(page_data,'(eval.*m3u8.*)')</expres>
<page>$doregex[m3]</page>   
<referer>https://adictosalatele.com/</referer>
</regex>
<regex>
<name>m3</name>
<expres>e\s*src="([^"]+)</expres>
<page>https:$doregex[m2]</page>   
<referer>https://adictosalatele.com/</referer>
</regex>
<regex>
<name>m2</name>
<expres><![CDATA[video"><iframe.*?0"\s*src="([^"]+)"></i]]></expres>
<page>https:[makelist.param1]</page>
<referer>https://adictosalatele.com/</referer>
</regex>
</item>
 

m5Germany

Active member
Mar 20, 2014
326
105
43
Couple of things: Would someone Please see if you can Load this as a Source in LSP3? Won't let me on my side.

https://pastebin.com/raw/kKiCAjtg [Code expires in a week].

Secondly, still can't get this to play in LSP3 w/ Kodi 19.0.
LSP3 XML:
<item>
<title>[COLOR=FF00FFFF]Menu [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] adictosalatele.com[/COLOR][/COLOR]</title>
<fanart></fanart>
<thumbnail></thumbnail>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR=FF00FFFF][makelist.param2] [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] adictosalatele.com[/COLOR][/COLOR]</title>
<fanart></fanart>
<thumbnail>https://adictosalatele.com[makelist.param3]</thumbnail>
<link>$doregex[SelectServer]|user-agent=Mozilla/5.0&amp;origin=https://wigistream.to&amp;referer=https://wigistream.to/</link>
]]></listrepeat>
<expres>f="([^"]+).*?e="([^"]+)\se.*?c="([^"]+png)</expres>
<page>https://adictosalatele.com</page>
</regex>
<regex>
<name>SelectServer</name>
<expres>$pyFunction:'$doregex[m6]' if '$doregex[m6]' != '' else 'https://www.streamaway.net/nostream/interlude.mp4'</expres>
<page></page>
</regex>
<regex>
<name>m6</name>
<expres><![CDATA[$pyFunction:'$doregex[m5]'.replace('&','&amp;')]]></expres>
<page></page>
</regex>
<regex>
<name>m5</name>
<expres>e:"([^"]+)",\w</expres>
<page>$doregex[m4]</page>   
<referer>https://wigistream.to/</referer>
</regex>
<regex>
<name>m4</name>
<expres>$pyFunction:get_unpacked(page_data,'(eval.*m3u8.*)')</expres>
<page>$doregex[m3]</page>   
<referer>https://adictosalatele.com/</referer>
</regex>
<regex>
<name>m3</name>
<expres>e\s*src="([^"]+)</expres>
<page>https:$doregex[m2]</page>   
<referer>https://adictosalatele.com/</referer>
</regex>
<regex>
<name>m2</name>
<expres><![CDATA[video"><iframe.*?0"\s*src="([^"]+)"></i]]></expres>
<page>https:[makelist.param1]</page>
<referer>https://adictosalatele.com/</referer>
</regex>
</item>
As Alway's, Thanks.
m5
 

skyhigh

Member
Jan 11, 2015
62
1
8
Hi, could this site get a regex makelist, some good tvshows. Thanks if you decide to do one :)

h**ps://midget.vip/
 

gujal

Developer
Dec 26, 2013
590
326
63
That is basically an alias of https://scrubtv.cloud/
It cannot be done in lsp as they use playlists and if done in lsp will play a single episode from start to finish and will stop
 
  • Like
Reactions: skyhigh

undpnd tqucbo

Member
Jan 25, 2021
157
2
18
Need help regex,plz & tk!
Code:
hxxxps://www.realbetisbalompie.es/rtvbetis/directo-tv/
 

gujal

Developer
Dec 26, 2013
590
326
63
Simple one. Enjoy!

LSP XML:
<item>
<title>Betis TV</title>
<thumbnail>https://thumb.besoccerapps.com/rbetis/img_web/logo_shield.png</thumbnail>
<link>$doregex[getUrl]|User-Agent=iPad</link>
<regex>
<name>getUrl</name>
<expres>file":\s*"([^"]+)</expres>
<page>https://backend.flumotion.com/api/v1/player_site/615/site.js?&amp;asset=991046&amp;v=2.86.1.0</page>
<referer>https://backend.flumotion.com/</referer>
</regex>
</item>
 
  • Like
Reactions: undpnd tqucbo

gujal

Developer
Dec 26, 2013
590
326
63
Here we Go!
LSP3 Alpha version for Matrix available. Need people to test and report issues
Add https://gujal00.github.io/ as a source in Kodi File-manager and then install from zip pointing to that source
 

m5Germany

Active member
Mar 20, 2014
326
105
43
Info:
ERROR <general>: Add-on 'script.module.resolveurl' is not compatible with Kodi
ERROR <general>: CAddonInstallJob[plugin.video.live.streamspro]: The dependency on xbmc.python version 2.1.0 could not be satisfied.
 

Doom

Member
Sep 16, 2019
321
21
18
@gujal Android phone... tried 2 xml same error.
2021-03-28 09:43:20.677 T:22331 INFO <general>: initializing python engine.
2021-03-28 09:43:22.056 T:21704 INFO <general>: CPythonInvoker(4, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.xbmc.versioncheck/resources/lib/runner.py): script successfully run
2021-03-28 09:43:22.317 T:21704 INFO <general>: Python interpreter stopped
2021-03-28 09:43:22.448 T:22331 INFO <general>: CPythonInvoker(6, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): script successfully run
2021-03-28 09:43:22.631 T:22331 WARNING <general>: CPythonInvoker(6, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-03-28 09:43:22.631 T:22331 INFO <general>: Python interpreter stopped
2021-03-28 09:43:24.125 T:22416 INFO <general>: initializing python engine.
2021-03-28 09:43:25.058 T:22416 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'AttributeError'>
Error Contents: 'NoneType' object has no attribute 'rstrip'
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py", line 2674, in <module>
getData(url, fanart, data)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py", line 464, in getData
parse_m3u(soup)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py", line 470, in parse_m3u
content = data.rstrip()
AttributeError: 'NoneType' object has no attribute 'rstrip'
-->End of Python script error report<--

2021-03-28 09:43:25.395 T:22416 WARNING <general>: CPythonInvoker(7, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-03-28 09:43:25.396 T:22416 INFO <general>: Python interpreter stopped
2021-03-28 09:43:25.416 T:22415 ERROR <general>: GetDirectory - Error getting plugin://plugin.video.live.streamspro/?fanart=%2fstorage%2femulated%2f0%2fAndroid%2fdata%2forg.xbmc.kodi%2ffiles%2f.kodi%2faddons%2fplugin.video.live.streamspro%2ffanart.jpg&mode=1&name=crackstreams&url=%2fstorage%2femulated%2f0%2fcrackstreams.is.xml
2021-03-28 09:43:25.418 T:21474 ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.live.streamspro/?fanart=%2fstorage%2femulated%2f0%2fAndroid%2fdata%2forg.xbmc.kodi%2ffiles%2f.kodi%2faddons%2fplugin.video.live.streamspro%2ffanart.jpg&mode=1&name=crackstreams&url=%2fstorage%2femulated%2f0%2fcrackstreams.is.xml) failed
2021-03-28 09:43:33.613 T:21474 INFO <general>: CWinSystemAndroid::DestroyWindow
2021-03-28 09:43:33.650 T:21346 WARNING <general>: CPeripheralBusAndroid: failed to update input device with ID 1 because it couldn't be found
 

gujal

Developer
Dec 26, 2013
590
326
63
@Doom PM me the xml please, so that I can check why it is unable to parse

@m5Germany 'script.module.resolveurl' is not compatible with Kodi
Do you have the correct version installed?

Generally DO NOT upgrade Kodi from Leia to Matrix, it leaves lot of incompatible script modules which cause issues
Please only do a fresh install of Kodi Matrix and then install repos and addons.
 

m5Germany

Active member
Mar 20, 2014
326
105
43
Did a fresh install on Windows 10 directly from your repo. Got error message while loading the dependency of LSP3. What ver. of script.module.resolveurl should I use?
 

Doom

Member
Sep 16, 2019
321
21
18
@gujal Is from page 60 crackstream!
<item>
<title>NCAAB March Madness Live Streams and Schedule</title>
<fanart>https://cloudfront-us-east-1.images.arcpublishing.com/advancelocal/TGQQE6QEVVG7TAY2PWNEQLT7LE.jpg</fanart>
<thumbnail>http://crackstreams.is/icons/ncaab2.png</thumbnail>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>([makelist.param3]) [makelist.param2]</title>
<fanart>https://cloudfront-us-east-1.images.arcpublishing.com/advancelocal/TGQQE6QEVVG7TAY2PWNEQLT7LE.jpg</fanart>
<thumbnail>http://crackstreams.is/icons/ncaab2.png</thumbnail>
<link>$doregex[m5]</link>
]]></listrepeat>
<expres>a href='([^']+)[\w\W]*?g'>\s*([^<]+).*\n.*?-\s([^<]+)</expres>
<page>http://crackstreams.is/ncaabstreams/</page>
</regex>
<regex>
<name>m5</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
source=requests.get('[makelist.param1]',headers={'user-agent':'Mozilla/5.0','referer':'http://crackstreams.is/mmastreams/watch-ufc-rozenstruik-vs-gane/','accept':'*/*'}).content
if 'window.atob' in source:
return re.findall('window.atob.[\'"]([^\'"]+)',source)[0].decode('base64')+'|user-agent=ipad&origin=http://crackstreams.is&referer=http://crackstreams.is/mmastreams/watch-ufc-rozenstruik-vs-gane/video.php'
else:
return re.findall('id="play[\w\W]+?(?:source|src|file):\s*[\'"](htt[^\'"]+)',source)[0]+'|user-agent=ipad&origin=http://crackstreams.is&referer=http://crackstreams.is/mmastreams/watch-ufc-rozenstruik-vs-gane/video.php'
]]></expres>
<page></page>
</regex>
</item>
 

gujal

Developer
Dec 26, 2013
590
326
63
@Doom Need your xml file (that you are adding as a source to LSP) as a whole, not snippets.
A proper XML File would have the following at the top
LSP XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<items>
and the following at the end
LSP XML:
</items>
with all the <item>.....</item> in between
 

gujal

Developer
Dec 26, 2013
590
326
63
@m5Germany LSP3 addon.xml has this
LSP XML:
    <requires>
        <import addon="script.module.six" />
        <import addon="script.module.kodi-six" />
        <import addon="script.module.requests" optional="true"/>
        <import addon="script.module.websocket" version="0.50.0"  optional="true"/>
        <import addon="script.module.youtube.dl" optional="true"/>
        <import addon="plugin.video.youtube" optional="true" />
        <import addon="script.module.dateutil" optional="true" />
        <import addon="script.module.resolveurl" optional="true"/>
        <import addon="script.module.urlresolver" optional="true"/>
        <import addon="script.module.cloudscraper" optional="true"/>
        <import addon="script.module.inputstreamhelper" optional="true"/>
        <import addon="script.module.slproxy" optional="true"/>
    </requires>
resolveurl is marked optional, it should not try to install it by default.
Anyway, Resolveurl is available in this repo
Code:
https://raw.githubusercontent.com/Gujal00/smrzips/master/zips/repository.resolveurl/repository.resolveurl-1.0.0.zip
Install the repo, and from the repo install SMR Link tester addon, this will install the correct Resolveurl version as a dependency
 

m5Germany

Active member
Mar 20, 2014
326
105
43
Great job! I knew you could do it. Everything appears to work as expected. Will let you know if I find something that doesn't work.
Thanks for your hard work getting LSP3 to work in Kodi 19.0.
 

boomski2

Member
Aug 19, 2019
45
1
8
anyone can help me get this regex. thank you very much for your kind work

Code:
https://watchasian.cc/most-popular-drama
and

Code:
https://www3.dramacool.ae/genre/korean-movies/
 

Doom

Member
Sep 16, 2019
321
21
18
Could i get a regex for this channel... not the "okru" link changes too much and thanks.
hxxps://www.chatytvgratishd.me/canal-caracol-streaming-vivo/?en-directo
 

m5Germany

Active member
Mar 20, 2014
326
105
43
LSP XML:
<item>
<title>canal-caracol | Python</title>
<fanart></fanart>
<thumbnail></thumbnail>
<link>$doregex[m5]|User-Agent=iPad&amp;Referer=https://ssh101.com/</link>
<regex>
<name>m5</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re
  return re.findall('source\s* src="([^"]+)',page_data)[0]
]]></expres>
<page>https://ssh101.com/securelive/index.php?id=c1ferghdrh</page>
<referer>https://ssh101.com/</referer>
</regex>
</item>
 

m5Germany

Active member
Mar 20, 2014
326
105
43
The original Python Code above works. Here's a RegEx Code that captures from the main page.
LSP XML:
<item>
<title>canal-caracol | RegEx</title>
<link>$doregex[m5]|User-Agent=iPad&amp;Referer=https://ssh101.com/</link>
<fanart></fanart>
<thumbnail></thumbnail>
<regex>
<name>m5</name>
<expres>source\s*src="([^"]+)</expres>
<page>$doregex[m4]</page>
<referer>https://ssh101.com/</referer>
</regex>
<regex>
<name>m4</name>
<expres>true"\s*src="([^"]+)</expres>
<page>https://cdn.chatytvgratis.net/$doregex[m3]</page>
<referer>https://cdn.chatytvgratis.net/</referer>
</regex>
<regex>
<name>m3</name>
<expres>href="([^"]+).*?Opcion 1</expres>
<page>$doregex[m2]</page>
<referer>https://cdn.chatytvgratis.net/</referer>
</regex>
<regex>
<name>m2</name>
<expres>430" src="([^"]+)</expres>
<page>https://www.chatytvgratishd.me/canal-caracol-streaming-vivo/?en-directo</page>
<referer>https://cdn.chatytvgratis.net/</referer>
</regex>
</item>
 
  • Like
Reactions: Doom and tungbeng95

tungbeng95

Member
Oct 25, 2018
391
15
18
Hello.I have problem with LSP 3.0.
When I added source,LSP appear error:
Failed to parse xml: not well-formed (invalid token) line 3147, column 104
Who someone same me?
 

gujal

Developer
Dec 26, 2013
590
326
63
LSP3 uses ElementTree for XML parsing, so is very strict on the input XML for XML specification compliance. PM me the XML so that I can look at the xml and let you know why it doesnt parse
You can paste your XML here to look for validation as well, if you dont want to share your XML
Code:
https://xmllint.com/
 
  • Like
Reactions: udomrat

m5Germany

Active member
Mar 20, 2014
326
105
43
Well - This works in 18.5 and does not in LSP3. I think it is: ([^<]+)
LSP3 XML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<items>
 
<item>
<title>[COLOR=FF00FFFF]Main Menu [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] canale.live[/COLOR][/COLOR]</title>
<link>$doregex[m5Get]</link>
<fanart>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-VIDEOPLAYERTHUMBNAIL-692x390.jpg</fanart>
<thumbnail>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-SHOWLOGO-289x200.png</thumbnail>
<regex>
<name>m5Get</name>
<listrepeat><![CDATA[
<title>[m5Get.param3]</title>
<thumbnail>[m5Get.param1]</thumbnail>
<fanart>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-VIDEOPLAYERTHUMBNAIL-692x390.jpg</fanart>
<link>$doregex[m5Server]|User-Agent=Mozilla/5.0&amp;Referer=https://canale.live/</link>   
]]></listrepeat>
<expres>(?s)img\s*src="([^"]+).*?href="([^"]+).*?">([^<]+)</expres>
<page>https://canale.live/</page>
</regex>
<regex>
<name>m5Server</name>
<expres>$pyFunction:'$doregex[m5]' if not '$doregex[m5]'=='' else '$doregex[bmw]'</expres>
<page></page>
</regex>
<regex>
<name>m5</name>
<expres><![CDATA[r.*?"([^"]+)";]]></expres>
<page>[m5Get.param2]</page>
</regex>
<regex>
<name>bmw</name>
<expres><![CDATA[r.*?"(h[^"]+)"\s*t\w]]></expres>
<page>[m5Get.param2]</page>
</regex>
</item>
 
</items>
 

gujal

Developer
Dec 26, 2013
590
326
63
Yes, There are three reserved characters in XML & < and >
so these need to be entered as &amp; &lt; &gt;
:)However if any of these appear in a regex, then you have to enclose in CDATA tag. You have done it for the other two expressions which actually dont need it because they done have the reserved charaters, and the one expression that has a reserved character < does not have CDATA tag
Once you have that inside CDATA, the menu shows up correctly

However there are issues with playback, which could be due to a bug in LSP3, will check it out and let you know
 

gujal

Developer
Dec 26, 2013
590
326
63
There was no bug in lsp3, just your code needed to be tweaked for PY3, the $pyFunction changed slightly
LSP XML:
<item>
    <title>[COLOR=FF00FFFF]Main Menu [COLOR=red]•[/COLOR][COLOR=blue]•[/COLOR][COLOR=FF00CCFF] canale.live[/COLOR][/COLOR]</title>
    <link>$doregex[m5Get]</link>
    <fanart>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-VIDEOPLAYERTHUMBNAIL-692x390.jpg</fanart>
    <thumbnail>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-SHOWLOGO-289x200.png</thumbnail>
    <regex>
        <name>m5Get</name>
        <listrepeat><![CDATA[
        <title>[m5Get.param3]</title>
        <thumbnail>[m5Get.param1]</thumbnail>
        <fanart>https://img.tfc.tv/xcms/categoryimages/6006/TFCtv-VIDEOPLAYERTHUMBNAIL-692x390.jpg</fanart>
        <link>$doregex[m5Server]|User-Agent=Mozilla/5.0&amp;Referer=https://canale.live/</link>   
        ]]></listrepeat>
        <expres><![CDATA[(?s)img\s*src="([^"]+).*?href="([^"]+).*?">([^<]+)]]></expres>
        <page>https://canale.live/</page>
    </regex>
    <regex>
        <name>m5Server</name>
        <expres>$pyFunction:'$doregex[m5]' if '$doregex[m5]' != '' else '$doregex[bmw]'</expres>
        <page></page>
    </regex>
    <regex>
        <name>m5</name>
        <expres>r.*?"([^"]+)";</expres>
        <page>[m5Get.param2]</page>
    </regex>
    <regex>
        <name>bmw</name>
        <expres>r.*?"(h[^"]+)"\s*t\w</expres>
        <page>[m5Get.param2]</page>
    </regex>
</item>
 

Doom

Member
Sep 16, 2019
321
21
18
Stopped working could i get a fix and thanks
[QUOTE
<item>
<title>A AND E</title>
<thumbnail></thumbnail>
<fanart></fanart>
<link>$doregex[getUrl]|user-agent=iPad</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
import re, requests, base64, jsunpack
url = 'https://espare.tk/embed/generator.php?id=aye_lat'
headers = {'User-Agent': 'iPad',
'Referer': 'https://adictosalatele.com/'}
page_data = requests.get(url, headers=headers, verify=False).text
pdata = re.search('(eval\(function\(p,a,c,k,e.+?)</script', page_data, re.DOTALL)
if pdata:
page_data += jsunpack.unpack(pdata.group(1))
burl = re.findall('MARIOCSCryptOld\("([^"]+)', page_data)[0]
while 'm3u8' not in burl:
burl = base64.b64decode(burl)
return burl
]]></expres>
<page></page>
</regex>
</item>
][/QUOTE]
 

gujal

Developer
Dec 26, 2013
590
326
63
LSP ver 3.0.0~alpha3 uploaded with some fixes, please use this version for your testing
 

Doom

Member
Sep 16, 2019
321
21
18
@gujal here is the xml... works on 18 but not working in 19 even using alpha 3, take a look and thanks

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<item>
<title>[COLOR gold]BOXING EVENTS[/COLOR]</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat>
<![CDATA[
<title>[COLOR blue][makelist.param3][/COLOR][COLOR white] - [/COLOR][COLOR gold][makelist.param2][/COLOR]</title><link>$doregex[getUrl]</link><thumbnail>https://www.buneymis.net/wp-content/uploads/2020/05/brand-fights-1024x587.jpg</thumbnail><fanart>https://wallpaperaccess.com/full/2501013.jpg</fanart>
]]>
</listrepeat>
<expres>
<![CDATA[href=[\'"](.+?boxingstreams/watch[^\'"]+)[\w\W]+?media-heading.>([^<]+)[\w\W]+?<p>([^<]+)]]>
</expres>
<page>http://crackstreams.is/boxingstreams/</page>
</regex>
<regex>
<name>getUrl</name>
<expres>
<![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
source=requests.get('[makelist.param1]video.php',headers={'user-agent':'Mozilla/5.0','referer':'[makelist.param1]','accept':'*/*'}).content
if 'window.atob' in source:
return re.findall('window.atob.[\'"]([^\'"]+)',source)[0].decode('base64')+'|user-agent=ipad&origin=http://crackstreams.is&referer=[makelist.param1]video.php'
else:
return re.findall('id="play[\w\W]+?(?:source|src|file):\s*[\'"](htt[^\'"]+)',source)[0]+'|user-agent=ipad&origin=http://crackstreams.is&referer=[makelist.param1]video.php'
]]>
</expres>
<page></page>
</regex>
</item>
<item>
<title>[COLOR gold]NCAAB MARCH MADNESS EVENTS[/COLOR]</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat>
<![CDATA[
<title>([makelist.param3]) [makelist.param2]</title><fanart>https://cloudfront-us-east-1.images.arcpublishing.com/advancelocal/TGQQE6QEVVG7TAY2PWNEQLT7LE.jpg</fanart><thumbnail>http://crackstreams.is/icons/ncaab2.png</thumbnail><link>$doregex[m5]</link>
]]>
</listrepeat>
<expres>a href='([^']+)[\w\W]*?g'>\s*([^<]+).*\n.*?-\s([^<]+)





</expres>
<page>http://crackstreams.is/ncaabstreams/</page>
</regex>
<regex>
<name>m5</name>
<expres>
<![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
source=requests.get('[makelist.param1]video.php',headers={'user-agent':'Mozilla/5.0','referer':'http://crackstreams.is/ncaabstreams/','accept':'*/*'}).content
if 'window.atob' in source:
return re.findall('window.atob.[\'"]([^\'"]+)',source)[0].decode('base64')+'|user-agent=ipad&origin=http://crackstreams.is&referer=http://crackstreams.is/ncaabstreams/video.php'
else:
return re.findall('id="play[\w\W]+?(?:source|src|file):\s*[\'"](htt[^\'"]+)',source)[0]+'|user-agent=ipad&origin=http://crackstreams.is&referer=http://crackstreams.is/ncaabstreams/video.php'
]]>
</expres>
<page></page>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
@Doom

LSP Alpha 3 still not work with decode('base64') yet. You should use the pyFunction:base64.b64decode to decode and get the stream. Here is the two examples: one is working and one is getting below error:

Code:
"XFILE::CFileFactory::CreateLoader - unsupported protocol(b'http) in b'http://redirector.akamaicdn.xyz/images/666f786e657773/rdr.m3u8|user-agent=ipad&origin=http://123tvnow.com&referer=http://123tvnow.com/watch/fox-news-hd/' "
LSP alpha XML:
<item>
<title>FOX News - Error</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,base64
def GetLSProData(page_data,Cookie_Jar,m):
  stream='aHR0cDovL3JlZGlyZWN0b3IuYWthbWFpY2RuLnh5ei9pbWFnZXMvNjY2Zjc4NmU2NTc3NzMvcmRyLm0zdTh8dXNlci1hZ2VudD1pcGFkJm9yaWdpbj1odHRwOi8vMTIzdHZub3cuY29tJnJlZmVyZXI9aHR0cDovLzEyM3R2bm93LmNvbS93YXRjaC9mb3gtbmV3cy1oZC8='
  return base64.b64decode(stream)
]]></expres>
<page></page>
</regex>
<thumbnail>https://pbs.twimg.com/profile_images/781717023978029056/7JzRTj4E.jpg</thumbnail>
</item>


<item>
<title>FOX News - Working decoder and Stream Playing</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres>$pyFunction:base64.b64decode("aHR0cDovL3JlZGlyZWN0b3IuYWthbWFpY2RuLnh5ei9pbWFnZXMvNjY2Zjc4NmU2NTc3NzMvcmRyLm0zdTh8dXNlci1hZ2VudD1pcGFkJm9yaWdpbj1odHRwOi8vMTIzdHZub3cuY29tJnJlZmVyZXI9aHR0cDovLzEyM3R2bm93LmNvbS93YXRjaC9mb3gtbmV3cy1oZC8=")</expres>
<page></page>
</regex>
<thumbnail>https://pbs.twimg.com/profile_images/781717023978029056/7JzRTj4E.jpg</thumbnail>
</item>
 
  • Like
Reactions: Doom

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
Try this:

LSP Alpha 3:
<item>
<title>[COLOR gold]NCAAB MARCH MADNESS EVENTS[/COLOR]</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>([makelist.param3]) [makelist.param2]</title>
  <link>$doregex[getUrl]|user-agent=ipad&amp;origin=http://crackstreams.is&amp;referer=http://crackstreams.is/ncaabstreams/</link>
  <fanart>https://cloudfront-us-east-1.images.arcpublishing.com/advancelocal/TGQQE6QEVVG7TAY2PWNEQLT7LE.jpg</fanart>
  <thumbnail>http://crackstreams.is/icons/ncaab2.png</thumbnail>
]]></listrepeat>
<expres><![CDATA[a href='([^']+)[\w\W]*?g'>\s*([^<]+).*\n.*?-\s([^<]+)]]></expres>
<page>http://crackstreams.is/ncaabstreams/</page>
</regex>

<regex>
<name>getUrl</name>
<expres>$pyFunction:'$doregex[stream]' if not '$doregex[stream]'=='' else '$doregex[m3u8]'</expres>
<page></page>
</regex>

<regex>
<name>stream</name>
<expres>$pyFunction:base64.b64decode("$doregex[decoded]")</expres>
<page></page>
</regex>

<regex>
<name>decoded</name>
<expres><![CDATA[window.atob.[\'"]([^\'"]+)]]></expres>
<page>[makelist.param1]video.php</page>
<referer>[makelist.param1]</referer>
</regex>

<regex>
<name>m3u8</name>
<expres><![CDATA[id="play[\w\W]+?(?:source|src|file):\s*[\'"](htt[^\'"]+)]]></expres>
<page>[makelist.param1]video.php</page>
<referer>[makelist.param1]</referer>
</regex>
<thumbnail>http://crackstreams.is/icons/ncaab2.png</thumbnail>
<fanart>https://cloudfront-us-east-1.images.arcpublishing.com/advancelocal/TGQQE6QEVVG7TAY2PWNEQLT7LE.jpg</fanart>
</item>
 

gujal

Developer
Dec 26, 2013
590
326
63
@streamwatcher2013
LSP3 does not make your old XMLs with Python 2 code run under matrix
If your XML has python block, it needs to be rewritten in Python 3 for it to work in Kodi Matrix
Specifically the string handling is completely different in Py3, so stuff like string.decode('base64') wont work in Python 3
base64.b64decode(string) will return a bytestring in Py3, so you need to add .decode('utf-8') at the end to turn it into text string and send to kodi
 

gujal

Developer
Dec 26, 2013
590
326
63
@streamwatcher2013 This code below for e.g., uses base64 decode and works fine on both LSP2.9.7 and LSP3
Also notice the use of urllib_parse for making the code work on both Py2 (Leia) and Py3 (Matrix)
LSP XML:
<item>
<title>Bein Sports 1 (MaksiBet)</title>
<link>$doregex[getURL]</link>
<thumbnail></thumbnail>
<regex>
<name>getURL</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, jsunhunt, base64
  from six.moves import urllib_parse
  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://maksibet.tv/',
             'Origin': 'https://maksibet.tv'}
  pdata = re.findall('atob\("([^"]+)', page_data)[0]
  pdata = base64.b64decode(pdata).decode('utf-8')
  if jsunhunt.detect(pdata):
    pdata = jsunhunt.unhunt(pdata)
  strurl = re.findall("src:\s*'([^']+)", pdata)[0]
  return '{0}|{1}'.format(strurl, urllib_parse.urlencode(headers))
]]></expres>
<page>https://maksibet.tv/tv/bein-sports-1</page>
<referer>https://maksibet.tv/</referer>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
Thanks @gujal for explanation. I saw a lots of change with Python 3, special most of new functions import from six.moves: urllib_request, urllib_parse, html_parser, http_cookiejar.... Same as those urllib_parse.quote_plus and urllib_parse.unquote_plus,urllib_parse.urlencode.......I will spent more time for them later. Just enjoy the test for now. If I have any error during the testing, will post. Thanks again for your hard working to move the LSP plugins forwarding to the next currently Kodi Matrix.
 

Doom

Member
Sep 16, 2019
321
21
18
@gujal I tried the fixed code "NCAAB" from @streamwatcher2013 and it loads now but im getting this error and also the code "adictosalatele" from @m5and loads now but same error in both "Android phone".🤔
2021-03-31 10:21:31.029 T:7129 INFO <general>: CPythonInvoker(6, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): script successfully run
2021-03-31 10:21:31.239 T:7129 WARNING <general>: CPythonInvoker(6, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-03-31 10:21:31.239 T:7129 INFO <general>: Python interpreter stopped
2021-03-31 10:21:31.999 T:7134 INFO <general>: initializing python engine.
2021-03-31 10:21:32.977 T:7134 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'UnboundLocalError'>
Error Contents: local variable 'channels' referenced before assignment
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py", line 2682, in <module>
getData(url, fanart, data)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py", line 459, in getData
if channels is None or len(channels) == 0:
UnboundLocalError: local variable 'channels' referenced before assignment
-->End of Python script error report<--

2021-03-31 10:21:33.276 T:7134 WARNING <general>: CPythonInvoker(7, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py): the python script "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.live.streamspro/default.py" has left several classes in memory that we couldn't clean up. The classes include: N9XBMCAddon9xbmcaddon5AddonE
2021-03-31 10:21:33.276 T:7134 INFO <general>: Python interpreter stopped
2021-03-31 10:21:33.288 T:7068 INFO <general>: CPythonInvoker(4, /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.xbmc.versioncheck/resources/lib/runner.py): script successfully run
2021-03-31 10:21:33.290 T:7133 ERROR <general>: GetDirectory - Error getting plugin://plugin.video.live.streamspro/?fanart=%2fstorage%2femulated%2f0%2fAndroid%2fdata%2forg.xbmc.kodi%2ffiles%2f.kodi%2faddons%2fplugin.video.live.streamspro%2ffanart.jpg&mode=1&name=a&url=%2fstorage%2femulated%2f0%2fa.xmlfix
2021-03-31 10:21:33.301 T:7038 ERROR <general>: CGUIMediaWindow::GetDirectory(plugin://plugin.video.live.streamspro/?fanart=%2fstorage%2femulated%2f0%2fAndroid%2fdata%2forg.xbmc.kodi%2ffiles%2f.kodi%2faddons%2fplugin.video.live.streamspro%2ffanart.jpg&mode=1&name=a&url=%2fstorage%2femulated%2f0%2fa.xmlfix) failed
2021-03-31 10:21:33.559 T:7068 INFO <general>: Python interpreter stopped
2021-03-31 10:21:39.133 T:7038 INFO <general>: CWinSystemAndroid::DestroyWindow
2021-03-31 10:21:39.154 T:7000 WARNING <general>: CPeripheralBusAndroid: failed to update input device with ID 4 because it couldn't be found
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
For whom still want the Youtube Search for Kodi Matrix 19.x. Using either youtube plugins with <utube> or ResolveUrl with <urlsolve>

LSP Alpha 3 - Kodi Matrix 19.x:
<item>
<title>YOUTUBE Search</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>([makelist.param3]) [makelist.param2]</title>
  <utube>[makelist.param1]</utube>
  <info>Duration: [makelist.param3]</info>
  <thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,urllib.request,urllib.parse,xbmc
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  def get_SearchQuery():
    keyboard=xbmc.Keyboard();keyboard.setHeading('Search Here:');keyboard.doModal()
    if keyboard.isConfirmed():
     itext=urllib.parse.quote(keyboard.getText())
     return itext
  gtext=get_SearchQuery()
  jdata=urllib.request.urlopen('https://m.youtube.com/results?search_query=%s'%gtext).read().decode('utf-8')
  lists=re.findall('itemSectionRenderer":{"contents"(?s)(.*?)"continuationItemRenderer',jdata)[0].replace('\\u0026','&')
  return re.findall('{"videoRenderer":{"videoId":"([^"]+)[\w\W]+?"accessibilityData":{"label":"(.+?)(?:\s*by|"})[\w\W]+?}},"simpleText":"([^"]+)',lists)
]]></expres>
<page></page>
</regex>
<thumbnail>https://www.wearediagram.com/hubfs/YouTube_Search.jpg</thumbnail>
</item>

<item>
<title>YOUTUBE Search</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
  <title>([makelist.param3]) [makelist.param2]</title>
  <urlsolve>https://www.youtube.com/watch?v=[makelist.param1]</urlsolve>
  <info>Duration: [makelist.param3]</info>
  <thumbnail>https://i.ytimg.com/vi/[makelist.param1]/hqdefault.jpg</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,urllib.request,urllib.parse,xbmc
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  def get_SearchQuery():
    keyboard=xbmc.Keyboard();keyboard.setHeading('Search Here:');keyboard.doModal()
    if keyboard.isConfirmed():
     itext=urllib.parse.quote(keyboard.getText())
     return itext
  gtext=get_SearchQuery()
  jdata=urllib.request.urlopen('https://m.youtube.com/results?search_query=%s'%gtext).read().decode('utf-8')
  lists=re.findall('itemSectionRenderer":{"contents"(?s)(.*?)"continuationItemRenderer',jdata)[0].replace('\\u0026','&')
  YTid=re.findall('{"videoRenderer":{"videoId":"([^"]+)',lists)
  title=re.findall('{"videoRenderer":{"videoId":[\w\W]+?"accessibilityData":{"label":"(.+?)(?:\s*by|"})',lists)
  duration=re.findall('{"videoRenderer":{"videoId":[\w\W]+?}},"simpleText":"([^"]+)',lists)
  return list(zip(YTid,title,duration))
]]></expres>
<page></page>
</regex>
<thumbnail>https://www.wearediagram.com/hubfs/YouTube_Search.jpg</thumbnail>
</item>
 

gujal

Developer
Dec 26, 2013
590
326
63
@streamwatcher2013 You can use requests as before, the only difference is you should be using .text instead of .content that you were normally using earlier.
.content would return bytestring in py3, where as .text would return text string in both PY2 and PY3
 

gujal

Developer
Dec 26, 2013
590
326
63
Json, time, datetime and requests work the same in python 2 & 3. the only difference is in Py3, requests.content returns the raw html which is a bytestring, and requests.text returns textstring.
There are differences when it comes to .encode(), .decode() md5, hashlib, etc where PY3 is different due to string handling
 

streamwatcher2013

Well-known member
Oct 24, 2013
985
443
63
USA
Thanks so much @gujal. The LSP plays the streams more smoothly on the latest Kodi Matrix. I only have small problem on the datetime call out, all the one i been using with Python 2 won't get the right result on Python 3. But at least I got it to work. Most of the capture streams from my xml working great on LSP Alpha 3 so far. Thanks again for hard working @gujal
 
Thread starter Similar threads Forum Replies Date
G Scraper Development 0
J Scraper Development 1
O Addon Requests 5