itzzzme / m3u8proxy

A HLS proxy server to handle CORS error
https://m3u8proxy-ivory.vercel.app
MIT License
2 stars 3 forks source link

Question #1

Closed Webx123 closed 4 days ago

Webx123 commented 6 days ago

is their a way to attach headers? like referrer and origin or maybe user-agent but mostly referrer. ?

itzzzme commented 6 days ago

are you talking to implement it in the live deployed website or you want to customize the code?

Webx123 commented 5 days ago

implemented would be easiest but if i could figure out how to change and deploy that would be cool to either way to be able to assign Referrer , orgin , user agent becaue some m3u8s require it to play

itzzzme commented 5 days ago

if you want to add extra header just append headers on the m3u8 link by encoding it for example if you want to proxy a m3u8 file

e.g: https://example.com/master.m3u8

and you want to append header

then append like this

https://example.com/master.m3u8%26headers%3D%7B%22referer%22%3A%22https%3A%2F%2Fexample.com%22%7D

don't add headers without encoding it otherwise it may cause not playing the video

https://example.com/master.m3u8&headers={"referer":"https://example.com"} //this is not a right method to get it work

and if you want to implement on your own you can modify the html file and add an input tag to take the headers input and then encode the value in input tag using encodeURIComponent(JSON.stringify(intputvalue))

You are good to go

Webx123 commented 5 days ago

so it would be https://example.com/master.m3u8&headers={"referer":"https://example.com","origin":"https://example-origin.com","user-agent":"YourUserAgent"} and usable would be https://example.com/master.m3u8&headers=%7B%22referer%22%3A%22https%3A%2F%2Fexample.com%22%2C%22origin%22%3A%22https%3A%2F%2Fexample-origin.com%22%2C%22user-agent%22%3A%22YourUserAgent%22%7D

itzzzme commented 5 days ago

usable would be

https://example.com/master.m3u8%26headers%3D%7B%22referer%22%3A%22https%3A%2F%2Fexample.com%22%2C%22origin%22%3A%22https%3A%2F%2Fexample-origin.com%22%2C%22user-agent%22%3A%22YourUserAgent%22%7D

& and = has to be equally encoded as well

you don't have to think about that just pass the whole thing to

encodeURIComponent(JSON.stringify(intputvalue))

it will handle the input value itself you will not have to worry

Webx123 commented 5 days ago

Thats awesome works Flawlessly! thanks! i tried to make my own on vercel.app but it https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/m3u8-proxy?url= dont work?

i think its because its outputting http://0.0.0.0:8080/ts-proxy?url=https%3A%2F%2Fft-hetzner.3045x.com%2F9f41r40060icglir%2F82510038_82512038.js&headers=%7B%7D for some reason rather then https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/ts-proxy

itzzzme commented 4 days ago

Thats awesome works Flawlessly! thanks! i tried to make my own on vercel.app but it https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/m3u8-proxy?url= dont work?

i think its because its outputting http://0.0.0.0:8080/ts-proxy?url=https%3A%2F%2Fft-hetzner.3045x.com%2F9f41r40060icglir%2F82510038_82512038.js&headers=%7B%7D for some reason rather then https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/ts-proxy

Since it can't handle that IP for obvious reasons it will not be able to play

Webx123 commented 4 days ago

Thats awesome works Flawlessly! thanks! i tried to make my own on vercel.app but it https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/m3u8-proxy?url= dont work? i think its because its outputting http://0.0.0.0:8080/ts-proxy?url=https%3A%2F%2Fft-hetzner.3045x.com%2F9f41r40060icglir%2F82510038_82512038.js&headers=%7B%7D for some reason rather then https://m3u8proxy-8kwt7m8z3-webx123s-projects.vercel.app/ts-proxy

Since it can't handle that IP for obvious reasons it will not be able to play

yeah i know it cant handle local host 0.0.0 of course but how would i change it to use the Vercel url..

itzzzme commented 4 days ago

you have to add environment variable in vercel

Screenshot 2024-11-02 115433-mh

image-mh

Webx123 commented 3 days ago

Im new to this and totally confused what do i put in there? and where do i get the Client_key ect to add to it

itzzzme commented 2 days ago

Im new to this and totally confused what do i put in there? and where do i get the Client_key ect to add to it

Go to settings and then add environment variables. There is nothing called client_key which you have to add. env is already in my repo just add those as it is and put the website name as per your website name

Webx123 commented 4 hours ago

i dont see env in the files?

Webx123 commented 3 hours ago

i added HOST="localhost" PORT="3030" PUBLIC_URL="https://m3u8proxy-one.vercel.app" (my url) but still the output m3u shows 0.00.00? https://imgur.com/ojzJGoc.png see