Coder Social home page Coder Social logo

hase0278 / m3u8_proxy-cors Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shashstormer/m3u8_proxy-cors

0.0 0.0 0.0 38 KB

proxy for m3u8 files

Home Page: https://m3u8-proxy-cors.vercel.app

License: GNU General Public License v3.0

Python 100.00%

m3u8_proxy-cors's Introduction

m3u8_proxy-cors

This is a simple Python proxy server that adds CORS headers to M3U8 playlist files. It allows you to bypass CORS restrictions when playing M3U8 playlists in browsers.

Installation

To install and run the server, follow these steps:

  1. Clone the repository:
git clone https://github.com/masterz5398/m3u8_proxy-cors.git
  1. Install dependencies:
cd m3u8_proxy-cors
pip install -r requirements.txt
  1. Start the server:
python main.py

The server will start listening on port 5010 by default. You can change the port by setting the port variable in main.py

Usage

To use the server, simply replace the URL of the M3U8 playlist file in your application with the URL of the proxy server. For example, if your original URL was https://example.com/video.m3u8, you would replace it with http://localhost:5010/cors?url=https://example.com/video.m3u8.

For m3u8s ending with #.mp4 you should add origin=aninin in query like http://localhost:5010/cors?url=https://example.com/video.m3u8&origin=aninin

To set custom headers for a request you can do http://localhost:8000/cors?url=https://example.com/video.m3u8&headers={"User-Agent":"Mozilla/5.0 ...","referer":"https://example.com",...}

don't put spaces between the headers(you can put it inside the quotes) you might get a 500 error,

do not encode the url or headers as we do not have a decoder for it

Deploying to Vercel

You can quickly deploy this project to Vercel with the following button:

Deploy with Vercel

contributions are welcome you can make a pull request I will review it and merge it if it benifits the program

m3u8_proxy-cors's People

Contributors

shashstormer avatar lirena00 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.