Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom user agent #156

Closed
daveftw84 opened this issue Sep 28, 2017 · 16 comments
Closed

Custom user agent #156

daveftw84 opened this issue Sep 28, 2017 · 16 comments
Labels

Comments

@daveftw84
Copy link

It's not working for me using the latest version I added the useragent and after a sniff I noticed it's not applying it

@Cigaras
Copy link
Owner

Cigaras commented Sep 29, 2017

I have no way to test it because I do not watch streams that require custom user agent, it did work #79 and nothing was changed since then.

@daveftw84
Copy link
Author

daveftw84 commented Sep 29, 2017 via email

@daveftw84
Copy link
Author

daveftw84 commented Sep 29, 2017 via email

@Cigaras
Copy link
Owner

Cigaras commented Oct 3, 2017

Yes, I need a sample stream, but I am quite busy and am not sure when I'll be able to check it.

Also I need You to teach me how to check that user agent.

@daveftw84
Copy link
Author

daveftw84 commented Oct 3, 2017 via email

@daveftw84
Copy link
Author

daveftw84 commented Oct 3, 2017 via email

@Cigaras
Copy link
Owner

Cigaras commented Oct 9, 2017

I still have no sample stream and no idea how to check if custom user agent works or not.

According to documentation page 70 this is the way to set a custom user agent:

HTTP.Headers[’User-Agent’] = ’My Plug-in’

So my plug-in sets this every time Play button is clicked (lines 274-276 in __init__.py file):

    # Custom User-Agent string
    if Prefs['user_agent']:
        HTTP.Headers['User-Agent'] = Prefs['user_agent']

If You want You can remove this if statement and replace it with a hard-coded declaration like mentioned above, but I doubt it will have any effect, and there is nothing else I can suggest...

@daveftw84
Copy link
Author

daveftw84 commented Oct 9, 2017 via email

@daveftw84
Copy link
Author

daveftw84 commented Oct 9, 2017 via email

@Lunaden
Copy link

Lunaden commented Dec 7, 2017

Work when adding

ObjectContainer.user_agent = 'my-agent'

to init.py in def Start():

@daveftw84
Copy link
Author

daveftw84 commented Dec 8, 2017 via email

@daveftw84
Copy link
Author

daveftw84 commented Dec 8, 2017 via email

Cigaras added a commit that referenced this issue Dec 18, 2017

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
* Additional User-Agent implementation (#156)
* #EXTVLCOPT:http-user-agent m3u tag support (#164)
@Cigaras
Copy link
Owner

Cigaras commented Dec 18, 2017

Just committed a new version that uses both methods to set the user agent string – the HTTP.Headers[’User-Agent’] and ObjectContainer.user_agent. To get this version click Clone or download -> Download ZIP on the front page of this repository.

In addition to that it is now possible to specify user agent string for every stream individually using M3U attribute user_agent or directive #EXTVLCOPT:http-user-agent.

However I do not have a way to test it properly, that's why I did not make a release version of it jet, please test it and report Your findings.

@daveftw84
Copy link
Author

it works

@ghost
Copy link

ghost commented Apr 11, 2018

please add new line in your code per http-referrer i need add user agent and referrer per ini channel its posibol?

@Cigaras
Copy link
Owner

Cigaras commented Sep 26, 2018

Referer added in version 2.1.9

@Cigaras Cigaras closed this as completed Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants