Recent Changes - Search:

LiveStreamsPro

PmWiki

pmwiki.org

edit SideBar

ConditionalDoRegex

Conditional doregex

A simple if condition could be written in single line.
For example, say you wanted to play hd link, if available otherwise sd link

<item>
    <title>play HD or SD</title>
    <link>$doregex[get_decoded]</link>
    <regex>
        <name>get_decoded</name>
        <expres>$pyFunction:urllib.unquote('$doregex[select_Url]')</expres>
        <page></page>
    </regex>
    <regex>
        <name>select_Url</name>
        <expres>$pyFunction: '$doregex[get_HD]' if not '$doregex[get_HD]'=='' else '$doregex[get_SD]' </expres>
        <page></page>
    </regex>
    <regex>
        <name>get_HD</name>
        <expres>"hd-2".+?"(.+?)"</expres>
        <page>http://chiasenhac.com/hd/video/v-video/nuoc-mat-hoa-da~luong-bich-huu~1004779.html</page>
    </regex>
    <thumbnail>http://data.chiasenhac.com/data/thumb/1005/1004779_prv.jpg</thumbnail>
    <regex>
        <name>get_SD</name>
        <expres>"file".+?"(.+?)"</expres>
        <page>http://chiasenhac.com/hd/video/v-video/nuoc-mat-hoa-da~luong-bich-huu~1004779.html</page>
    </regex>
    <thumbnail>http://data.chiasenhac.com/data/thumb/1005/1004779_prv.jpg</thumbnail>
</item>
for multiple if else you write like this

'$doregex[server1]' if not '$doregex[server1]'=='' else '$doregex[server2]' if not '$doregex[server2]'=='' else '$doregex[server3]' 
           if not '$doregex[server3]'=='' else ....................



for multiple link to be retried one by one, there is no method currently. will look into in future.

Edit - History - Print - Recent Changes - Search
Page last modified on February 25, 2016, at 05:49 PM