Help for Regex

Status
Not open for further replies.

streamwatcher2013

Well-known member
Oct 24, 2013
986
446
63
USA
can anyone help me regex this this.

Code:
hxxp://www.liveonlinetv247.info/embed/discoveryhd.php
Try this

Code:
<item>
<title> http://www.liveonlinetv247.info/discoveryhd.php</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):
  url=re.findall('src="(h.*?embed.*?)"',page_data)[0]
  headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0','Referer':'https://www.liveonlinetv247.info/discoveryhd.php'}
  source=requests.get(url,headers=headers,allow_redirects=False);html=source.headers['Location'];source=requests.get(url,headers=headers).text
  return re.findall('"(http.*?wmsAuthSign.*?)"',source)[0]+'|User-Agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0&Referer='+url
]]></expres>
<page>https://www.liveonlinetv247.info/discoveryhd.php</page>
<referer>https://www.liveonlinetv247.info/watch.php?title=Discovery%20HD&channel=discoveryhd</referer>
<cookieJar></cookieJar>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
986
446
63
USA
Please help with regex
Code:
https://citizentv.co.ke/ctv_stream/index.php
Try this

Code:
<item>
<title> https://citizentv.co.ke/ctv_stream/index.php</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://api-eu1.revlet.net/service/api/v1/embed/page/stream?path=channel/live/citizen-tv&tenant_code=royalmedia',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0','Referer':'https://citizen1.viusasa.com/embed.html?channel=citizen-tv&autoplay=1', 'Accept': 'application/json, text/javascript, */*; q=0.01'}).text
  return re.findall('"url":"(.*?)"',source)[0]+'|User-Agent=iPad&Referer=https://api-eu1.revlet.net/service/api/v1/embed/page/stream?path=channel/live/citizen-tv&tenant_code=royalmedia'
]]></expres>
<page></page>
<cookieJar></cookieJar>
</regex>
</item>
 

1qazwsx12

New member
May 29, 2015
23
0
0
Try this

Code:
<item>
<title> https://citizentv.co.ke/ctv_stream/index.php</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://api-eu1.revlet.net/service/api/v1/embed/page/stream?path=channel/live/citizen-tv&tenant_code=royalmedia',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0','Referer':'https://citizen1.viusasa.com/embed.html?channel=citizen-tv&autoplay=1', 'Accept': 'application/json, text/javascript, */*; q=0.01'}).text
  return re.findall('"url":"(.*?)"',source)[0]+'|User-Agent=iPad&Referer=https://api-eu1.revlet.net/service/api/v1/embed/page/stream?path=channel/live/citizen-tv&tenant_code=royalmedia'
]]></expres>
<page></page>
<cookieJar></cookieJar>
</regex>
</item>
Thanks so much
 

streamwatcher2013

Well-known member
Oct 24, 2013
986
446
63
USA
Can i please get help with this
Code:
http://cdn.nadaje.com/static/players/3601/clappr.html
Try this

Code:
<item>
<title> http://cdn.nadaje.com/static/players/3601/clappr.html</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://nadaje.com/api/1.0/services/video/3601/',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0','Referer':'http://cdn.nadaje.com/static/players/3601/clappr.html', 'Accept': 'application/json, text/javascript, */*; q=0.01'}).text
  return re.findall('"hls": "(.*?)"',source)[0]+'|User-Agent=iPad&Referer=https://nadaje.com/api/1.0/services/video/3601/'
]]></expres>
<page></page>
<cookieJar></cookieJar>
</regex>
</item>
 

boul

Member
Nov 24, 2017
36
0
6
please some guru can help me, I tried to write this regex but it wong some time. please help me

<item>
<Title>Regex-Cnews</title>
<link>$doregex[final-url]</link>
<regex>
<name>final-url</name>
<expres>(.*)</expres>
<page>$doregex[m5]</page>
</regex>
<regex>
<name>m5</name>
<expres>$pyFunction:'$doregex[get-url]'.replace('\/','/')</expres>
<page></page>
</regex>
<regex>
<name>get-url</name>
<expres>video_urlhd":"(.*?)"</expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=6</page>
<referer></referer>
<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</agent>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
986
446
63
USA
@boul
The url contains 6 videos with same structure, dif. title and video. You may create a makelist to get all of them. Or just change the url to 1 video to see it works with your code
Code:
http://service.cnews.fr/iphone/topnews?nbContent=1
 

1qazwsx12

New member
May 29, 2015
23
0
0
Try this

Code:
<item>
<title> http://cdn.nadaje.com/static/players/3601/clappr.html</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  source=requests.get('https://nadaje.com/api/1.0/services/video/3601/',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0','Referer':'http://cdn.nadaje.com/static/players/3601/clappr.html', 'Accept': 'application/json, text/javascript, */*; q=0.01'}).text
  return re.findall('"hls": "(.*?)"',source)[0]+'|User-Agent=iPad&Referer=https://nadaje.com/api/1.0/services/video/3601/'
]]></expres>
<page></page>
<cookieJar></cookieJar>
</regex>
</item>

Thanks so much
 

boul

Member
Nov 24, 2017
36
0
6
regex cnews

@boul
The url contains 6 videos with same structure, dif. title and video. You may create a makelist to get all of them. Or just change the url to 1 video to see it works with your code
Code:
http://service.cnews.fr/iphone/topnews?nbContent=1
Thank you streamwatcher, I trie it, but it always wong. thank

<item>
<Title>regex cnews</title>
<link>$doregex[final-url]</link>
<regex>
<name>final-url</name>
<expres>(.*)</expres>
<page>$doregex[m5]</page>
</regex>
<regex>
<name>m5</name>
<expres>$pyFunction:'$doregex[get-url]'.replace('\/','/')</expres>
<page></page>
</regex>
<regex>
<name>get-url</name>
<expres>video_urlhd":"(.*?)"</expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=1</page>
<referer></referer>
<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</agent>
</regex>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
986
446
63
USA
Thank you streamwatcher, I trie it, but it always wong. thank

Code:
<item>
					<Title>regex cnews</title>
					<link>https://www.tvaddons.co/forums/$doregex[final-url]</link>
					<regex>
					<name>final-url</name>
					<expres>(.*)</expres>
					<page>$doregex[m5]</page>
					</regex>
					<regex>
					<name>m5</name>
					<expres>$pyFunction:'$doregex[get-url]'.replace('\/','/')</expres>
					<page></page>
					</regex>
					<regex>
					<name>get-url</name>
					<expres>video_urlhd":"(.*?)"</expres>
					<page>http://service.cnews.fr/iphone/topnews?nbContent=1</page>
					<referer></referer>
					<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</agent>
					</regex>
					</item>
Your code have extra coding, no need for it. Try this

Code:
<item>
<Title>regex cnews</title>
<link>$doregex[final-url]</link>
<regex>
<name>final-url</name>
<expres>$pyFunction:'$doregex[get-url]'.replace('\/','/')</expres>
<page></page>
</regex>
<regex>
<name>get-url</name>
<expres>video_urlhd":"(.*?)"</expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=1</page>
<referer></referer>
<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</agent>
</regex>
</item>
For the makelist. Try this

Code:
<item>
<title> http://service.cnews.fr/iphone/topnews?nbContent=6</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
   <title> [makelist.param1]</title>
   <link>[makelist.param3]</link>
   <thumbnail>[makelist.param2]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  lists=re.findall('(.*)',page_data)[0].replace('\\','').replace('u00e0','à').replace('u00e9','é').replace('u00ea','ê')
  return re.findall('dailymotion":"(?:\w.*?)".*?"title":"(.*?)",.*?preview":"(.*?)".*?urlhd":"(.*?)"',lists)
]]></expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=6</page>
</regex>
</item>
 
Last edited:

boul

Member
Nov 24, 2017
36
0
6
Your code have extra coding, no need for it. Try this

Code:
<item>
<Title>regex cnews</title>
<link>$doregex[final-url]</link>
<regex>
<name>final-url</name>
<expres>$pyFunction:'$doregex[get-url]'.replace('\/','/')</expres>
<page></page>
</regex>
<regex>
<name>get-url</name>
<expres>video_urlhd":"(.*?)"</expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=1</page>
<referer></referer>
<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko</agent>
</regex>
</item>
For the makelist. Try this

Code:
<item>
<title> http://service.cnews.fr/iphone/topnews?nbContent=6</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
   <title> [makelist.param1]</title>
   <link>[makelist.param3]</link>
   <thumbnail>[makelist.param2]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#streamwatcher2013
  lists=re.findall('(.*)',page_data)[0].replace('\\','').replace('u00e0','à').replace('u00e9','é').replace('u00ea','ê')
  return re.findall('dailymotion":"(?:\w.*?)".*?"title":"(.*?)",.*?preview":"(.*?)".*?urlhd":"(.*?)"',lists)
]]></expres>
<page>http://service.cnews.fr/iphone/topnews?nbContent=6</page>
</regex>
</item>
Thank you streamwatcher,
its the same thing, its dont work, the two code. I use kodi 17.4
 

gujal

Developer
Dec 26, 2013
591
327
63
Thank you streamwatcher,
its the same thing, its dont work, the two code. I use kodi 17.4
Looks like you are after the live stream of CNews, You need Dailymotion addon installed from Kodi Official repository for this to work. Enjoy!

Code:
<item>
<title>CNews</title>
<dmlive>x3b68jn</dmlive>
<referer>http://www.cnews.fr/</referer>
</item>
 

Rubi2011

New member
Mar 10, 2017
4
0
1
Code:
hello can you help me regex this lik 

xxx.filmaon.com/filma/battle-of-the-drones/

xxx://xrysoi.online/the-outsider-2018/
 

boul

Member
Nov 24, 2017
36
0
6
Looks like you are after the live stream of CNews, You need Dailymotion addon installed from Kodi Official repository for this to work. Enjoy!

Code:
<item>
<title>CNews</title>
<dmlive>x3b68jn</dmlive>
<referer>http://www.cnews.fr/</referer>
</item>
Thank mr gujal, but it still does not work for me, I thing it is géo-bloked.

thank for you help
 
Status
Not open for further replies.