Enjoy!need help please. Thank
hxxps://www.afromotion.tv/afrotv/watch/cz
Code:
<item>
<title>Afromotion TV</title>
<link>$doregex[makelist]</link>
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param1]</title>
<link>$doregex[url]|User-Agent=iPhone</link>
<thumbnail>[makelist.param2]</thumbnail>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m,url='https://www.afromotion.tv/afrotv/all'):
import re,requests,HTMLParser
h = HTMLParser.HTMLParser()
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1'}
nextpg = True
channels = []
while nextpg:
html = requests.get(url,headers=headers).text
items = re.findall('<li><div.+?href="([^"]+).+?src="([^"]+).+?title">([^<]+).+?mark">([^<]+)',html)
for surl,thumb,name,country in items:
surl = 'https://www.afromotion.tv' + surl
title = '[COLOR gold]%s[/COLOR] - [COLOR cyan]%s[/COLOR]'%(country,h.unescape(name))
channels.append((title,thumb,surl))
if '">»' in html:
url = 'https://www.afromotion.tv' + re.findall('href="([^"]+)"\s*data-page[^<]+>»',html)[0]
else:
nextpg = False
return sorted(channels)
]]></expres>
<page></page>
<cookieJar></cookieJar>
</regex>
<regex>
<name>url</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):
import re,requests
token = re.findall('token"\s*content="([^"]+)',page_data)[0]
id =re.findall("Tv.play\('([^']+)",page_data)[0]
headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1',
'Referer':'https://www.afromotion.tv/',
'X-Requested-With':'XMLHttpRequest',
'X-CSRF-Token':token}
data = {'_id':id}
surl = 'https://www.afromotion.tv/ajax/gettvdata'
jd = requests.post(surl,data=data,headers=headers,cookies=Cookie_Jar).json()
strurl = jd['url'][0]['src']
return strurl
]]></expres>
<page>[makelist.param3]</page>
<referer>https://www.afromotion.tv/</referer>
<cookieJar></cookieJar>
</regex>
<thumbnail>https://cdn.afromotion.tv/uploads/images/logo-inline.png</thumbnail>
</item>