Help for Regex

Status
Not open for further replies.

atomix

New member
Nov 28, 2016
12
0
1
hi this dont work anymore anyone help to work again please

<item>
<title>RTL</title>
<thumbnail></thumbnail>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,base64
def GetLSProData(page_data,Cookie_Jar,m):
url=re.findall('iframe.src="(.*?)"',requests.get('hxxp://www.kostenloslivetv.com/rtl/',headers={'User-Agent':'your bot 0.1'}).content.decode('ascii','ignore'))[0]
source=requests.get(url,headers={'Referer':'hxxp://www.kostenloslivetv.com/rtl/','User-Agent':'your bot 0.1'}).content.decode('ascii','ignore')
return base64.b64decode(re.findall('webhdiptv\("(.*?)"',source)[0][::-1]+'==')+'|Referer=hxxp://www.kostenloslivetv.com/rtl/&User-Agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
]]></expres>
<page></page>
</regex>
</item>
 

Pustule

New member
Mar 2, 2017
20
0
0
hi this dont work anymore anyone help to work again please
Enjoy :

Code:
<item>
<title>RTL</title>
<thumbnail></thumbnail>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,base64
def GetLSProData(page_data,Cookie_Jar,m):
  url=re.findall('iframe.src="(.*?)"',requests.get('http://www.kostenloslivetv.com/rtl/',headers={'User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore'))[0]
  source=requests.get(url,headers={'Referer':'http://www.kostenloslivetv.com/rtl/','User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore')
  link=re.findall('webhdiptv\("(.*?)"',source)[0][::-1]+'=='
  return base64.b64decode(link.replace('_','/'))+'|Referer=http://www.kostenloslivetv.com/rtl/&User-Agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
]]></expres>
<page></page>
</regex>
</item>
 

vbprofi

Member
Feb 9, 2016
74
3
8
Enjoy :

Code:
<item>
<title>RTL</title>
<thumbnail></thumbnail>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,base64
def GetLSProData(page_data,Cookie_Jar,m):
  url=re.findall('iframe.src="(.*?)"',requests.get('http://www.kostenloslivetv.com/rtl/',headers={'User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore'))[0]
  source=requests.get(url,headers={'Referer':'http://www.kostenloslivetv.com/rtl/','User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore')
  link=re.findall('webhdiptv\("(.*?)"',source)[0][::-1]+'=='
  return base64.b64decode(link.replace('_','/'))+'|Referer=http://www.kostenloslivetv.com/rtl/&User-Agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
]]></expres>
<page></page>
</regex>
</item>
Hello,
I have create a makelist with your solution. here is it...
Code:
<item>
<title>kostenloslivetv.com</title>
<link>$doregex[makelist]</link>

<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR cyan][makelist.param3][/COLOR]</title>
<link>$doregex[getUrl]</link>
<thumbnail>[makelist.param2]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re,requests,base64
def GetLSProData(page_data,Cookie_Jar,m):
  url='http://www.kostenloslivetv.com/'
  res=re.findall("href='(http://www.kost.*?)'.*?src='(.*?)'.*?title='(.*?)'", requests.get(url, headers={'User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore'))
  return res
]]></expres>
<page></page>
<agent>Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/47.0.2526.70 Mobile/13C71 Safari/601.1.46</agent>
<Referer>[makelist.param1]</Referer>
</regex>

<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests,base64
def GetLSProData(page_data,Cookie_Jar,m):
  url='[makelist.param1]'
  res=re.findall('iframe.src="(.*?)"', requests.get(url, headers={'User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore'))[0]
  source=requests.get(res, headers={'Referer': url,'User-Agent':'Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'}).content.decode('ascii','ignore')
  link=re.findall('webhdiptv\("(.*?)"',source)[0][::-1]+'=='
  return base64.b64decode(link.replace('_','/')) + '|Referer=' + url + '&User-Agent=Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0'
]]></expres>
<page></page>
</regex>
</item>
 

gujal

Developer
Dec 26, 2013
446
221
43
hi,

pls help for this regex..

Code:
https://www.vidio.com/live/204-sctv-tv-stream
It is the good one. I am trying to get the multipart post requests data which generate on fly with headers. If I can get it will PM you
Enjoy!

Code:
<item>
<title>[COLOR cyan]SCTV[/COLOR]</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests
  surl = re.findall('data-vjs-clip-hls-url="([^"]+)',page_data)[0]
  ua = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1'}
  tokurl = 'https://www.vidio.com/csrf_tokens'
  strtok = 'https://www.vidio.com/live/204/tokens'
  r = requests.get(tokurl,headers=ua,cookies=Cookie_Jar)
  tok = r.json()['token']
  data = {'authenticity_token':(None, tok)}
  stoken = requests.post(strtok, headers=ua, cookies=r.cookies, files=data).json()['token']
  return surl + '?' + stoken 
]]></expres>
<page>https://www.vidio.com/live/204-sctv-tv-stream</page>
<cookiejar></cookiejar>
</regex>
</item>
 

adriansyafiq

New member
Jan 3, 2016
26
2
3
Enjoy!

Code:
<item>
<title>[COLOR cyan]SCTV[/COLOR]</title>
<link>https://www.tvaddons.co/forums/$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><=!=[=C=D=A=T=A=[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
  import re, requests
  surl = re.findall('data-vjs-clip-hls-url="([^"]+)',page_data)[0]
  ua = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1'}
  tokurl = 'https://www.vidio.com/csrf_tokens'
  strtok = 'https://www.vidio.com/live/204/tokens'
  r = requests.get(tokurl,headers=ua,cookies=Cookie_Jar)
  tok = r.json()['token']
  data = {'authenticity_token':(None, tok)}
  stoken = requests.post(strtok, headers=ua, cookies=r.cookies, files=data).json()['token']
  return surl + '?' + stoken 
]=]=></expres>
<page>https://www.vidio.com/live/204-sctv-tv-stream</page>
<cookiejar></cookiejar>
</regex>
</item>
thank you very much experts!!
 

aylak

New member
Dec 28, 2017
24
0
0
Hello professionals i am new to this forum and sorry for my bad english could one of the professionals make a makelist of a series from this page an example link i do insert here i thank you for your help
 
Last edited:

captainhardlock

New member
Jun 6, 2017
25
0
1
Please, can someone help me for this?

Code:
<item>
<title>Sp0r75tream365</title>
<link>rtmpe://93.189.62.10/xlive app=xlive playpath=raw:XXXXXXX conn=S:client conn=S:3.1.3.31 conn=S:en conn=O:1 conn=NB:disAllowScriptAccess:0 timeout=15 live=1 pageUrl=hxxp://sportstream-365.com/</link>
</item>
Streaming starts good, but fall down suddendly after 2-3 seconds.

I think i should pass 'swfhash' and 'swfsize' parameters into the tag links but latest Kodi versions are not compliant with those.
Sorry for the trouble again. Could be possible to solve this link?

Or find a different solution for

Code:
hxxp://sportstream365.com
Thanks
 

gujal

Developer
Dec 26, 2013
446
221
43
Sorry for the trouble again. Could be possible to solve this link?

Or find a different solution for

Code:
hxxp://sportstream365.com
Thanks
RTMP support in Kodi 17 above is poor as it does not support all the features added by KSV.
There was one patched inputstream.rtmp version for windows available which could be used for ss365, but not available for any other platform. Can't do anything about it
 

captainhardlock

New member
Jun 6, 2017
25
0
1
RTMP support in Kodi 17 above is poor as it does not support all the features added by KSV.
There was one patched inputstream.rtmp version for windows available which could be used for ss365, but not available for any other platform. Can't do anything about it
Hi gujal

Thanks a lot for the answer.

Could you suggest me, in PM too, where can i find the patched inputstream.rtmp version?
 

papaya

Member
Apr 4, 2018
41
1
8
i have try this code to play live youtube. but not able to play.. do i need to setup anything on youtube addon also?

Welcome back @jujuuj. I don't know youtube plugin will pick the higher stream resolution? But here the one will pick the higher resolution if the stream has it

Code:
<item>
<title>KTN Kenya NEWS</title>
<link>https://www.tvaddons.co/forums/$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><=!=[=C=D=A=T=A=[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):# streamwatcher2013
  url='https://www.youtube.com/watch?v='+re.findall('feature=c4-live-promo".*?watch\?v=(.*?)".*?LIVE',requests.get('https://www.youtube.com/channel/UCkWr5PLM8hp8M4WNIkjpKsQ').content.decode('ascii','ignore'))[0]
  source=requests.get(url).content.decode('ascii','ignore').replace('\\u0026','&').replace('\\','');source=requests.get(re.findall('hlsvp":"(.*?)"',source)[0]).content.decode('ascii','ignore').replace('\\u0026','&').replace('\\','')
  if '1080' in source:
    return re.findall('x1080.*\n(.*)',source)[0]+'|User-Agent=iPad'
  elif '720' in source:
    return re.findall('x720.*\n(.*)',source)[0]+'|User-Agent=iPad'
  elif '480' in source:
    return re.findall('x480.*\n(.*)',source)[0]+'|User-Agent=iPad'
]=]=></expres>
<page></page>
</regex>
<thumbnail>https://yt3.ggpht.com/-4c3BpnVtuLw/AAAAAAAAAAI/AAAAAAAAAAA/VTedIif8Pyc/s288-mo-c-c0xffffffff-rj-k-no/photo.jpg</thumbnail>
</item>
 

streamwatcher2013

Well-known member
Oct 24, 2013
805
328
63
USA
i have try this code to play live youtube. but not able to play.. do i need to setup anything on youtube addon also?
Just use this one with minor modified

Code:
<item>
<title>KTN Kenya NEWS</title>
<link>$doregex[getUrl]</link>
<regex>
<name>getUrl</name>
<expres><![CDATA[#$pyFunction
import re,requests
def GetLSProData(page_data,Cookie_Jar,m):# streamwatcher2013
  url='https://www.youtube.com/watch?v='+re.findall('feature=c4-live-promo".*?watch\?v=(.*?)"',requests.get('https://www.youtube.com/channel/UCkWr5PLM8hp8M4WNIkjpKsQ').content.decode('ascii','ignore'))[0]
  source=requests.get(url).content.decode('ascii','ignore').replace('\\u0026','&').replace('\\','');source=requests.get(re.findall('hlsvp":"(.*?)"',source)[0]).content.decode('ascii','ignore').replace('\\u0026','&').replace('\\','')
  if '1080' in source:
    return re.findall('x1080.*\n(.*)',source)[0]+'|User-Agent=iPad'
  elif '720' in source:
    return re.findall('x720.*\n(.*)',source)[0]+'|User-Agent=iPad'
  elif '480' in source:
    return re.findall('x480.*\n(.*)',source)[0]+'|User-Agent=iPad'
]]></expres>
<page></page>
</regex>
<thumbnail>https://yt3.ggpht.com/-4c3BpnVtuLw/AAAAAAAAAAI/AAAAAAAAAAA/VTedIif8Pyc/s288-mo-c-c0xffffffff-rj-k-no/photo.jpg</thumbnail>
</item>
 

vbprofi

Member
Feb 9, 2016
74
3
8
Hi,
please help to fix this code for captchas.

Code:
<item>
<title>bs.to | single server</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
   <title>[COLOR yellow][makelist.param1][/COLOR]</title>
   <link>$doregex[selectserie]</link>
   <thumbnail>https://bs.to/public/img/header.png</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import requests,re,urllib
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data, Cookie_Jar, m):
  source = re.findall('id="seriesContainer">(?s)(.*?)<script',page_data)[0]
  return re.findall('strong>(.*?)</strong>(?s)(.*?)</ul',source)
]]></expres>
<page>https://bs.to/serie-alphabet</page>
<agent>Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/47.0.2526.70 Mobile/13C71 Safari/601.1.46</agent>
<cookieJar></cookieJar>
<Accept>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</Accept>
<Connection>keep-alive</Connection>
</regex>
<regex>
<name>selectserie</name>
<listrepeat><![CDATA[
   <title>[COLOR yellow][selectserie.param2][/COLOR]</title>
   <link>$doregex[selectseason]</link>
   <thumbnail>https://bs.to/public/img/header.png</thumbnail>
]]></listrepeat>
<expres>href="(.*?)".title="(.*?)"</expres>
<page>[makelist.param2]</page>
</regex>

<regex>
<name>getcover</name>
<expres>src="(.*/cover.*?)"</expres>
<page>https://bs.to/[selectserie.param1]</page>
<referer>https://bs.to/serie-alphabet</referer>
<agent>Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/47.0.2526.70 Mobile/13C71 Safari/601.1.46</agent>
<cookieJar></cookieJar>
</regex>

<regex>
<name>selectseason</name>
<listrepeat><![CDATA[
   <title>[COLOR yellow][selectserie.param2][/COLOR] - [COLOR dodgerblue]Staffel [selectseason.param2][/COLOR]</title>
   <link>$doregex[selectsession]</link>
   <thumbnail>https://bs.to$doregex[getcover]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import requests,re,urllib
def GetLSProData(page_data, Cookie_Jar, m):
  source = re.findall('id="seasons">(?s)(.*?)</ul',page_data)[0]
  return re.findall('href="(.*?\/(\d+))"',source)
]]></expres>
<page>https://bs.to/[selectserie.param1]</page>
<referer>https://bs.to/serie-alphabet</referer>
<agent>Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/47.0.2526.70 Mobile/13C71 Safari/601.1.46</agent>
<cookieJar></cookieJar>
</regex>

<regex>
<name>selectsession</name>
<listrepeat><![CDATA[
   <title>[COLOR yellow][selectsession.param1][/COLOR] - [COLOR dodgerblue]Folge [selectsession.param2][/COLOR]</title>
   <link>$doregex[playvideo]</link>
   <thumbnail>https://bs.to$doregex[getcover]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import requests,re,urllib
def GetLSProData(page_data, Cookie_Jar, m):
  source = re.findall('class="episodes">(?s)(.*?)</table',page_data)[0]
  return re.findall('title="(.*?)">(\d+)<[\w\W\s]*?href="(.*?)">(?:Vivo)<',source)    # change FlashX to whatever server you want youwatch, openload, vivo,....
]]></expres>
<page>https://bs.to/[selectseason.param1]</page>
<referer>https://bs.to/serie-alphabet</referer>
<agent>Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/47.0.2526.70 Mobile/13C71 Safari/601.1.46</agent>
<cookieJar></cookieJar>
<Accept>*/*</Accept>
</regex>

<regex>
<name>getUrl</name>
<expres>href="(.*?)".*?class="hoster-player"</expres>
<page>https://bs.to/[selectsession.param3]</page>
<cookieJar></cookieJar>
<agent>Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0</agent>
<Accept>*/*</Accept>
<referer>https://bs.to/serie-alphabet</referer>
<!-- <noredirect>true</noredirect> -->
<includeheaders/>
</regex>

 <regex>
 <name>playvideo</name>
<expres><![CDATA[#$pyFunction
import urlresolver
def GetLSProData(page_data,Cookie_Jar,m):
	url = '$doregex[getUrl]'
	streamLink = urlresolver.resolve(url)
	return streamLink
]]></expres>
 <page></page>
<cookieJar></cookieJar>
<agent>Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0</agent>
<Referer></Referer>
<Accept>*/*</Accept>
</regex>

</item>
 

boul

Member
Nov 24, 2017
30
0
6
thank you to help me, I tried to write this regex, but it wrong. some one can tell me where i wrong please.

<item>
<Title>regex futbolibre</title>
<link>$doregex[getDecodedCode]|referer=hxxp://futbollibre.online/cdn-cgi/apps/head/_8TcguhGAY1pkXXQrzoa_JPjxIk.js</link>
<regex>
<name>getDecodedCode</name>
<expres>$pyFunction:base64.b64decode($doregex[getEncodedCode])</expres>
<page></page>
</regex>
<regex>
<name>getEncodedCode</name>
<expres>var futbollibre_0x4e65.*'(.*?)'</expres>
<page>hxxp://futbollibre.online/espn-2/</page>
<referer>hxxp://futbollibre.online/espn-2/embed.html</referer>
<agent>Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0</agent>
<cookieJar></cookieJar>
</regex>
<thumbnail></thumbnail>
</item>
 

jpjrando

New member
Mar 16, 2015
9
0
0
Can someone help me to resolve this link please
Code:
hxxps://www.myfree-tivi.com/watch/s
Thanks in advance
 

HAJAR

Banned
May 27, 2018
19
0
0
middelburg
hi someone can help me please regex for thanks for everyone thanks
url ustream.tv/channel/EpqDGDmX8Cn


url.kurdmax.tv/live
url .kurdmaxshow.tv/live
 
Last edited:
Status
Not open for further replies.