-
Notifications
You must be signed in to change notification settings - Fork 19
/
.htaccess
31 lines (24 loc) · 1.22 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
RewriteEngine On
RewriteBase /
# Deny access to specific extensions for movie, series, and live URLs (Prevent MX Player's multiple requests)
RewriteCond %{REQUEST_URI} \.(srt|ssa|ass|sub|smi|txt|idx|mpl|vtt|psb|sami|pjs|sup)$ [NC]
RewriteRule ^(movie|series|live)/ - [R=404,L]
# For movies
RewriteCond %{REQUEST_URI} ^(.*/)(movie/.*)
RewriteRule ^movie/.*/([0-9]+)\.[a-z0-9]+$ %1play.php?movieId=$1 [R=302,L]
# For series
RewriteCond %{REQUEST_URI} ^(.*/)(series/.*)
RewriteRule ^series/.*/([0-9]+)\.(.+)$ %1play.php?type=series&movieId=$1&data=$2 [R=302,L]
# For live
RewriteCond %{REQUEST_URI} ^(.*/)(live/.*)
RewriteRule ^live/.*/([0-9]+)\.[a-z0-9]+$ %1live_play.php?streamId=$1 [R=302,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Match the URL pattern where the last segment is purely numeric
RewriteRule ^(.*)/([0-9]+)$ %1/live_play.php?streamId=$2 [R=302,L]
# For Live M3U8 Playlist
RewriteCond %{REQUEST_URI} ^(.*/)(tv\.m3u8)
RewriteRule ^tv\.m3u8$ %1player_api.php?action=get_live_streams&type=m3u8 [R=302,L]
# For Movies M3U8 Playlist
RewriteCond %{REQUEST_URI} ^(.*/)(movies\.m3u8)
RewriteRule ^movies\.m3u8$ %1player_api.php?action=get_vod_streams&type=m3u8 [R=302,L]