Audio/video stream recording forums
|
| Attention Visitor: |
You may have to register or log in before you can post:
|
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
#11
|
|||
|
|||
Re: telewizjada.netHow to use the command to see it?
ngrep its ready on eth0 Code:
GET /tw/2014tvpolsatsportextra/playlist.m3u8 HTTP/1.1..Host: l131.telewizja da.net:1935..User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A3 41 Safari/528.16..Accept: text/html,application/xhtml+xml,application/xml;q =0.9,*/*;q=0.8..Accept-Language: en,en-US;q=0.5..Accept-Encoding: gzip, def late..DNT: 1..Referer: http://releases.flowplayer.org/6.0.3/commercial/flow playerhls.swf..Cookie: sessid=693lbj1ei2jj7d63l9n6v2hsu7; msec=TDe%2FJ8noJw GrReBtWZd7vCLECJSaTNQ%2BL6B9iqRT43UBTegxS20YvNvzrooUyXMDfZvL3UyF8JZjmdVtQcJ eVpe1m7KhvdXcjjTfzD472Rk%3D; statid=qc9sr85m075etqqgla0jf5hmu5..Connection: keep-alive.... |
|
#12
|
|||
|
|||
Re: telewizjada.netQuote:
see your inbox i sent you a message |
|
#13
|
|||
|
|||
Re: telewizjada.nethi
that is my cookies Code:
livestreamer --http-header "Cookie=msec=T3q8OJ7mLlWoA7oxBpB4vCaZFsGJHNUjPKV9iqRT43UBTegxS20YvNvzrooUyXMDfZvL3UyF8JZjmdVtQcJeVpe1m7KkvMPAiz7fyign0ho%3D; sessid=5t0s5d81jt06hc53hdpcebinf2" "hlsvariant://http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8" "best" Code:
[cli][info] Found matching plugin stream for URL hlsvariant://http://l133.telewi zjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8 error: Unable to open URL: http://l133.telewizjada.net:1935/tw/2014tvpolsatsport extra/playlist.m3u8 (403 Client Error: Forbidden) |
|
#14
|
|||
|
|||
Re: telewizjada.netQuote:
|
|
#15
|
|||
|
|||
Re: telewizjada.net |
|
#16
|
|||
|
|||
Re: telewizjada.netIf you want to get those coockies you can use this python script:
https://drive.google.com/file/d/0B0d...ew?usp=sharing Pass cid as argument and will get what you need. Also can be simply edited to generate whole record command returning url and coockies in a format which fit livestreamer or whatever you use to record. Last edited by mleczan : 02-03-2016 at 01:47 PM. |
|
#17
|
|||
|
|||
Re: telewizjada.netHey, i want to use Python to create a automatic generate m3u playlist from the website. To get the real playlist it need "cookies"
But with that form cannot build a m3u playlist. I protably i need a livestreamer python module and use it. HTML Code:
cId: 1 Url: http://l149.telewizjada.net:1935/tw/2014tvtvp1/playlist.m3u8 msec: GXries73egCrAb00XYAh632WF8vbHNY8KKZ9iqRT43UBTegxS2kBoJm9qpUF320ea5eRwh7fuNwz0IAqAIZAFZz0ja2n sessid: ctn1euldiv733sld3kqi7bjqr1 On Windows i send: HTML Code:
livestreamer --stream-url --http-header "Cookie=msec=DD7jKsG2I1yrG%2BkyWMUh6H%2BeA5CGDch0P6V9iqRT43UBTegxS20YvNvzrooUyXMDfZvL3UyF8JZjmdVtQcJeVpe1m7KhvdTcijbB1j4hzxXW; sessid=v0oaj458ilc566lg1ce2jst9e2" "hlsvariant://http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8" best HTML Code:
http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/chunklist_w792338458.m3u8 HTML Code:
error: Unable to open URL: http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8 (403 Client Error: Forbidden for url: http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/p laylist.m3u8) Full Script: HTML Code:
#!/usr/bin/env python
import urllib, urllib2, httplib, sys, StringIO, cookielib, re, socket
from xml.etree import ElementTree
import json
import threading
import time
import os
import subprocess
from livestreamer import Livestreamer
HOST = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20121213 Firefox/19.0'
class Something:
def logCall(self, message):
print self.__class__.__name__ + ' ' + message
def getJsonFromExtendedAPI(self, url, post_data = None, save_cookie = False, load_cookie = False, cookieFile = None, jsonLoadsResult = False):
result_json = None
customOpeners = []
cj = cookielib.LWPCookieJar()
def urlOpen(req, customOpeners):
if len(customOpeners) > 0:
opener = urllib2.build_opener( *customOpeners )
response = opener.open(req, timeout = 4)
else:
response = urllib2.urlopen(req, timeout = 4)
return response
try:
if cookieFile is not None:
customOpeners.append( urllib2.HTTPCookieProcessor(cj) )
if load_cookie == True:
cj.load(cookieFile, ignore_discard = True)
headers = { 'User-Agent' : HOST }
data = urllib.urlencode(post_data)
reqUrl = urllib2.Request(url, data, headers)
failedCounter = 0
while failedCounter < 50:
try:
raw_json = urlOpen(reqUrl, customOpeners)
result_json = raw_json.read()
if jsonLoadsResult == True:
result_json = json.loads(result_json)
break
except (httplib.IncompleteRead, socket.timeout) as ex:
failedCounter = failedCounter + 1
self.logCall('getJsonFromExtendedAPI exception: %s - retrying failedCounter = %s' % (str(ex), failedCounter))
if xbmc.abortRequested:
break
time.sleep(.050)
if cookieFile is not None and save_cookie == True:
cj.save(cookieFile, ignore_discard = True)
except (urllib2.URLError, NameError, ValueError, httplib.BadStatusLine) as ex:
self.logCall('ShowList getJsonFromExtendedAPI exception: %s - aborting!' % str(ex))
return None
return result_json
def getCookieItem(self, cookiefile, item):
ret = ''
if os.path.isfile(cookiefile):
cj = cookielib.LWPCookieJar()
cj.load(cookiefile, ignore_discard = True)
for cookie in cj:
if cookie.name == item:
ret = cookie.value
return ret
sth = Something()
coockie = 'coockie.coock'
try:
id = sys.argv[1]
except:
id = raw_input()
if id == None or id == '':
print "Forgot about cId?"
quit()
print "cId: " + id
#id = 1
data = { 'cid': id}
output = sth.getJsonFromExtendedAPI('http://www.telewizjada.net/get_mainchannel.php', post_data = data, jsonLoadsResult = True)
data = { 'url': output['url'] }
sth.getJsonFromExtendedAPI('http://www.telewizjada.net/set_cookie.php', post_data = data, cookieFile = coockie, save_cookie = True)
data = { 'cid': id }
tmp_url = sth.getJsonFromExtendedAPI('http://www.telewizjada.net/get_channel_url.php', post_data = data, cookieFile = coockie, load_cookie = True, jsonLoadsResult = True)
tmp_url = tmp_url['url']
msec = sth.getCookieItem(coockie, 'msec')
sessid = sth.getCookieItem(coockie, 'sessid')
urlstream = tmp_url.split("?")[0]
subprocess.call(["livestreamer", "hls://hlsvariant://" + urlstream,"--stream-url --http-header Cookie=msec=" + msec + "; sessid=" + sessid])
print "Url: " + urlstream
print "msec: " + msec
print "sessid: " + sessid
|
|
#18
|
|||
|
|||
Re: telewizjada.netQuote:
hi try with this two lines instead of your subprocess.call line Code:
command = 'livestreamer --http-header "Cookie=msec=' + msec + '; sessid=' + sessid + '" "hlsvariant://' + urlstream + '" best' os.system(command) |
|
| Tags: telewizjadanet |
| Thread Tools | |
| Display Modes | |
|
|