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]
"
*** GITHUB ***
.
.
URL Resolver [GIT]
.
.
.
.
Jx Update [REDIRECT]
.
.
*** 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)
.
.
Latest topics
» SportsDevil back on Mega
Yesterday at 14:38 by skyhigh

» SportsDevil back on Mega
Fri 17 Nov - 5:30 by jairoxyz

» youtube playlists
Tue 14 Nov - 2:43 by jujuuj

» afromotion
Thu 9 Nov - 13:59 by doctor4979

» ? works on VLC, but not on kodi ?
Mon 6 Nov - 13:06 by jujuuj

» how make a request.post to get a repond
Tue 31 Oct - 16:01 by jujuuj

» how to play this in kodi
Tue 31 Oct - 15:21 by jujuuj

FRIENDS / PARTNERS

forum

créer un forum


Help with regex

View previous topic View next topic Go down

Help with regex

Post by Zendarino on Thu 20 Apr - 22:31

Hi! I have a big problem with this regex, is working well. But in the various sections(ex,Animation, western,)is showing only 18 movies, instead, there are so many movies.
Also, the "Film" section and "Al cinema" sections are empty. Thx for your help, and sorry for my horrible english

Code:
<item>
<title>[B][COLOR blue]Altadefinizione[/COLOR][/B]</title>
<link>$doregex[makelist1]</link>
<regex>
<name>makelist1</name>
<listrepeat><![CDATA[
<title>[makelist1.param2]</title>
<link>$doregex[makelist]</link>
]]></listrepeat>
<expres><![CDATA[<a href="(/film-streaming.*?)">(.*?)</a></li>]]></expres>
<page>http://altadefinizione.zone</page>
<cookieJar></cookieJar>
</regex>
 
<regex>
<name>makelist</name>
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[stream]</link>
<thumbnail>http://altadefinizione.zone[makelist.param3]</thumbnail>
]]></listrepeat>
<expres><![CDATA[<a href="(.*?)" title="(.*?)" class="short-images-link">.*?\n.*?<img src="(.*?)" alt="]]></expres>
<page>http://altadefinizione.zone[makelist1.param1]</page>
<cookieJar></cookieJar>
</regex>
 
<regex>
<name>stream</name>
<expres><![CDATA[file: "(.*?)",]]></expres>
<page>$doregex[url1]</page>
</regex>
 
<regex>
<name>url1</name>
<expres><![CDATA[" data-link="(http://.*?)">]]></expres>
<page>[makelist.param1]</page>
</regex>
<thumbnail>http://www.hwlegendshack.com/out.php/i386_hdlogo-yellow.jpg</thumbnail>
<fanart>https://www.tomshw.it/data/images/9/4/3/7/alta-def-443083a67fb4827635200b1c85e812848.jpg</fanart>
</item>

Zendarino

Messages : 6
Date d'inscription : 2017-04-20

View user profile

Back to top Go down

ADD a makelist of pages(-numbers) in an existing (but uncomplete, but cool anyway) makelist

Post by jujuuj on Thu 20 Apr - 23:27

If your english is horrible, mine is prehistoric@l ...

if you look at the homepage  Altadefinizione.watch , you can see that
all the categories are working.

The menu film and the menu al cinema are different .. that is why it is off ( the source code is not the same for these two ...)
when doing the makelist you will have to deal with that

the menu called  al[space]cinema  may be off because of the [space] ... this happens ; or because the link 'says' del-cinema and not al cinema ...  we 'll have to check this ...



your makelist is only showing the page 1 ? No problem, this is easy : you just have to add a makelist-of-pagenumbers just before the makelist-of-movies ...  basically, the structure should be like this

Code:

<item>
<title>Altadefinizione</title>
<link>$doregex[makelist-of-categories]</link>

<regex>
<name>makelist-of-categories</name>
<listrepeat><![CDATA[
<title>[makelist-of-categories.param2]</title>
<link>$doregex[makelist-of-pagenumbers]</link>
]]></listrepeat>
<expres><![CDATA[<a href="(/film-streaming.*?)">(.*?)</a></li>]]></expres>
<page>http://altadefinizione.watch</page>
<cookieJar></cookieJar>
</regex>


<regex>
<name>makelist-of-pagenumbers</name>   <!-for that category-->
<listrepeat><![CDATA[
<title>???</title>
<link>$doregex[makelist-of-movies]</link>
]]></listrepeat>
<expres>???</expres>
<page>http://altadefinizione.watch[makelist-of-categories.param1]</page>
<cookieJar></cookieJar>
</regex>


<regex>
<name>makelist-of-movies</name>    <!-just for that category and that page-number-->
<listrepeat><![CDATA[
<title>[makelist.param2]</title>
<link>$doregex[stream]</link>
<thumbnail>http://altadefinizione.watch[makelist.param3]</thumbnail>
]]></listrepeat>
<expres><![CDATA[<a href="(.*?)" title="(.*?)" class="short-images-link">.*?\n.*?<img src="(.*?)" alt="]]></expres>
<page>http://altadefinizione.watch[makelist-of-categories.param1]/[makelist-of-pagenumbers.param.1]</page>
<cookieJar></cookieJar>
</regex>

<!-- the rest is to read the link ... -->
<regex>
<name>stream</name>
<expres><![CDATA[file: "(.*?)",]]></expres>
<page>$doregex[url1]</page>
</regex>

<regex>
<name>url1</name>
<expres><![CDATA[" data-link="(http://.*?)">]]></expres>
<page>[makelist.param1]</page>
</regex>
<thumbnail>http://www.hwlegendshack.com/out.php/i386_hdlogo-yellow.jpg</thumbnail>
<fanart>https://www.tomshw.it/data/images/9/4/3/7/alta-def-443083a67fb4827635200b1c85e812848.jpg</fanart>
</item>

NOTE THAT we did 3 makelists in a row, very easily :
a list of categories,
a list of page-numbers,
a list of movies ;
then the regex(s) at the end are here to find and open the final link (of 1 movie) [THIS IS THE HARDEST THING TO DO BUT YOU ALREADY HAVE IT]

To make it work, we will have to check the lines <page> that can be a little diferent of what i wrote :
i wrote : "
http://altadefinizione.watch[makelist-of-categories.param1]/[makelist-of-pagenumbers.param.1]
but it could be : "
http://altadefinizione.watch/[makelist-of-categories.param1]/page-[makelist-of-pagenumbers.param.1]
or :"
http://[makelist-of-categories.param1]/pagina[makelist-of-pagenumbers.param.1]
All depends on WHAT is EXACTLY the param we "grab"


Last edited by jujuuj on Fri 21 Apr - 0:04; edited 2 times in total
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Help with regex

Post by jujuuj on Thu 20 Apr - 23:34

In fact, they gave you the solution in tvaddons ... and the only thing you had to do was to add this makelist of page numbers  (between the two other makelist) and modicate a LIL the code (adding this new variable)...

The geek who did that helped you a lot ... and he wanted you to "do the rest" alone ... Wink ...so you can learn ...


Last edited by jujuuj on Fri 21 Apr - 0:08; edited 1 time in total
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Help with regex

Post by jujuuj on Thu 20 Apr - 23:55

Now you have to build the makelist of pagenumbers:

There are a lot of ways to do it :
u can use xml or python,
1.  u can grab every page numbers you find in source code to do the makelist
2. u can grab only the number of lastpage and then build a list of numbers using python
3. u can manually define the number of the last page you want (example : 10 pages in any category)
4. u could try to join all in python (I don't know how ...?)...

this is an example of how it could look (if you chose xml)
Code:

<regex>
<name>makelist-of-pagenumbers</name>   <!-for that category-->
<listrepeat><![CDATA[
<title>???</title>
<link>$doregex[makelist-of-movies]</link>
]]></listrepeat>
<expres>???</expres>
<page>http://altadefinizione.watch[makelist-of-categories.param1]</page>
<cookieJar></cookieJar>
</regex>

or ... (if you chose python)

Code:

<regex> showing page-numbers
<name>makelist-page-num</name>
<listrepeat><![CDATA[
<title>[makelist-categ.param1].- Pagina [makelist-page-number.param1].</title>
<link>$doregex[makelist-movizzzzzzzzzzzz]</link>
<referer></referer>
<thumbnail></thumbnail>
]]></listrepeat>
<expres> (.*?),</expres>
<page>$doregex[get-list-page]</page>
<cookieJar></cookieJar>
</regex>

<regex> just a virtual quantity of pages I decide   = 100
<name>get-list-page</name>                                            
<expres><![CDATA[#$pyFunction
def GetLSProData(page_data,Cookie_Jar,m):

 liste = list(range(102))
 return liste
]]></expres>
<page></page>
</regex>


to write it we need information ...

so we go in <page>http://altadefinizione.watch[makelist-of-categories.param1]</page>
so, for example, I open this page in firefox
<page>http://altadefinizione.watch/film-streaming/avventura/

what do i want ? I want to see all the pages ! but how is the address built ? to know it, just go to the page 2 of the category you chosed ... :  
http://altadefinizione.watch/film-streaming/avventura/page/2/  
so now you can precise the <page> tag of your code :
<page>http://altadefinizione.watch[makelist-of-categories.param1]/page/[makelist-of-pagenumbers.param.1] </page>

what do i want ? I want to see all the pages !  so I need to know what is the last page, so i can do a list of numbers (from 1 to last page)
in the webpage (using firefox ...) http://altadefinizione.watch/film-streaming/avventura/    we can see that last page is number 54
so we go in the source code (CTRL + u in firefox) and search this 54 in the code and we will see (around that 54) the interesting part of code we want ... so we can complete the code ...

... but ... this is YOUR job.  

to build it,  you COULD need that line of the source code (categ. avventura, for example)
<span class="nav_ext">...</span> <a href="http://altadefinizione.watch/film-streaming/avventura/page/54/">54</a>
to build the expres and test it : regex101

Good luck.   More questions about that ? welcome.
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Help with regex

Post by Zendarino on Fri 21 Apr - 11:47

Thank you so much, unfortunately i'm not an expert, i just found this regex and i wanted to put it in my addon.
I would like to learn how to do these things!

Zendarino

Messages : 6
Date d'inscription : 2017-04-20

View user profile

Back to top Go down

Re: Help with regex

Post by jujuuj on Sat 22 Apr - 1:55

02:47:50OK ! So start now !

look : your item and mine are almost the same

the only difference is that I put 1 regex(-makelist) more for page-numbers ...
and so (for my item) the makelist-of-movies just after will "ask to LSP" to look in
<page>http://site/categ-avventura/page[makelist-of-page-number.param1]</page>
when, for you, it will ask to LSP to have a look in
<page>http://site/categ-avventura</page>   (= only page 1 = only 16 movies ...)

If you want to understand,

FIRST OF ALL OPEN THE WEB PAGE IN YOUR BROWSER, and try to understand how the regex works, following the same "way", the same "commands", in your (firefox) browser. AND in the SOURCE CODE of these pages.

Realise that "~EVERY" regex is looking for a particular <expres>-sion  in a precise <page>

And look HOW, in a makelist,  if you look at the line <link> you can see that it "calls" the next regex ...  with a $doregex(~next~one)

LSP is not a magician ... : it just follows the orders written in the item, the regex ...  You can read it, understand it, and "do the same" in firefox.
If you try to read you will understand (soon).  It is easier to understand a regex than to understand me ...  Very Happy


Last edited by jujuuj on Sat 22 Apr - 2:51; edited 1 time in total
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Help with regex

Post by jujuuj on Sat 22 Apr - 2:01

man ... I forgot to tell you : with the names of makelist I choosed, It is impossible that you don't understand what is the regex "doing"

the makelist-of-categories ... is here to make the list of categories cheers
avatar
jujuuj

Messages : 115
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: Help with regex

Post by solved on Tue 27 Jun - 0:46


Solved ... the user left running ... Very Happy

solved

Messages : 35
Date d'inscription : 2017-06-27

View user profile

Back to top Go down

View previous topic View next topic Back to top


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