Recent Changes - Search:

LiveStreamsPro

PmWiki

pmwiki.org

edit SideBar

Rawpost

Send HTTP POST to web server

To give support to Wat TV, so can play some of their channels, but also for other purposes such as posting form content, HTTP/Post can be done with the <post> or <rawpost> element.
With <post> post data get encoded with <rawpost> not.

Example1 NT1:

<item>
    <title>NT1 channel sample</title>
    <link>$doregex[get-media]|Cookie=$get_cookies$&amp;X-Forwarded-For=77.132.237.189&amp;User-Agent=Mozilla%2F5.0%20(Windows%20NT%206.1%3B%20rv%3A32.0)%20Gecko%2F20100101%20Firefox%2F32.0</link>
    <regex>
        <name>get-media</name>
        <expres>(http.*440k.*)</expres>
        <page>$doregex[convert-url]</page>
        <agent>Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0</agent>
        <x-forward>77.132.237.189</x-forward>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>convert-url</name>
        <expres>$pyFunction:'$doregex[get-url]'.replace('\\/','/')</expres>
        <page></page>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>get-url</name>
        <expres>"(http.*?)"</expres>
        <page>http://api.wat.tv/services/Delivery</page>
        <agent>MYTF1 4.1.2 rv:60010000.384 (iPod touch; iPhone OS 6.1.5; fr_FR)</agent>
        <rawpost>udid=FD6180E5-187C-4981-B23B-8CD2D8A3D8EF&amp;useragent=Mozilla%252F5.0%2B%2528iPhone%253B%2BU%253B%2BCPU%2Blike%2BMac%2BOS%2BX%253B%2Ben%2529%2BAppleWebKit%252FXX%2B%2528KHTML%252C%2Blike%2BGecko%2529&amp;context=WIFI&amp;deviceType=sph&amp;mediaId=L_NT1&amp;appName=sdk%2FIphone%2F1.0&amp;authKey=$doregex[get-token]&amp;method=getLiveUrl</rawpost>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>get-token</name>
        <expres>$pyFunction:wattv.getWatToken('L_NT1')</expres>
        <page></page>
    </regex>
</item>
<item>

Example 2 for hd1:
<item>
    <title>LiveHD1 channel sample</title>
    <link>$doregex[get-media]|Cookie=$get_cookies$&amp;X-Forwarded-For=77.132.237.189&amp;User-Agent=Mozilla%2F5.0%20(Windows%20NT%206.1%3B%20rv%3A32.0)%20Gecko%2F20100101%20Firefox%2F32.0</link>
    <regex>
        <name>get-media</name>
        <expres>(http.*896k.*)</expres>
        <page>$doregex[convert-url]</page>
        <agent>Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0</agent>
        <x-forward>77.132.237.189</x-forward>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>convert-url</name>
        <expres>$pyFunction:'$doregex[get-url]'.replace('\\/','/')</expres>
        <page></page>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>get-url</name>
        <expres>"(http.*?)"</expres>
        <page>http://api.wat.tv/services/Delivery</page>
        <agent>MYTF1 4.1.2 rv:60010000.384 (iPod touch; iPhone OS 6.1.5; fr_FR)</agent>
        <rawpost>udid=FD6180E5-187C-4981-B23B-8CD2D8A3D8EF&amp;useragent=Mozilla%252F5.0%2B%2528iPhone%253B%2BU%253B%2BCPU%2Blike%2BMac%2BOS%2BX%253B%2Ben%2529%2BAppleWebKit%252FXX%2B%2528KHTML%252C%2Blike%2BGecko%2529&amp;context=WIFI&amp;deviceType=sph&amp;mediaId=L_HD1&amp;appName=sdk%2FIphone%2F1.0&amp;authKey=$doregex[get-token]&amp;method=getLiveUrl</rawpost>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>get-token</name>
        <expres>$pyFunction:wattv.getWatToken('L_HD1')</expres>
        <page></page>
    </regex>
</item>

You should be able to get TMC as well, if you just change the media id (replace L_HD1 in two places). Not all channel work like that, its only the ones requiring auth key.


For login or form data with rawpost, this explains how the login and cookie regex would work for the following example data:


  • destination:
  • email:myaddress@mail.com
  • password:abc123
  • submit:SIGN IN
  • submit:SIGN IN



The <rawpost> tags needs to enter the following details:
destination= email=myaddress@mail.com password=abc123 submit=SIGN IN submit=SIGN IN


format would be like this:
<rawpost>destination=email%20myaddress@mail.com&password=abc123 and so on</rawpost>


your destionation is key and email%20myaddress@mail.com is value and you seperate this by & .


What should be in the postdata usually in "input" tag of your html . Most probably you need the login cookie for next request so add <cookieJar></cookieJar> inside regex

Example 3 with rawpost and x-requested-for:

<item>
    <title>Sony Mix</title>
    <link>plugin://plugin.video.f4mTester/?maxbitrate=1500000&amp;streamtype=HLS&amp;url=$doregex[encodedurl]</link>
    <regex>
        <name>encodedurl</name>
        <expres>$pyFunction:urllib.quote_plus('$doregex[get-url]|Cookie=$get_cookies$&amp;User-Agent=Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko&amp;X-Playback-Session-Id=$GUID$$doregex[get-Logout]')</expres>
        <page></page>
    </regex>
    <regex>
        <name>get-url</name>
        <expres>blank\^(.*?)\^</expres>
        <page>http://watchsuntv.com/tv_episodes/system/1.0/framework.php</page>
        <referer>http://watchsuntv.com/tv_episodes/system/1.0/framework.php?view_name=web_channels</referer>
        <rawpost>ajax=1&amp;ajaxView=web_channels&amp;view_name=web_channels&amp;t=$epoctime$&amp;action=loadChannel&amp;channelID=170</rawpost>
        <x-req>XMLHttpRequest</x-req>
        <cookieJar>$doregex[LoginAndCookie]</cookieJar>
    </regex>
    <regex>
        <name>LoginAndCookie</name>
        <expres></expres>
        <page>http://www.watchsuntv.com/users/login</page>
        <referer>http://www.watchsuntv.com/users/member/index</referer>
        <x-req>XMLHttpRequest</x-req>
        <rawpost>amember_login=XXXXXXXX&amp;amember_pass=XXXXXXXX&amp;login_attempt_id=$doregex[LoginAttemptID]&amp;amember_redirect_url=http%3A%2F%2Fwatchsuntv.com%2Fusers%2Fmember</rawpost>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>LoginAttemptID</name>
        <expres>login_attempt_id" value="(.*?)"</expres>
        <page>http://www.watchsuntv.com/users/member/index</page>
        <referer>http://watchsuntv.com/</referer>
        <cookieJar></cookieJar>
    </regex>
    <regex>
        <name>get-Logout</name>
        <expres></expres>
        <page>http://watchsuntv.com/users/logout</page>
        <referer>http://watchsuntv.com/tv_episodes/system/1.0/framework.php?view_name=web_channels</referer>
        <cookieJar></cookieJar>
    </regex>
    <thumbnail></thumbnail>
</item>

Edit - History - Print - Recent Changes - Search
Page last modified on March 14, 2016, at 04:48 AM
Free Web Hosting