TOOLSP
"
WELCOME !

Please ! USE [CODE] tags for your LINKS and CODE.

Favor usar balisas [CODE] para sus vínculos y código.

Merci d'utiliser les balises [CODE] pour vos liens et code.


[code]http://Thank.you[/code]
"
*** Doc. Kodi & PYthon ***
.
.
Python & Modules PY
.
.
.
.
(Video) Cache Kodi
.
.
.
Addons Kodi
.
.
.
Addons Kodi
.
.
*** GITHUB ***
.
.
URLresolver (J.S.) [GIT] +
.
.
.
URLresolver (elD.) [GIT] -
.
.
URLresolver (tvA.) [GIT] -
.
.
.
.
Cloudflare (external) [GIT]
.
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
FRIENDS / PARTNERS

£$π community

créer un forum


Please help fix regex for playing films

Go down

Please help fix regex for playing films Empty Please help fix regex for playing films

Post by vbprofi on Sun 13 Jan - 5:31

Hello,
all 3 pages are parsed successfully and films are listed as items. But I can't play the movies. please help to fix this code.
Code:

<item>
<title>Kemal Sunal Filimlari</title>
<link>$doregex[makelist]</link>

<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR cyan][makelist.param3][/COLOR]</title>
<link>$doregex[play]|user-agent=VLC</link>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   txt = """$doregex[page1] $doregex[page2] $doregex[page3]"""
   return re.findall('(?s)      <a href="(.*?)".*?<img src="(.*?)" alt="(.*?)".*?>      </a>', txt)
]]></expres>
<page></page>
</regex>

<regex>
<name>page1</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle</page>
</regex>

<regex>
<name>page2</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/2</page>
</regex>

<regex>
<name>page3</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/3</page>
</regex>

<regex>
<name>iframe</name>
<expres><![CDATA[<iframe src="(.*?)"]]></expres>
<page>[makelist.param1]</page>
<Referer>[makelist.param1]</Referer>
</regex>

<regex>
<name>play</name>
<expres><![CDATA[sources: [{"file":"(.*?)"]]></expres>
<page>$doregex[iframe]</page>
<Referer>$doregex[iframe]</Referer>
</regex>
</item>

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by vbprofi on Sun 13 Jan - 5:43

this http response headers I have get
Code:

http://www.indirmedenfilmizle1.com/en-buyuk-saban-izle.html

GET /en-buyuk-saban-izle.html HTTP/1.1
Host: www.indirmedenfilmizle1.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Cookie: __cfduid=d3230a00eb4522c0b83efff7d6c66923a1547339607; _ga=GA1.2.1409126942.1547339840; _gid=GA1.2.308836200.1547339840
Connection: keep-alive

HTTP/1.1 200 OK
Date: Sun, 13 Jan 2019 02:01:03 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: public, max-age=0,public
Expires: Sun, 13 Jan 2019 02:01:02 GMT
Link: <http://www.indirmedenfilmizle1.com/wp-json/>; rel="https://api.w.org/", <http://www.indirmedenfilmizle1.com/?p=32610>; rel=shortlink
Vary: Accept-Encoding,User-Agent
X-Turbo-Charged-By: LiteSpeed
Alt-Svc: h2=":443"; ma=60
Server: cloudflare
cf-ray: 498445d2c558c4bf-DUS
Content-Encoding: gzip
----------------------------------------------------------
http://www.indirmedenfilmizle1.com/player/oynat/f2267a17ffe9c794f4f765f06f1b2d44

GET /player/oynat/f2267a17ffe9c794f4f765f06f1b2d44 HTTP/1.1
Host: www.indirmedenfilmizle1.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http://www.indirmedenfilmizle1.com/en-buyuk-saban-izle.html
Cookie: __cfduid=d3230a00eb4522c0b83efff7d6c66923a1547339607; _ga=GA1.2.1409126942.1547339840; _gid=GA1.2.308836200.1547339840
Alt-Used: www.indirmedenfilmizle1.com:443
Connection: keep-alive

HTTP/2.0 200 OK
Date: Sun, 13 Jan 2019 02:01:04 GMT
Content-Type: text/html; charset=UTF-8
Cache-Control: public, max-age=0,public
Expires: Sun, 13 Jan 2019 02:01:03 GMT
Vary: Accept-Encoding,User-Agent
X-Turbo-Charged-By: LiteSpeed
Server: cloudflare
cf-ray: 498445da39c9c4b0-DUS
Content-Encoding: gzip
X-Firefox-Spdy: h2

and this is a code for one movie, for testing, but it does not work:
Code:

<item>
<title>play x</title>
<link>$doregex[x]</link>

<regex>
<name>x</name>
<expres><![CDATA[sources: [{"file":"(.*?)"]]></expres>
<page>http://www.indirmedenfilmizle1.com/player/oynat/f2267a17ffe9c794f4f765f06f1b2d44</page>
<referer>http://www.indirmedenfilmizle1.com/en-buyuk-saban-izle.html</referer>
<cookieJar></cookieJar>
</regex>
</item>

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by Goldonx on Sun 13 Jan - 19:06

There is an syntax error in regular expression. You have to write
Code:
sources: \[\{"file":"(.*?)"

Code:

<item>
<title>play x</title>
<link>$doregex[x]</link>

<regex>
<name>x</name>
<expres><![CDATA[sources: \[\{"file":"(.*?)"]]></expres>
<page>http://www.indirmedenfilmizle1.com/player/oynat/f2267a17ffe9c794f4f765f06f1b2d44</page>
<referer>http://www.indirmedenfilmizle1.com/en-buyuk-saban-izle.html</referer>
<cookieJar></cookieJar>
</regex>
</item>

Goldonx

Messages : 39
Date d'inscription : 2018-02-11

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by vbprofi on Sun 13 Jan - 19:22

oh dammen... mistake. thanks, that is a good work..... the code for single film isworking well. Do you know, what the problem in the code for makelist is? I have fixed the same bug, but that isn't work for youtube videos.
videos with iframe works well.
Code:

<item>
<title>Kemal Sunal Filimleri</title>
<link>$doregex[makelist]</link>

<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR cyan][makelist.param3][/COLOR]</title>
<link>$doregex[play]|user-agent=VLC</link>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   txt = """$doregex[page1] $doregex[page2] $doregex[page3]"""
   return re.findall('(?s)      <a href="(.*?)".*?<img src="(.*?)" alt="(.*?)".*?>      </a>', txt)
]]></expres>
<page></page>
</regex>

<regex>
<name>page1</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle</page>
</regex>

<regex>
<name>page2</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/2</page>
</regex>

<regex>
<name>page3</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/3</page>
</regex>

<regex>
<name>iframe</name>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   if '<iframe src=' in page_data:
    return re.findall('<iframe src="(.*?)"', page_data)[0]
   else:
    return 'plugin://plugin.video.youtube/play/?video_id=' + re.findall('submessage"><a href="http://www.youtube.com/watch?v=(.*?)"', page_data)[0]
]]></expres>
<!-- <expres><![CDATA[<iframe src="(.*?)"]]></expres> -->
<page>[makelist.param1]</page>
<Referer>[makelist.param1]</Referer>
<cookieJar></cookieJar>
</regex>

<regex>
<name>play</name>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   if 'sources: ' in page_data:
    return re.findall('sources: \[\{"file":"(.*?)"', page_data)[0]
   elif 'youtube' in page_data:
    return page_data
]]></expres>
<!-- <expres><![CDATA[sources: \[\{"file":"(.*?)"]]></expres> -->
<page>$doregex[iframe]</page>
<referer>[makelist.param1]</referer>
<cookieJar></cookieJar>
</regex>
</item>

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by Goldonx on Sun 13 Jan - 20:50

Try this, I have not tested it because it takes so much time to get all the films contained in the three pages but that's what I wrote is the right way and it should work

Code:
<item>
<title>Kemal Sunal Filimleri</title>
<link>$doregex[makelist]</link>

<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[COLOR cyan][makelist.param3][/COLOR]</title>
<link>$doregex[play]</link>
]]></listrepeat>
<expres><![CDATA[#$pyFunction
import re
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   txt = """$doregex[page1] $doregex[page2] $doregex[page3]"""
   return re.findall('(?s)      <a href="(.*?)".*?<img src="(.*?)" alt="(.*?)".*?>      </a>', txt)
]]></expres>
<page></page>
</regex>

<regex>
<name>page1</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle</page>
</regex>

<regex>
<name>page2</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/2</page>
</regex>

<regex>
<name>page3</name>
<expres><![CDATA[#$pyFunction
import re
import HTMLParser
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   parser = HTMLParser.HTMLParser()
   s = re.sub("(&.+?;)", lambda m: parser.unescape(m.group()), page_data)
   return s
]]></expres>
<page>http://www.indirmedenfilmizle1.com/category/yesilcam-filmleri-izle/kemal-sunal-filmleri-izle/page/3</page>
</regex>

<regex>
<name>iframe</name>
<expres><![CDATA[iframe[^<>]+src="([^"]+)]]></expres>
<page>[makelist.param1]</page>
<Referer>[makelist.param1]</Referer>
<cookieJar></cookieJar>
</regex>

<regex>
<name>play</name>
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):#vbprofi
   import re,requests
   iframe='$doregex[iframe]'
   if 'youtube' in iframe:
    return 'plugin://plugin.video.youtube/play/?video_id=' + re.findall('.+\/([^\?]+)', iframe)[0]
   else:
    return re.findall('sources: \[\{"file":"(.*?)"', page_data)[0] + '|user-agent=VLC'
]]></expres>
<page>$doregex[iframe]</page>
<referer>[makelist.param1]</referer>
<cookieJar></cookieJar>
</regex>
</item>

Goldonx

Messages : 39
Date d'inscription : 2018-02-11

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by vbprofi on Sun 13 Jan - 23:46

thx, that is working. I will try for other hostings.
best regards!

vbprofi

Messages : 89
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Please help fix regex for playing films Empty Re: Please help fix regex for playing films

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum