Recent Changes - Search:



edit SideBar


F4M proxy with support for HDS streams

To play HDS but also m3u/hls streams you can call the F4Mproxy via the f4mtester plugin as in following example. If your url requires headers to be sent use | (pipe) and URL-encode the url.

<title>bbc outside uk</title>

There are other optional parameters if you want to include using & , like name, and maxbitrate etc. Also, you can now pass two more params, one is proxy "iport" format for example and other is proxy_for_chunks which is True/False. Some server only check at the manifest level (.f4m link) to make sure they are from their region (in this example US) but when you pass that block using their region proxy, then rest is open, so pass the US proxy and set the proxy_for_chunks to false. This way, it will get the manifest via proxy but rest will be as fast as your network could stream.

LSPRO allows the use of $$TSDOWNLOADER$$ parameter in m3u url. If present, the .ts entries will be executed with f4mtester.


With LSPro version 2.6.7 and f4mproxy version 2.5.9, now we support $$HLSRETRY$$ (HLS retry) for streams which support hls (.m3u8) but disconnects users after sometime. This is same as $$TSDOWNLOADER$$ but works with .m3u8 files. You need to make sure that your urls should be .m3u8. $$HLSRETRY$$ is used when you want to load the m3u8 which contains other m3u8 and you want to list and play with f4m.

When using f4mtester plugin syntax then you simply usestreamtype=HLSRETRY (just like you call for HLS OR HDS it's a new type).


<title> IPTV Makelist</title>

Courtesy of moshoodo123.

Version 2.6.1 of f4mproxy and tester now support callbackparam and callbackpath. Callbackparam is string that the callback function will recieve. Callbackpath is the full file path of the python file containing the callback function, i have made the callback function static, it should be defined as:

def f4mcallback(param, type, error, Cookie_Jar, url, headers):


  • param is the callbackparam you will receive back.
  • type is 1 for time being.
  • error is the error object for m3u8 file (for example 403).
  • CookieJar is the cookies
  • url is the old url the player was playing and headers are the headers it was using.

For time being, the callback function will only be used in situation where server returns 403 (due to cookie expiry or Url expiry for example filmon hd urls which are valid for 45 seconds or little more). The return value of callback function should be new url and the cookies.

Here is an example of filmon high quality stream playing more than its allowed to.

def f4mcallback(param, type, error, Cookie_Jar, url, headers):
<title>TEST | BBC News - FILMON</title>

def getCookiesString(cookieJar):
       for index, cookie in enumerate(cookieJar):
  + "=" + cookie.value +";"
   except: pass
   #print 'cookieString',cookieString
   return cookieString

def f4mcallback(param, type, error, Cookie_Jar, url, headers):
 if type==1:
   return newurl,Cookie_Jar
   return '',None

def getUrl(param, Cookie_Jar):
 import requests, re, urllib, inspect
 headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'}
 url = ''+param
 session = requests.session()
 session.cookies = Cookie_Jar
 source= session.get(url, headers = headers)
 swf = re.findall('streamer":"(.*?)"', source.text)[0]
 cleanswf = swf.replace('\\/','/')
 referer = '' + cleanswf
 headers1 = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36', 'Referer': url, 'X-Requested-With': 'XMLHttpRequest'}
 url2 = ''%param
 source1= session.get(url2, headers = headers1)
 getHD = re.findall('"high","url":"([^"]+)"', source1.text)[0]
 return getHD

def GetLSProData(page_data,Cookie_Jar,m):
 import os,urllib
 referer = ''
 print 'url',url
 return urllib.quote_plus (url + '|Referer=' + referer+'&cookie='+getCookiesString(Cookie_Jar)+'&User-Agent=Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36') +'&callbackpath='+urllib.quote_plus(callbackfunction)+'&callbackparam='+urllib.quote_plus(callbackparam)

here you can see f4mcallback function reusing the same function which created the url, however since film returns different server address which runs different stream numbers, i am reusing the old server name so that the video could be stitched without any hitch.

Edit - History - Print - Recent Changes - Search
Page last modified on October 06, 2016, at 01:57 PM