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

HTTP referer/referrer #187

Closed
ghost opened this issue Apr 11, 2018 · 20 comments
Closed

HTTP referer/referrer #187

ghost opened this issue Apr 11, 2018 · 20 comments

Comments

@ghost
Copy link

ghost commented Apr 11, 2018

Hello, it would be possible to add one more line to add to the channels besides the user agen the referrer
Here is an example of my channels in my list in vcl works perfect but I would like to put it in plex with your help
#EXTINF:-0 tvg-id="ID EPG" tvg-name="NAME " tvg-logo="URL IMG LOGO" group-title="Name Group",NAME CHANNEL
#EXTVLCOPT:http-referrer=URL REFERRER CHANNEL
#EXTVLCOPT:http-user-agent=USER AGENT REQUIRED
URL CHANNEL

@Cigaras
Copy link
Owner

Cigaras commented Apr 27, 2018

I doubt that it will work as there is no mention of referrer in documentation, could You give me a sample stream to test?

If no, then add a new line init.py file before line 297 yourself:
HTTP.Headers['Referer'] = 'some text'
or
HTTP.Headers['Referrer'] = 'some text'

so the whole PlayVideo function looks like this:

@indirect
@route(PREFIX + '/playvideo.m3u8')
def PlayVideo(url, c_user_agent = None):

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

    HTTP.Headers['Referrer'] = 'some text' # this is the new line
    return IndirectResponse(VideoClipObject, key = url)

If this works, I'll add support for the #EXTVLCOPT:http-referrer directive.

@ghost
Copy link
Author

ghost commented May 7, 2018

#EXTINF:-1 tvg-id="LA2 TDT SD 4.sp" tvg-name="LA 2" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/f/f3/Se15.png" group-title="TDT",LA 2
#EXTVLCOPT:http-referrer=http://player.livesports.pw/la2/
#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/59.0
http://xxedge63.livesports.pw/live/la2/chunklist.m3u8?md5=8yn90WMN-_iKb6wOluHTYA&expires=1525777298

say that the channel that the test post will not last long, that they change very often but that today works and that in this way, that the structure perfectly

@ghost
Copy link
Author

ghost commented May 7, 2018

I would say add something else because I did what I indicated and now it does not open or the plugin settings

Cigaras added a commit that referenced this issue May 23, 2018
Trying to add referer for issue #187
@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

I've made a new branch to test referer and referrer, I highly doubt that they will work, but either way, download the zip file, extract it, rename from IPTV.bundle-referer to IPTV.bundle, copy to Your plug-ins folder and use playlist You mentioned above.

@ghost
Copy link
Author

ghost commented May 23, 2018

I'm sorry to say that I would never work for a global list as much for a single channel as it puts the referrer of the channel that I previously indicated but each channel has a different referrer

     HTTP.Headers ['Referer'] = 'http://player.livesports.pw/la2/'
     HTTP.Headers ['Referrer'] = 'http://player.livesports.pw/la2/'

these referer are only valid for a channel and even then I do not know if it would work if you want I can try it but it seems to me to throw away the time as I told you, that alone would be valid for a channel

@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

I do not understand what are You saying.

If this works with single channel, I will update my plug-in so it takes referer from #EXTVLCOPT:http-referrer directive and then it will work with a whole list, but first I need to make sure it works with at least one channel.

@ghost
Copy link
Author

ghost commented May 23, 2018

what I say and forgive because I use xd translator is that each channel uses a different referrer and within the code it seems impossible for me to directly target the referrer instead of a tool that interprets it

@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

As I said, if it works with one channel, I will make a "tool that interprets it".

@ghost
Copy link
Author

ghost commented May 23, 2018

ok I try and I'll tell you soon

@ghost
Copy link
Author

ghost commented May 23, 2018

via desktop app windows if you work but from the web browser not yet to do the test and had to modify the referrer since they change almost daily I leave a channel recently captured and functional as you are now with the tests

#EXTINF:-1 tvg-id="LA2 TDT SD 4.sp" tvg-name="LA 2" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/f/f3/Se15.png" group-title="TDT",LA 2 vcl
#EXTVLCOPT:http-referrer=http://livesports.pw/embedna.php?file=la2&width=650&height=397
#EXTVLCOPT:http-user-agent=Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/59.0
http://xxedge63.livesports.pw/live/la2/chunklist.m3u8?md5=5B1Iv1jmCcu_eBTaoZKqDw&expires=1527142563

@ghost
Copy link
Author

ghost commented May 23, 2018

As you can see it is the same channel as the other time but it has changed its referrer

Cigaras added a commit that referenced this issue May 23, 2018
Trying to add HTTP referer for issue #187
@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

Committed a new version to test, please download zip and rename as instructed above.

Please keep in mind that I did not test it myself, so if it breaks please check the com.plexapp.plugins.iptv.log file.

@ghost
Copy link
Author

ghost commented May 23, 2018

does not work and in vlc if it works is edited with note pad ++

@ghost
Copy link
Author

ghost commented May 23, 2018

the first time with some text if it worked in local plex now no longer

log info

https://pastebin.com/zfR3B56R

@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

User Agent string in Your sample has invalid character "…", Plex can't handle it...

@ghost
Copy link
Author

ghost commented May 23, 2018

I had this error, I did not realize when it came to capturing the channel, it's working perfect, thank.
you so much for saying that in vcl that error does not prevent you from playing the channel

@Cigaras
Copy link
Owner

Cigaras commented May 23, 2018

Referer works?

@ghost
Copy link
Author

ghost commented May 23, 2018

yes yes it is perfect work and to say that works both locally and in the browser

@Cigaras Cigaras added the Fixed label May 23, 2018
@Cigaras Cigaras changed the title http-referrer HTTP referer May 23, 2018
@Cigaras Cigaras changed the title HTTP referer HTTP referer/referrer May 23, 2018
@Cigaras Cigaras mentioned this issue May 23, 2018
@ghost
Copy link
Author

ghost commented May 23, 2018

@leylayx
Copy link

leylayx commented May 24, 2018

This advance is great. I am very happy with the new version.

@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
Projects
None yet
Development

No branches or pull requests

2 participants