Jump to content


Photo

gstreamer passing cookie http header via URI


  • Please log in to reply
33 replies to this topic

Re: gstreamer passing cookie http header via URI #21 littlesat

  • PLi® Core member
  • 56,267 posts

+691
Excellent

Posted 21 July 2013 - 10:43

I'm a bit doubting as I suggest the thinks around

 

gchar *extra_headers;

 

are a bit risky... it is free'd later... but possibly this can made better...

 

I was waiting on pieterg's meaning here.


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: gstreamer passing cookie http header via URI #22 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 21 July 2013 - 11:23

Glib uses a garbage collector. It may not be as "evil" as it looks.

* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: gstreamer passing cookie http header via URI #23 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 21 July 2013 - 12:21

there is a bit too much string copying going on (into stack buffers which are needlessly large, and without checking any limits)

I'll rewrite the string parsing, and commit it.

Re: gstreamer passing cookie http header via URI #24 littlesat

  • PLi® Core member
  • 56,267 posts

+691
Excellent

Posted 21 July 2013 - 12:32

Thanks!!!

 

That was exactly my concern...


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: gstreamer passing cookie http header via URI #25 msenoz

  • Member
  • 16 posts

0
Neutral

Posted 23 July 2013 - 16:46

I have tried the new extra-header functinonality but got below error with greenscreen;

playing 4097:0:0:0:0:0:0:0:0:0:http%3a//cdn9.video.mail.ru/v/42520740.mp4?sign=d54d57f0c5ab149f79c694cfc501eeea38618083&slave[]=s%253Ahttp%253A%252F%252F127.0.0.1%253A5010%252F42520740-v.mp4&p=0&expire_at=1374679015:mailru sd
[eDVBCAService] free slot 0 demux 0 for service 1:0:1:10:1:1:1A4AE8F:0:0:0:
[eDVBCAService] free service 1:0:1:10:1:1:1A4AE8F:0:0:0:
decoder state: play, vpid=-1, apid=-1
DEMUX_STOP - pcr - ok
DEMUX_STOP - video - ok
VIDEO_STOP - ok
AUDIO_STOP - ok
DEMUX_STOP - audio - ok
AUDIO_CONTINUE - ok
cleaning up
TuxTxt cache cleared
start release channel timer
eServiceMP3::construct!
eServiceMP3::playbin uri=http://cdn9.video.mail.ru/v/42520740.mp4?sign=d54d57f0c5ab149f79c694cfc501eeea38618083&slave[]=s%3Ahttp%3A%2F%2F127.0.0.1%3A5010%2F42520740-v.mp4&p=0&expire_at=1374679015
eServiceMP3::starting pipeline
setting extra-header 'Cookie:video_key=367684'
PC: 2acbe7e4
 00000000 10008700 00000001 2ace0000
 2aceaa00 fffffffc 00000001 00000000
 00000001 00000000 2ae14000 00000001
 2ae0e5b0 00000000 00000001 00000001
 7fd2b0e0 2acd22c8 01d418a8 2d083ee4
 7fd2b0e0 7fd2b0d8 7fd2b0d4 ffffffff
 00000002 2ad4837c 00000001 00000000
 2aceaa00 7fd2b060 ffffffff 2acc7978
As a final action, i will try to dump a bit of code.
I just hope that this won't crash.
2acbe7e4: 18 00 84 8c 1c 00 bf 8f 08 00 20 03 20 00 bd 27 1c 00 bf 8f 21 10 00 00 08 00 e0 03 20 00 bd 27 (end)
-------
main thread is non-idle! display spinner!
Killed


Re: gstreamer passing cookie http header via URI #26 littlesat

  • PLi® Core member
  • 56,267 posts

+691
Excellent

Posted 23 July 2013 - 18:14

And did you reflash to exclude a glib issue (are you able to play mp3s or mkv's etc???)

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: gstreamer passing cookie http header via URI #27 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 23 July 2013 - 18:42

And what does your setting look like? I had to guess the syntax, by looking at the parsing code.

Re: gstreamer passing cookie http header via URI #28 msenoz

  • Member
  • 16 posts

0
Neutral

Posted 23 July 2013 - 20:53

And did you reflash to exclude a glib issue (are you able to play mp3s or mkv's etc???)

 

Yes I did reflash and tested a mp3 working fine.

 

And what does your setting look like? I had to guess the syntax, by looking at the parsing code.

 

my setting is like below;

config.mediaplayer.extraHeaders = NoSave(ConfigText(default=""))

def setExtraHeaders(dictHeaders):
        headersString = '|'.join([(key + ':' + value) for key, value in dictHeaders.iteritems()])
        config.mediaplayer.extraHeaders.setValue(headersString)

def resetExtraHeaders()
        config.mediaplayer.extraHeaders.setValue("")

def play(session, url, headers=None):
        resetExtraHeaders()
        if headers:
                setExtraHeaders(headers)
        sref = eServiceReference(4097,0,url)
        session.nav.playService(sref)

testPlay():
        session = getSession()
        headers={"Cookie":"video_key=88265"}
        url = "http://somevideourl.com"
        play(session,url,headers)


Re: gstreamer passing cookie http header via URI #29 pieterg

  • PLi® Core member
  • 32,766 posts

+245
Excellent

Posted 23 July 2013 - 21:38

most likely a refcount issue, my guess is that servicemp4.cpp would not have worked with more than one header.
I've reduced the scope of the header GValue object, bringing this issue to the surface.

Re: gstreamer passing cookie http header via URI #30 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 24 July 2013 - 00:21

First of all thank you for commiting and fixing my patch. I tested it and found the problem - GValue header has to be zero-filled before passing it to g_value_init:

 

Attached File  0001-servicemp3-fix-extra-header-support.patch.txt   872bytes   30 downloads


Edited by mx3L, 24 July 2013 - 00:22.


Re: gstreamer passing cookie http header via URI #31 littlesat

  • PLi® Core member
  • 56,267 posts

+691
Excellent

Posted 24 July 2013 - 08:18

Tested and applied...

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: gstreamer passing cookie http header via URI #32 Cofybreak

  • Senior Member
  • 115 posts

0
Neutral

Posted 30 August 2015 - 15:06

Hi

I need to set custom user-agent for E2, not for gstreamer!!!

For IPTV channels in bouquets(ts stream sRef 1:0:1:.....).

Is it possible?

And how?

 

Thanks



Re: gstreamer passing cookie http header via URI #33 Cofybreak

  • Senior Member
  • 115 posts

0
Neutral

Posted 30 August 2015 - 20:25

I compiled enigma2 with other user-agent and this work for me, but will be nice if is possible to set custom user agent and headers in settings. Just as E2 mediaplayer. Regards

Re: gstreamer passing cookie http header via URI #34 Cofybreak

  • Senior Member
  • 115 posts

0
Neutral

Posted 22 September 2015 - 19:23

HI, made a patch for E2 to set custom http options for every url.

Currently only user-agent and http timeout are supported.


To set user-agent: --> ?e2opt>useragent=myuseragent?<

To set http timeout in seconds --> ?e2opt>timeout=30?<


To set custom user-agent and custom timeout --> ?e2opt>useragent=myuseragent&timeout=30<?

Example:

 


hxxp://example.com/path/to/stream/stream.ts?e2opt>useragent=myuseragent

hxxp://example.com/path/to/stream/?e2opt>useragent=myuseragent&timeout=30<?stream.ts

 

Attached Files




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users