Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #11  
Old 12-07-2015, 04:35 PM
sargonax sargonax is offline
Junior Member
 
Join Date: Sep 2014
Posts: 8
sargonax is on a distinguished road
Default

Re: telewizjada.net


How 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....
Reply With Quote
  #12  
Old 12-07-2015, 04:50 PM
biezom biezom is offline
Senior Member
 
Join Date: Sep 2014
Posts: 1,025
biezom is on a distinguished road
Default

Re: telewizjada.net


Quote:
Originally Posted by sargonax View Post
How 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....

see your inbox i sent you a message
Reply With Quote
  #13  
Old 12-07-2015, 06:31 PM
midi23 midi23 is offline
Junior Member
 
Join Date: Jul 2015
Posts: 10
midi23 is on a distinguished road
Default

Re: telewizjada.net


hi

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"
but doesn't work with me

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)
Reply With Quote
  #14  
Old 01-11-2016, 01:53 PM
CristianoA CristianoA is offline
Senior Member
 
Join Date: Nov 2012
Location: Micronesia
Posts: 261
CristianoA is on a distinguished road
Default

Re: telewizjada.net


Quote:
Originally Posted by biezom View Post
hi

need find your own Cookies

Code:
livestreamer --http-header "Cookie=msec=DG//IMy2clz7Rv5gDJsiuyDFV9bcF910PaR9iqRT43UBTegxS20YvNvzrooUyXMDfZvL3UyF8JZjmdVtQcJeVpe1m7Klo9vAlj7fzTY=; sessid=vaskg4d891tgbho4n81t0ia9g3"   "hlsvariant://http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8" best -o Polsat-Sport-Extra.ts


Code:
[cli][info] Found matching plugin stream for URL hlsvariant://http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/playlist.m3u8
[cli][info] Available streams: 576p (worst, best)
[cli][info] Opening stream: 576p (hls)
[download][Polsat-Sport-Extra.ts] Written 5.0 MB (36s @ 139.4 KB/s)
how to found cookies using windows ?
Reply With Quote
  #15  
Old 01-26-2016, 12:46 PM
CristianoA CristianoA is offline
Senior Member
 
Join Date: Nov 2012
Location: Micronesia
Posts: 261
CristianoA is on a distinguished road
Default

Re: telewizjada.net


anyone can help ?

http://www.telewizjada.net/live.php?cid=68
Reply With Quote
  #16  
Old 02-03-2016, 11:31 AM
mleczan mleczan is offline
Junior Member
 
Join Date: Jan 2016
Posts: 6
mleczan is on a distinguished road
Default

Re: telewizjada.net


If 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.
Reply With Quote
  #17  
Old 02-11-2016, 03:04 AM
slihter slihter is offline
Junior Member
 
Join Date: Feb 2016
Posts: 1
slihter is on a distinguished road
Default

Re: telewizjada.net


Hey, 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
That's why i need to insert into livestreamer with parameters in Python.

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
And i get what i need:
HTML Code:
http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/chunklist_w792338458.m3u8
But on linux i get:
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
Reply With Quote
  #18  
Old 02-11-2016, 04:07 AM
biezom biezom is offline
Senior Member
 
Join Date: Sep 2014
Posts: 1,025
biezom is on a distinguished road
Default

Re: telewizjada.net


Quote:
Originally Posted by slihter View Post
Hey, 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
That's why i need to insert into livestreamer with parameters in Python.

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
And i get what i need:
HTML Code:
http://l133.telewizjada.net:1935/tw/2014tvpolsatsportextra/chunklist_w792338458.m3u8
But on linux i get:
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

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)
Reply With Quote
Reply Post New Thread
Tags:



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 11:14 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons