ok - we will try it. But what about of another http headers - referer, accept-encoding, ...
How to spoof the http headers as for true Internet browser ??
Does it possible to implement such features more elegant way as the following variants
Code:
xbmc.Player().add_http_header('User-Agent', 'Opera/9.80 (X11; Linux i686; U; ru) Presto/2.6.30 Version/10.70')
xbmc.Player().add_http_header('Host', new_host)
xbmc.Player().add_http_header('Accept', 'text/html, application/xml, application/xhtml+xml, */*')
xbmc.Player().add_http_header('Accept-Language', 'ru,en;q=0.9')
xbmc.Player().add_http_header('Accept-Charset', 'iso-8859-1, utf-8, utf-16, *;q=0.1')
xbmc.Player().add_http_header('Accept-Encoding', 'deflate, gzip, x-gzip, identity, *;q=0')
xbmc.Player().add_http_header('Referer', 'http://turbofilm.tv/media/swf/Player14.swf')
xbmc.Player().add_http_header('Connection', 'Keep-Alive'
xbmc.Player().play(url, item)
or
Code:
headers = {'User-Agent': 'Opera/9.80 (X11; Linux i686; U; ru) Presto/2.6.30 Version/10.70',\
'Host': 'cdn.turbofilm.tv',\
'Accept': 'text/html, application/xml, application/xhtml+xml, */*',\
'Accept-Language': 'ru,en;q=0.9',\
'Accept-Charset': 'iso-8859-1, utf-8, utf-16, *;q=0.1',\
'Accept-Encoding': 'deflate, gzip, x-gzip, identity, *;q=0',\
'Referer': 'http://turbofilm.tv/media/swf/Player14.swf',\
'Cookie': 'IAS_ID='+str(phpsessid)+'; _',\
'Cookie2': '$Version=1',\
'Connection': 'Keep-Alive' }
xbmc.Player().add_http_headers(headers)
xbmc.Player().play(url, item)
or
Code:
conn = httplib.HTTPConnection('cdn.turbofilm.tv', 80, 10)
headers = {'User-Agent': 'Opera/9.80 (X11; Linux i686; U; ru) Presto/2.6.30 Version/10.70',\
'Host': 'cdn.turbofilm.tv',\
'Accept': 'text/html, application/xml, application/xhtml+xml, */*',\
'Accept-Language': 'ru,en;q=0.9',\
'Accept-Charset': 'iso-8859-1, utf-8, utf-16, *;q=0.1',\
'Accept-Encoding': 'deflate, gzip, x-gzip, identity, *;q=0',\
'Referer': 'http://turbofilm.tv/media/swf/Player14.swf',\
'Cookie': 'IAS_ID='+str(phpsessid)+'; _',\
'Cookie2': '$Version=1',\
'Connection': 'Keep-Alive' }
conn.request("GET", path, '', headers)
xbmc.Player().play(conn.getresponse(), item)
this is really actual issue for Internet streams and xbmc