├── .gitattributes ├── .gitignore ├── .htaccess ├── Dockerfile ├── README.md ├── captures ├── screenshot1.png ├── screenshot2.png └── screenshot3.png ├── catalogs.php ├── composer.json ├── composer.lock ├── config.php ├── configs ├── app.conf ├── httpd.conf └── php.ini ├── entrypoint.sh ├── helpers.php ├── manifest.php ├── metas.php ├── mxplayer.php ├── now.json ├── sonyliv.php ├── streams.php └── zee5.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tests.php 2 | /temp/ 3 | /vendor/ -------------------------------------------------------------------------------- /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | 3 | RewriteBase /personal/stremio-indian-livetv 4 | 5 | RewriteRule ^manifest.json manifest.php 6 | 7 | RewriteRule ^catalog/(.*)/(.*)/(.*).json catalogs.php?type=$1&id=$2&extra=$3 [B] 8 | RewriteRule ^meta/(.*)/(.*)/(.*).json metas.php?type=$1&id=$2&extra=$3 [B] 9 | RewriteRule ^stream/(.*)/(.*)/(.*).json streams.php?type=$1&id=$2&extra=$3 [B] 10 | 11 | RewriteRule ^catalog/(.*)/(.*).json catalogs.php?type=$1&id=$2 12 | RewriteRule ^stream/(.*)/(.*).json streams.php?type=$1&id=$2 13 | RewriteRule ^meta/(.*)/(.*).json metas.php?type=$1&id=$2 14 | 15 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | COPY ./ /var/www/html/ 4 | COPY entrypoint.sh /opt/entrypoint.sh 5 | 6 | RUN apk --update add \ 7 | curl php-apache2 php-cli php-json php-mbstring php-phar php-openssl && \ 8 | rm -f /var/cache/apk/* && \ 9 | chmod +x /opt/entrypoint.sh && \ 10 | curl -sS https://getcomposer.org/installer | php -- \ 11 | --install-dir=/usr/local/bin --filename=composer && \ 12 | composer install --working-dir=/var/www/html && \ 13 | mkdir -p /var/www/html/ && chown -R apache:apache /var/www/html 14 | 15 | COPY configs/httpd.conf /etc/apache2/httpd.conf 16 | COPY configs/app.conf /etc/apache2/sites/ 17 | COPY configs/php.ini /etc/php7/php.ini 18 | 19 | EXPOSE 80 20 | 21 | WORKDIR /var/www/html/ 22 | ENTRYPOINT [ "/opt/entrypoint.sh" ] 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stremio-indian-livetv 2 | 3 | 4 | This is a [Stremio](https://www.stremio.com/) add-on for Indian Live TV channels from zee5,sony and mixed channels from mxplayer site. Contains More than 250+ channels combined from all three catalogs. 5 | 6 | It is a php and apache app and can be run on major free hosting service. 7 | 8 | Demo : https://stremio-indian-livetv-eta.now.sh/manifest.json 9 | 10 | ## Features 11 | 12 | - Includes custom Configuration for most of the things. 13 | - Includes Home Feed of beeg.com on discover tab of stremio and various other tags of beeg which can be configured before deploying. 14 | - Supports Docker Installation. 15 | - Caching the requests in file cache. 16 | - Since its php and apache app can be deployed on any free hosting with cloudflare to support free ssl. 17 | - Custom cache time for feed and meta content. 18 | - Includes now.json for deploying on zeit.co 19 | 20 | ## Deploying with Docker (preferred for localhost) 21 | 22 | To Run on Docker Container 23 | 24 | ```bash 25 | git clone https://github.com/maaAnandsheela/stremio-indian-livetv 26 | cd stremio-indian-livetv 27 | docker build -t stremio-indian-livetv . 28 | docker run --name indlivtv -d -p 80:80 stremio-indian-livetv 29 | ``` 30 | 31 | To Stop the container 32 | 33 | ```bash 34 | docker stop indlivtv 35 | ``` 36 | 37 | ## Deploying on zeit.co 38 | 39 | Preffered zeit.co because it provides india region for hosting. The addon has to be hosted on India region. 40 | 41 | - Already Includes now.json to deploy on zeit.co 42 | - Make sure cache status is false before deploying on Zei. Default is false. 43 | 44 | 45 | ## Configuration 46 | 47 | - Includes a config.php to config the default variables before setup. 48 | - `cache_status` to define cacahe status. 49 | - `cache_path` to define file cache path. 50 | - `cache_catalog_ttl` expire time for catalog feeds cache and also valid for genres. 51 | - `catalog_catalog_ttl` expire time for meta of cahe streams. 52 | - And other basic manifest variables can also be configured from config.php 53 | 54 | ## Known Issues 55 | 56 | - zee5 streams not working on desktop stremio. ALready contacted stremio about that. 57 | 58 | 59 | ## Screenshots 60 | 61 | ![Screenshot](/captures/screenshot1.png) 62 | 63 | ![Screenshot](/captures/screenshot2.png) 64 | 65 | ![Screenshot](/captures/screenshot3.png) 66 | -------------------------------------------------------------------------------- /captures/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maaAnandsheela/stremio-indian-livetv/d70ae9646a08e30cc7b3551f5a66a8478079e78e/captures/screenshot1.png -------------------------------------------------------------------------------- /captures/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maaAnandsheela/stremio-indian-livetv/d70ae9646a08e30cc7b3551f5a66a8478079e78e/captures/screenshot2.png -------------------------------------------------------------------------------- /captures/screenshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maaAnandsheela/stremio-indian-livetv/d70ae9646a08e30cc7b3551f5a66a8478079e78e/captures/screenshot3.png -------------------------------------------------------------------------------- /catalogs.php: -------------------------------------------------------------------------------- 1 | id); 12 | $cache = cache_check("{$get_id['0']}-{$get_id['1']}"); 13 | if ($cache['status']) { 14 | echo $cache['data']; 15 | } 16 | else { 17 | if ($get_id['0'] == "zee5") { 18 | $data = json_encode(zee5_get_feed()); 19 | echo $data; 20 | } 21 | elseif ($get_id['0'] == "mx") { 22 | $data = json_encode(mxplayer_get_feed()); 23 | echo $data; 24 | } 25 | else { 26 | $data = json_encode(liv_get_feed()); 27 | echo $data; 28 | } 29 | } 30 | ?> -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "maaAnandsheela/stremio-indian-livetv", 3 | "description": "Indian Live Tv channels from various sources. Some of them works only on Indian IP.", 4 | "type": "project", 5 | "require": { 6 | "guzzlehttp/guzzle": "^6.5", 7 | "phpfastcache/phpfastcache": "^7.1" 8 | }, 9 | "authors": [ 10 | { 11 | "name": "maaAnandsheela", 12 | "email": "maaanandsheela@protonmail.com" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "4c38f6dfa9edcfe38f061a29a196b05c", 8 | "packages": [ 9 | { 10 | "name": "guzzlehttp/guzzle", 11 | "version": "6.5.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/guzzle/guzzle.git", 15 | "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", 20 | "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "ext-json": "*", 25 | "guzzlehttp/promises": "^1.0", 26 | "guzzlehttp/psr7": "^1.6.1", 27 | "php": ">=5.5" 28 | }, 29 | "require-dev": { 30 | "ext-curl": "*", 31 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 32 | "psr/log": "^1.1" 33 | }, 34 | "suggest": { 35 | "ext-intl": "Required for Internationalized Domain Name (IDN) support", 36 | "psr/log": "Required for using the Log middleware" 37 | }, 38 | "type": "library", 39 | "extra": { 40 | "branch-alias": { 41 | "dev-master": "6.5-dev" 42 | } 43 | }, 44 | "autoload": { 45 | "psr-4": { 46 | "GuzzleHttp\\": "src/" 47 | }, 48 | "files": [ 49 | "src/functions_include.php" 50 | ] 51 | }, 52 | "notification-url": "https://packagist.org/downloads/", 53 | "license": [ 54 | "MIT" 55 | ], 56 | "authors": [ 57 | { 58 | "name": "Michael Dowling", 59 | "email": "mtdowling@gmail.com", 60 | "homepage": "https://github.com/mtdowling" 61 | } 62 | ], 63 | "description": "Guzzle is a PHP HTTP client library", 64 | "homepage": "http://guzzlephp.org/", 65 | "keywords": [ 66 | "client", 67 | "curl", 68 | "framework", 69 | "http", 70 | "http client", 71 | "rest", 72 | "web service" 73 | ], 74 | "time": "2019-12-23T11:57:10+00:00" 75 | }, 76 | { 77 | "name": "guzzlehttp/promises", 78 | "version": "v1.3.1", 79 | "source": { 80 | "type": "git", 81 | "url": "https://github.com/guzzle/promises.git", 82 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" 83 | }, 84 | "dist": { 85 | "type": "zip", 86 | "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", 87 | "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", 88 | "shasum": "" 89 | }, 90 | "require": { 91 | "php": ">=5.5.0" 92 | }, 93 | "require-dev": { 94 | "phpunit/phpunit": "^4.0" 95 | }, 96 | "type": "library", 97 | "extra": { 98 | "branch-alias": { 99 | "dev-master": "1.4-dev" 100 | } 101 | }, 102 | "autoload": { 103 | "psr-4": { 104 | "GuzzleHttp\\Promise\\": "src/" 105 | }, 106 | "files": [ 107 | "src/functions_include.php" 108 | ] 109 | }, 110 | "notification-url": "https://packagist.org/downloads/", 111 | "license": [ 112 | "MIT" 113 | ], 114 | "authors": [ 115 | { 116 | "name": "Michael Dowling", 117 | "email": "mtdowling@gmail.com", 118 | "homepage": "https://github.com/mtdowling" 119 | } 120 | ], 121 | "description": "Guzzle promises library", 122 | "keywords": [ 123 | "promise" 124 | ], 125 | "time": "2016-12-20T10:07:11+00:00" 126 | }, 127 | { 128 | "name": "guzzlehttp/psr7", 129 | "version": "1.6.1", 130 | "source": { 131 | "type": "git", 132 | "url": "https://github.com/guzzle/psr7.git", 133 | "reference": "239400de7a173fe9901b9ac7c06497751f00727a" 134 | }, 135 | "dist": { 136 | "type": "zip", 137 | "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", 138 | "reference": "239400de7a173fe9901b9ac7c06497751f00727a", 139 | "shasum": "" 140 | }, 141 | "require": { 142 | "php": ">=5.4.0", 143 | "psr/http-message": "~1.0", 144 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 145 | }, 146 | "provide": { 147 | "psr/http-message-implementation": "1.0" 148 | }, 149 | "require-dev": { 150 | "ext-zlib": "*", 151 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" 152 | }, 153 | "suggest": { 154 | "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 155 | }, 156 | "type": "library", 157 | "extra": { 158 | "branch-alias": { 159 | "dev-master": "1.6-dev" 160 | } 161 | }, 162 | "autoload": { 163 | "psr-4": { 164 | "GuzzleHttp\\Psr7\\": "src/" 165 | }, 166 | "files": [ 167 | "src/functions_include.php" 168 | ] 169 | }, 170 | "notification-url": "https://packagist.org/downloads/", 171 | "license": [ 172 | "MIT" 173 | ], 174 | "authors": [ 175 | { 176 | "name": "Michael Dowling", 177 | "email": "mtdowling@gmail.com", 178 | "homepage": "https://github.com/mtdowling" 179 | }, 180 | { 181 | "name": "Tobias Schultze", 182 | "homepage": "https://github.com/Tobion" 183 | } 184 | ], 185 | "description": "PSR-7 message implementation that also provides common utility methods", 186 | "keywords": [ 187 | "http", 188 | "message", 189 | "psr-7", 190 | "request", 191 | "response", 192 | "stream", 193 | "uri", 194 | "url" 195 | ], 196 | "time": "2019-07-01T23:21:34+00:00" 197 | }, 198 | { 199 | "name": "phpfastcache/phpfastcache", 200 | "version": "7.1.0", 201 | "source": { 202 | "type": "git", 203 | "url": "https://github.com/PHPSocialNetwork/phpfastcache.git", 204 | "reference": "11c7b17a824925c2b99dce10df15ba67cbef132a" 205 | }, 206 | "dist": { 207 | "type": "zip", 208 | "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/11c7b17a824925c2b99dce10df15ba67cbef132a", 209 | "reference": "11c7b17a824925c2b99dce10df15ba67cbef132a", 210 | "shasum": "" 211 | }, 212 | "require": { 213 | "ext-json": "*", 214 | "ext-mbstring": "*", 215 | "php": ">=7.0", 216 | "psr/cache": "~1.0.0", 217 | "psr/simple-cache": "~1.0.0" 218 | }, 219 | "conflict": { 220 | "basho/riak": "*", 221 | "doctrine/couchdb": "*" 222 | }, 223 | "suggest": { 224 | "ext-apc": "*", 225 | "ext-couchbase": "*", 226 | "ext-intl": "*", 227 | "ext-leveldb": "*", 228 | "ext-memcache": "*", 229 | "ext-memcached": "*", 230 | "ext-redis": "*", 231 | "ext-sqlite": "*", 232 | "ext-wincache": "*", 233 | "ext-xcache": "*", 234 | "mongodb/mongodb": "^1.1", 235 | "phpfastcache/couchdb": "~1.0.0", 236 | "phpfastcache/phpssdb": "~1.0.0", 237 | "phpfastcache/riak-client": "~1.4.4", 238 | "predis/predis": "~1.1.0" 239 | }, 240 | "type": "library", 241 | "autoload": { 242 | "psr-4": { 243 | "Phpfastcache\\": "lib/Phpfastcache/" 244 | } 245 | }, 246 | "notification-url": "https://packagist.org/downloads/", 247 | "license": [ 248 | "MIT" 249 | ], 250 | "authors": [ 251 | { 252 | "name": "Georges.L", 253 | "email": "contact@geolim4.com", 254 | "homepage": "https://github.com/Geolim4", 255 | "role": "Actual Project Manager/Developer" 256 | }, 257 | { 258 | "name": "Khoa Bui", 259 | "email": "khoaofgod@gmail.com", 260 | "homepage": "https://www.phpfastcache.com", 261 | "role": "Former Project Developer/Original Creator" 262 | } 263 | ], 264 | "description": "PHP Abstract Cache Class - Reduce your database call using cache system. PhpFastCache handles a lot of drivers such as Apc(u), Cassandra, CouchBase, Couchdb, Mongodb, Files, (P)redis, Leveldb, Memcache(d), Ssdb, Sqlite, Wincache, Xcache, Zend Data Cache.", 265 | "homepage": "https://www.phpfastcache.com", 266 | "keywords": [ 267 | "LevelDb", 268 | "abstract", 269 | "apc", 270 | "apcu", 271 | "cache", 272 | "cache class", 273 | "caching", 274 | "cassandra", 275 | "cookie", 276 | "couchbase", 277 | "couchdb", 278 | "files cache", 279 | "memcache", 280 | "memcached", 281 | "mongodb", 282 | "mysql cache", 283 | "pdo cache", 284 | "php cache", 285 | "predis", 286 | "redis", 287 | "ssdb", 288 | "wincache", 289 | "xcache", 290 | "zend", 291 | "zend data cache", 292 | "zend disk cache", 293 | "zend memory cache", 294 | "zend server" 295 | ], 296 | "time": "2019-09-15T15:11:18+00:00" 297 | }, 298 | { 299 | "name": "psr/cache", 300 | "version": "1.0.1", 301 | "source": { 302 | "type": "git", 303 | "url": "https://github.com/php-fig/cache.git", 304 | "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" 305 | }, 306 | "dist": { 307 | "type": "zip", 308 | "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", 309 | "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", 310 | "shasum": "" 311 | }, 312 | "require": { 313 | "php": ">=5.3.0" 314 | }, 315 | "type": "library", 316 | "extra": { 317 | "branch-alias": { 318 | "dev-master": "1.0.x-dev" 319 | } 320 | }, 321 | "autoload": { 322 | "psr-4": { 323 | "Psr\\Cache\\": "src/" 324 | } 325 | }, 326 | "notification-url": "https://packagist.org/downloads/", 327 | "license": [ 328 | "MIT" 329 | ], 330 | "authors": [ 331 | { 332 | "name": "PHP-FIG", 333 | "homepage": "http://www.php-fig.org/" 334 | } 335 | ], 336 | "description": "Common interface for caching libraries", 337 | "keywords": [ 338 | "cache", 339 | "psr", 340 | "psr-6" 341 | ], 342 | "time": "2016-08-06T20:24:11+00:00" 343 | }, 344 | { 345 | "name": "psr/http-message", 346 | "version": "1.0.1", 347 | "source": { 348 | "type": "git", 349 | "url": "https://github.com/php-fig/http-message.git", 350 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" 351 | }, 352 | "dist": { 353 | "type": "zip", 354 | "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", 355 | "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", 356 | "shasum": "" 357 | }, 358 | "require": { 359 | "php": ">=5.3.0" 360 | }, 361 | "type": "library", 362 | "extra": { 363 | "branch-alias": { 364 | "dev-master": "1.0.x-dev" 365 | } 366 | }, 367 | "autoload": { 368 | "psr-4": { 369 | "Psr\\Http\\Message\\": "src/" 370 | } 371 | }, 372 | "notification-url": "https://packagist.org/downloads/", 373 | "license": [ 374 | "MIT" 375 | ], 376 | "authors": [ 377 | { 378 | "name": "PHP-FIG", 379 | "homepage": "http://www.php-fig.org/" 380 | } 381 | ], 382 | "description": "Common interface for HTTP messages", 383 | "homepage": "https://github.com/php-fig/http-message", 384 | "keywords": [ 385 | "http", 386 | "http-message", 387 | "psr", 388 | "psr-7", 389 | "request", 390 | "response" 391 | ], 392 | "time": "2016-08-06T14:39:51+00:00" 393 | }, 394 | { 395 | "name": "psr/simple-cache", 396 | "version": "1.0.1", 397 | "source": { 398 | "type": "git", 399 | "url": "https://github.com/php-fig/simple-cache.git", 400 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 401 | }, 402 | "dist": { 403 | "type": "zip", 404 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 405 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 406 | "shasum": "" 407 | }, 408 | "require": { 409 | "php": ">=5.3.0" 410 | }, 411 | "type": "library", 412 | "extra": { 413 | "branch-alias": { 414 | "dev-master": "1.0.x-dev" 415 | } 416 | }, 417 | "autoload": { 418 | "psr-4": { 419 | "Psr\\SimpleCache\\": "src/" 420 | } 421 | }, 422 | "notification-url": "https://packagist.org/downloads/", 423 | "license": [ 424 | "MIT" 425 | ], 426 | "authors": [ 427 | { 428 | "name": "PHP-FIG", 429 | "homepage": "http://www.php-fig.org/" 430 | } 431 | ], 432 | "description": "Common interfaces for simple caching", 433 | "keywords": [ 434 | "cache", 435 | "caching", 436 | "psr", 437 | "psr-16", 438 | "simple-cache" 439 | ], 440 | "time": "2017-10-23T01:57:42+00:00" 441 | }, 442 | { 443 | "name": "ralouphie/getallheaders", 444 | "version": "3.0.3", 445 | "source": { 446 | "type": "git", 447 | "url": "https://github.com/ralouphie/getallheaders.git", 448 | "reference": "120b605dfeb996808c31b6477290a714d356e822" 449 | }, 450 | "dist": { 451 | "type": "zip", 452 | "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", 453 | "reference": "120b605dfeb996808c31b6477290a714d356e822", 454 | "shasum": "" 455 | }, 456 | "require": { 457 | "php": ">=5.6" 458 | }, 459 | "require-dev": { 460 | "php-coveralls/php-coveralls": "^2.1", 461 | "phpunit/phpunit": "^5 || ^6.5" 462 | }, 463 | "type": "library", 464 | "autoload": { 465 | "files": [ 466 | "src/getallheaders.php" 467 | ] 468 | }, 469 | "notification-url": "https://packagist.org/downloads/", 470 | "license": [ 471 | "MIT" 472 | ], 473 | "authors": [ 474 | { 475 | "name": "Ralph Khattar", 476 | "email": "ralph.khattar@gmail.com" 477 | } 478 | ], 479 | "description": "A polyfill for getallheaders.", 480 | "time": "2019-03-08T08:55:37+00:00" 481 | } 482 | ], 483 | "packages-dev": [], 484 | "aliases": [], 485 | "minimum-stability": "stable", 486 | "stability-flags": [], 487 | "prefer-stable": false, 488 | "prefer-lowest": false, 489 | "platform": [], 490 | "platform-dev": [] 491 | } 492 | -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin admin@localhost 3 | # ServerName localhost 4 | #ServerAlias www.app 5 | DocumentRoot /var/www/html 6 | 7 | 8 | Options FollowSymLinks 9 | AllowOverride None 10 | AddDefaultCharset utf-8 11 | DirectoryIndex index.php 12 | Require all granted 13 | 14 | RewriteEngine On 15 | RewriteBase / 16 | 17 | RewriteRule ^manifest.json manifest.php 18 | 19 | RewriteRule ^catalog/(.*)/(.*)/(.*).json catalogs.php?type=$1&id=$2&extra=$3 [B] 20 | RewriteRule ^meta/(.*)/(.*)/(.*).json metas.php?type=$1&id=$2&extra=$3 [B] 21 | RewriteRule ^stream/(.*)/(.*)/(.*).json streams.php?type=$1&id=$2&extra=$3 [B] 22 | 23 | RewriteRule ^catalog/(.*)/(.*).json catalogs.php?type=$1&id=$2 24 | RewriteRule ^stream/(.*)/(.*).json streams.php?type=$1&id=$2 25 | RewriteRule ^meta/(.*)/(.*).json metas.php?type=$1&id=$2 26 | 27 | 28 | CustomLog /dev/stdout combined 29 | ErrorLog /dev/stderr 30 | LogLevel debug 31 | 32 | -------------------------------------------------------------------------------- /configs/httpd.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This is the main Apache HTTP server configuration file. It contains the 3 | # configuration directives that give the server its instructions. 4 | # See for detailed information. 5 | # In particular, see 6 | # 7 | # for a discussion of each configuration directive. 8 | # 9 | # Do NOT simply read the instructions in here without understanding 10 | # what they do. They're here only as hints or reminders. If you are unsure 11 | # consult the online docs. You have been warned. 12 | # 13 | # Configuration and logfile names: If the filenames you specify for many 14 | # of the server's control files begin with "/" (or "drive:/" for Win32), the 15 | # server will use that explicit path. If the filenames do *not* begin 16 | # with "/", the value of ServerRoot is prepended -- so "logs/access_log" 17 | # with ServerRoot set to "/usr/local/apache2" will be interpreted by the 18 | # server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log" 19 | # will be interpreted as '/logs/access_log'. 20 | 21 | # 22 | # ServerTokens 23 | # This directive configures what you return as the Server HTTP response 24 | # Header. The default is 'Full' which sends information about the OS-Type 25 | # and compiled in modules. 26 | # Set to one of: Full | OS | Minor | Minimal | Major | Prod 27 | # where Full conveys the most information, and Prod the least. 28 | # 29 | ServerTokens OS 30 | 31 | # 32 | # ServerRoot: The top of the directory tree under which the server's 33 | # configuration, error, and log files are kept. 34 | # 35 | # Do not add a slash at the end of the directory path. If you point 36 | # ServerRoot at a non-local disk, be sure to specify a local disk on the 37 | # Mutex directive, if file-based mutexes are used. If you wish to share the 38 | # same ServerRoot for multiple httpd daemons, you will need to change at 39 | # least PidFile. 40 | # 41 | ServerRoot /var/www 42 | 43 | # 44 | # Mutex: Allows you to set the mutex mechanism and mutex file directory 45 | # for individual mutexes, or change the global defaults 46 | # 47 | # Uncomment and change the directory if mutexes are file-based and the default 48 | # mutex file directory is not on a local disk or is not appropriate for some 49 | # other reason. 50 | # 51 | # Mutex default:/run/apache2 52 | 53 | # 54 | # Listen: Allows you to bind Apache to specific IP addresses and/or 55 | # ports, instead of the default. See also the 56 | # directive. 57 | # 58 | # Change this to Listen on specific IP addresses as shown below to 59 | # prevent Apache from glomming onto all bound IP addresses. 60 | # 61 | #Listen 12.34.56.78:80 62 | Listen 80 63 | 64 | # 65 | # Dynamic Shared Object (DSO) Support 66 | # 67 | # To be able to use the functionality of a module which was built as a DSO you 68 | # have to place corresponding `LoadModule' lines at this location so the 69 | # directives contained in it are actually available _before_ they are used. 70 | # Statically compiled modules (those listed by `httpd -l') do not need 71 | # to be loaded here. 72 | # 73 | # Example: 74 | # LoadModule foo_module modules/mod_foo.so 75 | # 76 | #LoadModule mpm_event_module modules/mod_mpm_event.so 77 | LoadModule mpm_prefork_module modules/mod_mpm_prefork.so 78 | #LoadModule mpm_worker_module modules/mod_mpm_worker.so 79 | LoadModule authn_file_module modules/mod_authn_file.so 80 | #LoadModule authn_dbm_module modules/mod_authn_dbm.so 81 | #LoadModule authn_anon_module modules/mod_authn_anon.so 82 | #LoadModule authn_dbd_module modules/mod_authn_dbd.so 83 | #LoadModule authn_socache_module modules/mod_authn_socache.so 84 | LoadModule authn_core_module modules/mod_authn_core.so 85 | LoadModule authz_host_module modules/mod_authz_host.so 86 | LoadModule authz_groupfile_module modules/mod_authz_groupfile.so 87 | LoadModule authz_user_module modules/mod_authz_user.so 88 | #LoadModule authz_dbm_module modules/mod_authz_dbm.so 89 | #LoadModule authz_owner_module modules/mod_authz_owner.so 90 | #LoadModule authz_dbd_module modules/mod_authz_dbd.so 91 | LoadModule authz_core_module modules/mod_authz_core.so 92 | LoadModule access_compat_module modules/mod_access_compat.so 93 | LoadModule auth_basic_module modules/mod_auth_basic.so 94 | #LoadModule auth_form_module modules/mod_auth_form.so 95 | #LoadModule auth_digest_module modules/mod_auth_digest.so 96 | #LoadModule allowmethods_module modules/mod_allowmethods.so 97 | #LoadModule file_cache_module modules/mod_file_cache.so 98 | #LoadModule cache_module modules/mod_cache.so 99 | #LoadModule cache_disk_module modules/mod_cache_disk.so 100 | #LoadModule cache_socache_module modules/mod_cache_socache.so 101 | #LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 102 | #LoadModule socache_dbm_module modules/mod_socache_dbm.so 103 | #LoadModule socache_memcache_module modules/mod_socache_memcache.so 104 | #LoadModule watchdog_module modules/mod_watchdog.so 105 | #LoadModule macro_module modules/mod_macro.so 106 | #LoadModule dbd_module modules/mod_dbd.so 107 | #LoadModule dumpio_module modules/mod_dumpio.so 108 | #LoadModule echo_module modules/mod_echo.so 109 | #LoadModule buffer_module modules/mod_buffer.so 110 | #LoadModule data_module modules/mod_data.so 111 | #LoadModule ratelimit_module modules/mod_ratelimit.so 112 | LoadModule reqtimeout_module modules/mod_reqtimeout.so 113 | #LoadModule ext_filter_module modules/mod_ext_filter.so 114 | #LoadModule request_module modules/mod_request.so 115 | #LoadModule include_module modules/mod_include.so 116 | LoadModule filter_module modules/mod_filter.so 117 | #LoadModule reflector_module modules/mod_reflector.so 118 | #LoadModule substitute_module modules/mod_substitute.so 119 | #LoadModule sed_module modules/mod_sed.so 120 | #LoadModule charset_lite_module modules/mod_charset_lite.so 121 | #LoadModule deflate_module modules/mod_deflate.so 122 | LoadModule mime_module modules/mod_mime.so 123 | LoadModule log_config_module modules/mod_log_config.so 124 | #LoadModule log_debug_module modules/mod_log_debug.so 125 | #LoadModule log_forensic_module modules/mod_log_forensic.so 126 | #LoadModule logio_module modules/mod_logio.so 127 | LoadModule env_module modules/mod_env.so 128 | #LoadModule mime_magic_module modules/mod_mime_magic.so 129 | #LoadModule expires_module modules/mod_expires.so 130 | LoadModule headers_module modules/mod_headers.so 131 | #LoadModule usertrack_module modules/mod_usertrack.so 132 | #LoadModule unique_id_module modules/mod_unique_id.so 133 | LoadModule setenvif_module modules/mod_setenvif.so 134 | LoadModule version_module modules/mod_version.so 135 | #LoadModule remoteip_module modules/mod_remoteip.so 136 | #LoadModule session_module modules/mod_session.so 137 | #LoadModule session_cookie_module modules/mod_session_cookie.so 138 | #LoadModule session_crypto_module modules/mod_session_crypto.so 139 | #LoadModule session_dbd_module modules/mod_session_dbd.so 140 | #LoadModule slotmem_shm_module modules/mod_slotmem_shm.so 141 | #LoadModule slotmem_plain_module modules/mod_slotmem_plain.so 142 | #LoadModule dialup_module modules/mod_dialup.so 143 | #LoadModule http2_module modules/mod_http2.so 144 | LoadModule unixd_module modules/mod_unixd.so 145 | #LoadModule heartbeat_module modules/mod_heartbeat.so 146 | #LoadModule heartmonitor_module modules/mod_heartmonitor.so 147 | LoadModule status_module modules/mod_status.so 148 | LoadModule autoindex_module modules/mod_autoindex.so 149 | #LoadModule asis_module modules/mod_asis.so 150 | #LoadModule info_module modules/mod_info.so 151 | #LoadModule suexec_module modules/mod_suexec.so 152 | 153 | #LoadModule cgid_module modules/mod_cgid.so 154 | 155 | 156 | #LoadModule cgi_module modules/mod_cgi.so 157 | 158 | #LoadModule vhost_alias_module modules/mod_vhost_alias.so 159 | #LoadModule negotiation_module modules/mod_negotiation.so 160 | LoadModule dir_module modules/mod_dir.so 161 | #LoadModule actions_module modules/mod_actions.so 162 | #LoadModule speling_module modules/mod_speling.so 163 | #LoadModule userdir_module modules/mod_userdir.so 164 | LoadModule alias_module modules/mod_alias.so 165 | LoadModule rewrite_module modules/mod_rewrite.so 166 | 167 | LoadModule negotiation_module modules/mod_negotiation.so 168 | 169 | 170 | # 171 | # If you wish httpd to run as a different user or group, you must run 172 | # httpd as root initially and it will switch. 173 | # 174 | # User/Group: The name (or #number) of the user/group to run httpd as. 175 | # It is usually good practice to create a dedicated user and group for 176 | # running httpd, as with most system services. 177 | # 178 | User apache 179 | Group apache 180 | 181 | 182 | 183 | # 'Main' server configuration 184 | # 185 | # The directives in this section set up the values used by the 'main' 186 | # server, which responds to any requests that aren't handled by a 187 | # definition. These values also provide defaults for 188 | # any containers you may define later in the file. 189 | # 190 | # All of these directives may appear inside containers, 191 | # in which case these default settings will be overridden for the 192 | # virtual host being defined. 193 | # 194 | 195 | # 196 | # ServerAdmin: Your address, where problems with the server should be 197 | # e-mailed. This address appears on some server-generated pages, such 198 | # as error documents. e.g. admin@your-domain.com 199 | # 200 | ServerAdmin you@example.com 201 | 202 | # 203 | # Optionally add a line containing the server version and virtual host 204 | # name to server-generated pages (internal error documents, FTP directory 205 | # listings, mod_status and mod_info output etc., but not CGI generated 206 | # documents or custom error documents). 207 | # Set to "EMail" to also include a mailto: link to the ServerAdmin. 208 | # Set to one of: On | Off | EMail 209 | # 210 | ServerSignature On 211 | 212 | # 213 | # ServerName gives the name and port that the server uses to identify itself. 214 | # This can often be determined automatically, but we recommend you specify 215 | # it explicitly to prevent problems during startup. 216 | # 217 | # If your host doesn't have a registered DNS name, enter its IP address here. 218 | # 219 | #ServerName www.example.com:80 220 | 221 | # 222 | # Deny access to the entirety of your server's filesystem. You must 223 | # explicitly permit access to web content directories in other 224 | # blocks below. 225 | # 226 | 227 | AllowOverride none 228 | Require all denied 229 | 230 | 231 | # 232 | # Note that from this point forward you must specifically allow 233 | # particular features to be enabled - so if something's not working as 234 | # you might expect, make sure that you have specifically enabled it 235 | # below. 236 | # 237 | 238 | # 239 | # DocumentRoot: The directory out of which you will serve your 240 | # documents. By default, all requests are taken from this directory, but 241 | # symbolic links and aliases may be used to point to other locations. 242 | # 243 | DocumentRoot "/var/www/localhost/htdocs" 244 | 245 | # 246 | # Possible values for the Options directive are "None", "All", 247 | # or any combination of: 248 | # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 249 | # 250 | # Note that "MultiViews" must be named *explicitly* --- "Options All" 251 | # doesn't give it to you. 252 | # 253 | # The Options directive is both complicated and important. Please see 254 | # http://httpd.apache.org/docs/2.4/mod/core.html#options 255 | # for more information. 256 | # 257 | Options Indexes FollowSymLinks 258 | 259 | # 260 | # AllowOverride controls what directives may be placed in .htaccess files. 261 | # It can be "All", "None", or any combination of the keywords: 262 | # AllowOverride FileInfo AuthConfig Limit 263 | # 264 | AllowOverride None 265 | 266 | # 267 | # Controls who can get stuff from this server. 268 | # 269 | Require all granted 270 | 271 | 272 | # 273 | # DirectoryIndex: sets the file that Apache will serve if a directory 274 | # is requested. 275 | # 276 | 277 | DirectoryIndex index.html 278 | 279 | 280 | # 281 | # The following lines prevent .htaccess and .htpasswd files from being 282 | # viewed by Web clients. 283 | # 284 | 285 | Require all denied 286 | 287 | 288 | # 289 | # ErrorLog: The location of the error log file. 290 | # If you do not specify an ErrorLog directive within a 291 | # container, error messages relating to that virtual host will be 292 | # logged here. If you *do* define an error logfile for a 293 | # container, that host's errors will be logged there and not here. 294 | # 295 | ErrorLog logs/error.log 296 | 297 | # 298 | # LogLevel: Control the number of messages logged to the error_log. 299 | # Possible values include: debug, info, notice, warn, error, crit, 300 | # alert, emerg. 301 | # 302 | LogLevel warn 303 | 304 | 305 | # 306 | # The following directives define some format nicknames for use with 307 | # a CustomLog directive (see below). 308 | # 309 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 310 | LogFormat "%h %l %u %t \"%r\" %>s %b" common 311 | 312 | 313 | # You need to enable mod_logio.c to use %I and %O 314 | LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 315 | 316 | 317 | # 318 | # The location and format of the access logfile (Common Logfile Format). 319 | # If you do not define any access logfiles within a 320 | # container, they will be logged here. Contrariwise, if you *do* 321 | # define per- access logfiles, transactions will be 322 | # logged therein and *not* in this file. 323 | # 324 | #CustomLog logs/access.log common 325 | 326 | # 327 | # If you prefer a logfile with access, agent, and referer information 328 | # (Combined Logfile Format) you can use the following directive. 329 | # 330 | CustomLog logs/access.log combined 331 | 332 | 333 | 334 | # 335 | # Redirect: Allows you to tell clients about documents that used to 336 | # exist in your server's namespace, but do not anymore. The client 337 | # will make a new request for the document at its new location. 338 | # Example: 339 | # Redirect permanent /foo http://www.example.com/bar 340 | 341 | # 342 | # Alias: Maps web paths into filesystem paths and is used to 343 | # access content that does not live under the DocumentRoot. 344 | # Example: 345 | # Alias /webpath /full/filesystem/path 346 | # 347 | # If you include a trailing / on /webpath then the server will 348 | # require it to be present in the URL. You will also likely 349 | # need to provide a section to allow access to 350 | # the filesystem path. 351 | 352 | # 353 | # ScriptAlias: This controls which directories contain server scripts. 354 | # ScriptAliases are essentially the same as Aliases, except that 355 | # documents in the target directory are treated as applications and 356 | # run by the server when requested rather than as documents sent to the 357 | # client. The same rules about trailing "/" apply to ScriptAlias 358 | # directives as to Alias. 359 | # 360 | ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/" 361 | 362 | 363 | 364 | 365 | # 366 | # ScriptSock: On threaded servers, designate the path to the UNIX 367 | # socket used to communicate with the CGI daemon of mod_cgid. 368 | # 369 | #Scriptsock cgisock 370 | 371 | 372 | # 373 | # "/var/www/localhost/cgi-bin" should be changed to whatever your ScriptAliased 374 | # CGI directory exists, if you have that configured. 375 | # 376 | 377 | AllowOverride None 378 | Options None 379 | Require all granted 380 | 381 | 382 | 383 | # 384 | # Avoid passing HTTP_PROXY environment to CGI's on this or any proxied 385 | # backend servers which have lingering "httpoxy" defects. 386 | # 'Proxy' request header is undefined by the IETF, not listed by IANA 387 | # 388 | RequestHeader unset Proxy early 389 | 390 | 391 | 392 | # 393 | # TypesConfig points to the file containing the list of mappings from 394 | # filename extension to MIME-type. 395 | # 396 | TypesConfig /etc/apache2/mime.types 397 | 398 | # 399 | # AddType allows you to add to or override the MIME configuration 400 | # file specified in TypesConfig for specific file types. 401 | # 402 | #AddType application/x-gzip .tgz 403 | # 404 | # AddEncoding allows you to have certain browsers uncompress 405 | # information on the fly. Note: Not all browsers support this. 406 | # 407 | #AddEncoding x-compress .Z 408 | #AddEncoding x-gzip .gz .tgz 409 | # 410 | # If the AddEncoding directives above are commented-out, then you 411 | # probably should define those extensions to indicate media types: 412 | # 413 | AddType application/x-compress .Z 414 | AddType application/x-gzip .gz .tgz 415 | 416 | # 417 | # AddHandler allows you to map certain file extensions to "handlers": 418 | # actions unrelated to filetype. These can be either built into the server 419 | # or added with the Action directive (see below) 420 | # 421 | # To use CGI scripts outside of ScriptAliased directories: 422 | # (You will also need to add "ExecCGI" to the "Options" directive.) 423 | # 424 | #AddHandler cgi-script .cgi 425 | 426 | # For type maps (negotiated resources): 427 | #AddHandler type-map var 428 | 429 | # 430 | # Filters allow you to process content before it is sent to the client. 431 | # 432 | # To parse .shtml files for server-side includes (SSI): 433 | # (You will also need to add "Includes" to the "Options" directive.) 434 | # 435 | #AddType text/html .shtml 436 | #AddOutputFilter INCLUDES .shtml 437 | 438 | 439 | # 440 | # The mod_mime_magic module allows the server to use various hints from the 441 | # contents of the file itself to determine its type. The MIMEMagicFile 442 | # directive tells the module where the hint definitions are located. 443 | # 444 | 445 | MIMEMagicFile /etc/apache2/magic 446 | 447 | 448 | # 449 | # Customizable error responses come in three flavors: 450 | # 1) plain text 2) local redirects 3) external redirects 451 | # 452 | # Some examples: 453 | #ErrorDocument 500 "The server made a boo boo." 454 | #ErrorDocument 404 /missing.html 455 | #ErrorDocument 404 "/cgi-bin/missing_handler.pl" 456 | #ErrorDocument 402 http://www.example.com/subscription_info.html 457 | # 458 | 459 | # 460 | # MaxRanges: Maximum number of Ranges in a request before 461 | # returning the entire resource, or one of the special 462 | # values 'default', 'none' or 'unlimited'. 463 | # Default setting is to accept 200 Ranges. 464 | #MaxRanges unlimited 465 | 466 | # 467 | # EnableMMAP and EnableSendfile: On systems that support it, 468 | # memory-mapping or the sendfile syscall may be used to deliver 469 | # files. This usually improves server performance, but must 470 | # be turned off when serving from networked-mounted 471 | # filesystems or if support for these functions is otherwise 472 | # broken on your system. 473 | # Defaults: EnableMMAP On, EnableSendfile Off 474 | # 475 | #EnableMMAP off 476 | #EnableSendfile on 477 | 478 | # Load config files from the config directory "/etc/apache2/conf.d". 479 | # 480 | IncludeOptional /etc/apache2/conf.d/*.conf 481 | IncludeOptional /etc/apache2/sites/*.conf 482 | 483 | -------------------------------------------------------------------------------- /configs/php.ini: -------------------------------------------------------------------------------- 1 | short_open_tag = On 2 | ; Display PHP version to header 3 | ; http://php.net/expose-php 4 | expose_php = Off 5 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 6 | ; Development Value: E_ALL 7 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 8 | error_reporting = E_ALL 9 | 10 | ; Default Value: On 11 | ; Development Value: On 12 | ; Production Value: Off 13 | display_errors = Off 14 | 15 | variables_order = "EGPCS" 16 | default_charset = "UTF-8" 17 | 18 | post_max_size = 25M 19 | upload_max_filesize = 20M 20 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ln -sf /dev/stdout /var/log/apache2/access.log && \ 4 | ln -sf /dev/stderr /var/log/apache2/error.log 5 | 6 | mkdir -p /run/apache2 && \ 7 | /usr/sbin/httpd -D FOREGROUND 8 | 9 | exit "$@" 10 | -------------------------------------------------------------------------------- /helpers.php: -------------------------------------------------------------------------------- 1 | type = clean_input($_GET["type"]); 20 | $requestArgs->id = clean_input($_GET["id"]); 21 | if (isset($_GET["extra"])) { 22 | parse_str($_GET["extra"], $requestArgs->extra); 23 | $requestArgs->extra = (object) $requestArgs->extra; 24 | } 25 | 26 | return $requestArgs; 27 | 28 | } 29 | 30 | function setHeaders() { 31 | header("Access-Control-Allow-Origin: *"); 32 | header("Access-Control-Allow-Headers: *"); 33 | header("Content-Type: application/json"); 34 | header("Cache-Control: max-age=3600"); 35 | } 36 | 37 | function page404() { 38 | header("HTTP/1.1 404 Not Found"); 39 | echo "404 Page Not Found"; 40 | } 41 | 42 | //This Addon Functions 43 | function clean_input($data) { 44 | $data = trim($data); 45 | $data = stripslashes($data); 46 | $data = htmlspecialchars($data); 47 | return $data; 48 | } 49 | 50 | function generate_meta($arr) { 51 | $meta_arr = array("type" => "tv", 52 | "id" => $arr['id'], 53 | "name" => $arr['name'], 54 | "genre" => $arr['genre'], 55 | "banner" => $arr['img'], 56 | "poster" => $arr['poster'], 57 | "background" => $arr['img'], 58 | "posterShape" => "landscape", 59 | "description" => $arr['description'], 60 | "runtime" => "Duration {$arr['runtime']}", 61 | "cast" => $arr['cast']); 62 | return $meta_arr; 63 | } 64 | 65 | function generate_stream($arr) { 66 | $name = $arr['title']; 67 | $title = $arr['name']; 68 | $i = 0; 69 | foreach ($arr['streams'] as $d) { 70 | $stream_arr['streams'][$i]['url'] = $d['url']; 71 | $stream_arr['streams'][$i]['title'] = "{$title} \n {$d['res']}" ; 72 | $stream_arr['streams'][$i]['name'] = $name; 73 | $i++; 74 | } 75 | return $stream_arr; 76 | } 77 | 78 | //Caching Functions 79 | function cache_create($key,$data,$ttl) { 80 | if (cache_status) { 81 | CacheManager::setDefaultConfig(new ConfigurationOption([ 82 | 'path' => cache_path 83 | ])); 84 | $objFilesCache = CacheManager::getInstance('files'); 85 | $CachedString = $objFilesCache->getItem($key); 86 | if (is_null($CachedString->get())) { 87 | $CachedString->set($data)->expiresAfter($ttl); 88 | $objFilesCache->save($CachedString); 89 | return array("status" => 1); 90 | } 91 | } 92 | else 93 | return array("status" => 0); 94 | } 95 | 96 | function cache_check($key) { 97 | if (cache_status) { 98 | CacheManager::setDefaultConfig(new ConfigurationOption([ 99 | 'path' => cache_path, 100 | ])); 101 | $objFilesCache = CacheManager::getInstance('files'); 102 | $CachedString = $objFilesCache->getItem($key); 103 | if (is_null($CachedString->get())) { 104 | return array("status" => 0); 105 | } 106 | else 107 | return array("status" => 1, "key" => $key, "data" => $CachedString->get()); 108 | } 109 | else 110 | return array("status" => 0); 111 | } 112 | -------------------------------------------------------------------------------- /manifest.php: -------------------------------------------------------------------------------- 1 | id = $config['id']; 11 | $manifest->version = $config['version']; 12 | $manifest->name = $config['name']; 13 | $manifest->description = $config['description']; 14 | $manifest->icon = $config['icon']; 15 | $manifest->resources = array("catalog", "meta", "stream"); 16 | $manifest->types = array("tv"); 17 | $manifest->idPrefixes = array("sliv","zee5","mx"); 18 | 19 | // define catalog 20 | $catalog[0]['type'] = "tv"; 21 | $catalog[0]['name'] = "zee5 TV"; 22 | $catalog[0]['id'] = "zee5_home"; 23 | $catalog[1]['type'] = "tv"; 24 | $catalog[1]['name'] = "SonyLiv TV"; 25 | $catalog[1]['id'] = "sliv_home"; 26 | $catalog[2]['type'] = "tv"; 27 | $catalog[2]['name'] = "MxPlayer TV"; 28 | $catalog[2]['id'] = "mx_home"; 29 | 30 | // set catalogs in manifest 31 | $manifest->catalogs = $catalog; 32 | 33 | //Final JSON 34 | echo json_encode((array)$manifest); 35 | 36 | ?> -------------------------------------------------------------------------------- /metas.php: -------------------------------------------------------------------------------- 1 | id); 11 | if ($get_id['0'] == "zee5") { 12 | $cache_key = "meta_{$get_id['1']}"; 13 | $cache = cache_check($cache_key); 14 | if ($cache['status']) { 15 | echo $cache['data']; 16 | } 17 | else { 18 | $fin = zee5_meta($get_id['1']); 19 | $metas = generate_meta($fin); 20 | $meta_final['meta'] = $metas; 21 | $data = json_encode($meta_final,JSON_UNESCAPED_SLASHES); 22 | cache_create($cache_key,$data,cache_meta_ttl); 23 | echo $data; 24 | } 25 | } 26 | elseif ($get_id['0'] == "sliv") { 27 | $cache_key = "meta_{$get_id['1']}"; 28 | $cache = cache_check($cache_key); 29 | if ($cache['status']) { 30 | echo $cache['data']; 31 | } 32 | else { 33 | $fin = liv_get_info_id($get_id['1']); 34 | $metas = generate_meta($fin); 35 | $meta_final['meta'] = $metas; 36 | $data = json_encode($meta_final,JSON_UNESCAPED_SLASHES); 37 | cache_create($cache_key,$data,cache_meta_ttl); 38 | echo $data; 39 | } 40 | } 41 | elseif ($get_id['0'] == "mx") { 42 | $cache_key = "meta_{$get_id['1']}"; 43 | $cache = cache_check($cache_key); 44 | if ($cache['status']) { 45 | echo $cache['data']; 46 | } 47 | else { 48 | $fin = mxplayer_get_meta($get_id['1']); 49 | $metas = generate_meta($fin); 50 | $meta_final['meta'] = $metas; 51 | $data = json_encode($meta_final,JSON_UNESCAPED_SLASHES); 52 | cache_create($cache_key,$data,cache_meta_ttl); 53 | echo $data; 54 | } 55 | } 56 | else 57 | echo "null"; 58 | 59 | ?> -------------------------------------------------------------------------------- /mxplayer.php: -------------------------------------------------------------------------------- 1 | array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 6 | 'allow_redirects' => false, 7 | 'cookies' => true, 8 | 'verify' => false 9 | ) ); 10 | $response = $client->get("https://api.mxplay.com/v1/web/live/channels"); 11 | $data = json_decode($response->getBody()->getContents(),true); 12 | $i =0; 13 | foreach($data['channels'] as $t) { 14 | if (!($t['id'] == "7021.SETHD.in" || $t['id'] == "7022.SABHD.in" ||$t['id'] == "7023.MAXHD.in" ||$t['id'] == "7032.SonyMixSD.in" ||$t['id'] == "7031.SonyMarathi.in" ||$t['id'] == "7027.SonyYay.in" ||$t['id'] == "7030.SonyAath.in" ||$t['id'] == "7026.SonyWah.in" || $t['id'] == "7029.SonyPal.in")) { 15 | $final[$i]['id'] = "mx:{$t['id']}"; 16 | $final[$i]['poster'] = mxplayer_get_image($t['image']['1x1']); 17 | $final[$i]['name'] = $t['title']; 18 | $final[$i]['description'] = "{$t['title']} Live Tv."; 19 | $metas['metas'][] = generate_meta($final[$i]); 20 | $i++; 21 | } 22 | } 23 | return $metas; 24 | } 25 | 26 | function mxplayer_get_image($url) { 27 | $exp = explode("/",$url); 28 | $fin = "https://qqcdnpicweb.mxplay.com/media/images/{$exp['3']}/1x1/5x/{$exp['4']}"; 29 | return $fin; 30 | } 31 | 32 | 33 | function mxplayer_get_meta($id) { 34 | $client = new \GuzzleHttp\Client(array( 35 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 36 | 'allow_redirects' => false, 37 | 'cookies' => true, 38 | 'verify' => false 39 | ) ); 40 | $response = $client->get("https://api.mxplay.com/v1/web/live/channels"); 41 | $data = json_decode($response->getBody()->getContents(),true); 42 | foreach($data['channels'] as $t) { 43 | if ($t['id'] == $id) { 44 | $final['id'] = "mx:{$t['id']}"; 45 | $final['poster'] = mxplayer_get_image($t['image']['1x1']); 46 | $final['name'] = $t['title']; 47 | $final['description'] = "{$t['title']} Live Tv."; 48 | } 49 | } 50 | return $final; 51 | } 52 | 53 | function mxplayer_get_stream($id) { 54 | $client = new \GuzzleHttp\Client(array( 55 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 56 | 'allow_redirects' => false, 57 | 'cookies' => true, 58 | 'verify' => false 59 | ) ); 60 | $response = $client->get("https://api.mxplay.com/v1/web/live/channels"); 61 | $data = json_decode($response->getBody()->getContents(),true); 62 | foreach($data['channels'] as $t) { 63 | if ($t['id'] == $id) { 64 | $arr['name'] = $t['title']; 65 | $arr['title'] = "mxplayer"; 66 | $arr['streams']['0']['url'] = $t['stream']['mxplay']['hls']['main']; 67 | $arr['streams']['0']['res'] = "Adaptive Bitrate"; 68 | } 69 | } 70 | return $arr; 71 | } 72 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "name": "stremio-indian-livetv", 4 | "builds": [ 5 | { "src": "*.php", "use": "now-php" } 6 | ], 7 | "rewrites": [ 8 | { "source": "/manifest.json", "destination": "/manifest.php" }, 9 | { "source": "/meta/(.*)/(.*)/(.*).json", "destination": "/metas.php?type=$1&id=$2&extra=$3" }, 10 | { "source": "/meta/(.*)/(.*).json", "destination": "/metas.php?type=$1&id=$2" }, 11 | { "source": "/stream/(.*)/(.*)/(.*).json", "destination": "/streams.php?type=$1&id=$2&extra=$3" }, 12 | { "source": "/stream/(.*)/(.*).json", "destination": "/streams.php?type=$1&id=$2" }, 13 | { "source": "/catalog/(.*)/(.*)/(.*).json", "destination": "/catalogs.php?type=$1&id=$2&extra=$3" }, 14 | { "source": "/catalog/(.*)/(.*).json", "destination": "/catalogs.php?type=$1&id=$2" } 15 | ], 16 | "regions" : ["bom1"] 17 | } -------------------------------------------------------------------------------- /sonyliv.php: -------------------------------------------------------------------------------- 1 | array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 11 | 'allow_redirects' => false, 12 | 'cookies' => true, 13 | 'verify' => false 14 | ) ); 15 | $json = '{"detailsType":"basic","searchSet":[{"pageSize":110,"pageNumber":0,"sortOrder":"START_DATE:DESC","data":"all=classification:channel&all=type:live","type":"search","id":"live_channels","itemsUsed":0,"language":""}],"deviceDetails":{"mfg":"WEB","os":"others","osVer":"XXX","model":"WEB","deviceId":"f45c45fe-022","platform":"web"},"isSearchable":true}'; 16 | 17 | $options = [ 18 | 'body' => $json, 19 | 'headers' => ['Content-Type' => 'application/json','x-build' => liv_build], 20 | ]; 21 | $response = $client->post(liv_base_url."api/v4/vod/search", $options); 22 | $data = json_decode($response->getBody()->getContents(),true); 23 | $i =0; 24 | foreach ($data['0']['assets'] as $d) { 25 | //id 26 | $final[$i]['id'] = "sliv:{$d['id']}"; 27 | 28 | //images 29 | $final[$i]['poster'] = $d['thumbnailUrl']; 30 | 31 | //name 32 | if (empty($d['channel'])) 33 | $name = $d['showname']; 34 | else 35 | $name = $d['channel']; 36 | 37 | $final[$i]['name'] = $name; 38 | 39 | $final[$i]['description'] = $d['shortDesc']; 40 | 41 | $final[$i]['genre'] = array("{$d['genre']}"); 42 | 43 | $metas['metas'][] = generate_meta($final[$i]); 44 | $i++; 45 | } 46 | return $metas; 47 | } 48 | 49 | function liv_get_info_id($id) { 50 | $client = new \GuzzleHttp\Client(array( 51 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 52 | 'allow_redirects' => false, 53 | 'cookies' => true, 54 | 'verify' => false 55 | ) ); 56 | $json = '{"detailsType":"all","isDetailedView":true,"asset_ids":"'.$id.'","timestamp":"2017-11-23T21:23:27.178Z","deviceDetails":{"mfg":"WEB","os":"others","osVer":"XXX","model":"WEB","deviceId":"f45c45fe-022e-4865-a26f-19794a8ae30d"}}'; 57 | 58 | $options = [ 59 | 'body' => $json, 60 | 'headers' => ['Content-Type' => 'application/json','x-build' => liv_build], 61 | ]; 62 | $response = $client->post(liv_base_url."api/v4/vod/asset/details", $options); 63 | $data = json_decode($response->getBody()->getContents(),true); 64 | $d = $data['assets']['0']['details']; 65 | 66 | //vid_links 67 | $url = preg_replace('/\s/', '', $d['hlsUrl']); 68 | $final['streams'] = liv_parse_m3u8($url); 69 | //$final['streams']['0']['url'] = $d['hlsUrl']; 70 | //$final['streams']['0']['res'] = "Adaptive Bitrate"; 71 | 72 | //genres 73 | $final['genre'] = array("{$d['genre']}"); 74 | 75 | //images only one size to reduce bandwidth on server because they will be served in base64. Due to referrer problem in beeg.com 76 | $final['img'] = $d['tvBackgroundImage']; 77 | $final['poster'] = $d['thumbnailUrl']; 78 | 79 | //title and description 80 | if (empty($d['channel'])) 81 | $name = $d['showname']; 82 | else 83 | $name = $d['channel']; 84 | $final['title'] = "SonyLiv"; 85 | $final['name'] = $name; 86 | $final['description'] = $d['metaDesc']; 87 | 88 | //id 89 | $final['id'] = "sliv:{$id}"; 90 | 91 | return $final; 92 | } 93 | 94 | function liv_parse_m3u8($url) { 95 | $data = file_get_contents($url); 96 | $data = explode("#",$data); 97 | $len = count($data); 98 | $ur = parse_url($url); 99 | $ur = "https://{$ur['host']}{$ur['path']}"; 100 | if (strpos($url, 'yupptvtest') !== false) 101 | $yupp = 1; 102 | for ($i =3; $i < $len; $i++) { 103 | $c = $i - 3; 104 | $s = explode("\n",$data[$i]); 105 | $res = explode(",",$data[$i]); 106 | if (!empty($s['1']) && !$yupp) { 107 | $l = parse_url($s['1']); 108 | if (empty($l['host'])) { 109 | $s['1'] = str_replace("master.m3u8",$l['path'],$ur); 110 | } 111 | } 112 | if (!empty($s['1']) && $yupp) { 113 | $s['1'] = str_replace("../../","https://sony-yupp.akamaized.net/hls/live/",$s['1']); 114 | } 115 | $streams[$c]['res'] = $res['4']; 116 | $streams[$c]['url'] = $s['1']; 117 | } 118 | return $streams; 119 | } -------------------------------------------------------------------------------- /streams.php: -------------------------------------------------------------------------------- 1 | id); 12 | if ($get_id['0'] == "zee5") { 13 | $fin = zee5_stream($get_id['1']); 14 | echo json_encode(generate_stream($fin),JSON_UNESCAPED_SLASHES); 15 | } 16 | elseif ($get_id['0'] == "sliv") { 17 | $fin = liv_get_info_id($get_id['1']); 18 | echo json_encode(generate_stream($fin),JSON_UNESCAPED_SLASHES); 19 | } 20 | elseif ($get_id['0'] == "mx") { 21 | $fin = mxplayer_get_stream($get_id['1']); 22 | echo json_encode(generate_stream($fin),JSON_UNESCAPED_SLASHES); 23 | } 24 | else 25 | echo "null"; 26 | ?> -------------------------------------------------------------------------------- /zee5.php: -------------------------------------------------------------------------------- 1 | array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 8 | 'allow_redirects' => false, 9 | 'cookies' => true, 10 | 'verify' => false 11 | ) ); 12 | $response = $client->get("https://catalogapi.zee5.com/v1/channel/bygenre?sort_by_field=channel_number&sort_order=ASC&genres=FREE%20Channels,Hindi%20Entertainment,Hindi%20Movies,English%20Entertainment,Entertainment,Movie,News,Hindi%20News,English%20News,Marathi,Tamil,Telugu,Bengali,Malayalam,Kannada,Punjabi,Kids,Gujarati,Odiya,Music,Lifestyle,Devotional,Comedy,Drama,Sports,Infotainment&country=IN&translation=en&languages=en,hi,te"); 13 | $data = json_decode($response->getBody()->getContents(),true); 14 | $i =0; 15 | foreach($data['items'] as $t) { 16 | foreach ($t['items'] as $d) { 17 | if (!($d['id'] == "0-9-214" || $d['id'] == "0-9-channel_477236247" || $d['id'] == "0-9-210")) { 18 | $final[$i]['id'] = "zee5:{$d['id']}"; 19 | $final[$i]['poster'] = "https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{$d['id']}/channel_web/{$d['list_image']}"; 20 | $final[$i]['name'] = $d['title']; 21 | $final[$i]['description'] = $d['description']; 22 | $metas['metas'][] = generate_meta($final[$i]); 23 | $i++; 24 | } 25 | } 26 | } 27 | return $metas; 28 | } 29 | 30 | function zee5_meta($id) { 31 | $client = new \GuzzleHttp\Client(array( 32 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 33 | 'allow_redirects' => false, 34 | 'cookies' => true, 35 | 'verify' => false 36 | ) ); 37 | $response = $client->get("https://catalogapi.zee5.com/v1/channel/{$id}?translation=en&country=IN"); 38 | $data = json_decode($response->getBody()->getContents(),true); 39 | $final['poster'] = "https://akamaividz2.zee5.com/image/upload/w_386,h_386,c_scale/resources/{$id}/channel_web/{$data['list_image']}"; 40 | $final['name'] = $data['title']; 41 | $final['description'] = $data['description']; 42 | $final['id'] = "zee5:{$id}"; 43 | return $final; 44 | } 45 | 46 | function zee5_get_token() { 47 | $client = new \GuzzleHttp\Client(array( 48 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 49 | 'allow_redirects' => false, 50 | 'cookies' => true, 51 | 'verify' => false 52 | ) ); 53 | $response = $client->get("https://gwapi.zee5.com/user/videoStreamingToken?channel_id=0-9-zing&country=IN&device_id=WebBrowser"); 54 | $data = json_decode($response->getBody()->getContents(),true); 55 | return $data['video_token']; 56 | } 57 | 58 | function zee5_stream($id) { 59 | $client = new \GuzzleHttp\Client(array( 60 | 'curl' => array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false ), 61 | 'allow_redirects' => false, 62 | 'cookies' => true, 63 | 'verify' => false 64 | ) ); 65 | $response = $client->get("https://catalogapi.zee5.com/v1/channel/{$id}?translation=en&country=IN"); 66 | $data = json_decode($response->getBody()->getContents(),true); 67 | $token = zee5_get_token(); 68 | $arr = array(); 69 | $arr['name'] = $data['title']; 70 | $arr['title'] = "zee5"; 71 | $arr['streams']['0']['url'] = "{$data['stream_url_hls']}{$token}"; 72 | $arr['streams']['0']['res'] = "Adaptive Bitrate"; 73 | return $arr; 74 | } 75 | --------------------------------------------------------------------------------