Mayk IP TV

技術參考手冊

Xtream Codes IPTV API 格式規格

Xtream Codes IPTV API 深入規格技術手冊。完整涵蓋身分驗證、分類架構、即時串流、隨選電影與影集端點,並提供線上 JSON 格式驗證功能。

Xtream Codes API 架構設計體系

Xtream Codes API 提供一套井然有序之 RESTful 介面標準,使 IPTV 播放器得以在安全環境中完成登入驗證並載入目錄。

身分驗證與會員帳號狀態資料

應用程式將使用者帳密傳送至 player_api.php,並取回服務效期、連線數上限與伺服器網路組態等關鍵資訊。

目錄操作指令與資料分流擷取

專門設計之 API 動作讓客戶端得以將即時頻道、隨選電影與多季連續影集快速且分開下載完畢。

規格化串流媒體播放網址樣式

串流媒體連結遵從一致且可預測之網址規則,並依不同媒體類型配賦正確之封裝副檔名。

身分驗證欄位

欄位 / 標籤層級類型範例值說明
user_info.auth必填Integer (1 = success)1數字形式之驗證狀態碼:1 代表驗證成功,0 代表登入遭到拒絕。
user_info.status必填String ("Active")"Active"使用者帳號當前之合約狀態(諸如 Active、Expired 或 Banned)。
user_info.exp_date必填Unix Timestamp / null"1775000000"以 Unix 時間戳記明確標註使用者訂閱合約截止日期之數值。
user_info.max_connections必填String / Integer"2"該授權帳號所獲准同時連線串流播放之最大連線上限數。
user_info.allowed_output_formats必填Array of String["m3u8", "ts"]支援之串流媒體封裝容器格式列表(m3u8, ts, mp4, mkv)。
server_info必填Object{"url":"stream.example.com","port":"8080","https_port":"8443","server_protocol":"https"}記錄伺服器對外連接埠、串流協定設定與主機位址之資料物件。

目錄端點與操作指令

欄位 / 標籤層級類型範例值說明
get_live_categories必填Array of Category Objects[{"category_id":"1","category_name":"News","parent_id":0}]用於向伺服器調取即時電視頻道所有群組分類清單之 API 指令。
get_vod_categories必填Array of Category Objects[{"category_id":"10","category_name":"Action","parent_id":0}]用於調取隨選電影 (VOD) 各項類型分類清單之 API 操作指令。
get_series_categories必填Array of Category Objects[{"category_id":"20","category_name":"Drama","parent_id":0}]用於調取連續影集各分類群組清單之專用 API 操作指令。
get_live_streams必填Array of Live Stream Objects[{"stream_id":101,"name":"TRT 1 HD","stream_type":"live","category_id":"1"}]完整列出所有即時頻道、或依指定群組進行精確篩選之 API 指令。
get_vod_streams必填Array of VOD Stream Objects[{"stream_id":202,"name":"Example Movie","container_extension":"mp4","category_id":"10"}]完整列出所有隨選電影、或依特定類別篩選片庫之 API 指令。
get_series必填Array of Series Objects[{"series_id":303,"name":"Example Series","category_id":"20"}]用於取得目前平台上所收錄之全部連續影集總覽名冊之 API 指令。
get_series_info必填Series Detail Object (episodes map){"info":{"name":"Example Series"},"episodes":{"1":[{"id":"30301","episode_num":1,"title":"Episode 1"}]}}用於深入調閱影集各季別與分集清單詳細檔案之 API 操作指令。

即時直播與隨選隨看資料欄位

欄位 / 標籤層級類型範例值說明
stream_id必填Integer / String101在系統中配發予該即時頻道或隨選電影之專屬數字識別碼。
name必填String"TRT 1 HD"於播放器操作介面中呈現予使用者檢視之頻道或影片全名。
stream_type必填String ("live" | "movie")"live"串流分類代碼:即時電視頻道為 'live',隨選電影為 'movie'。
stream_icon選填URL (http/https)"https://stream.example.com:8080/images/101.png"連結至頻道專屬台標或電影官方宣傳海報之直接 HTTPS 網址。
category_id必填String / Integer"1"將該項媒體項目劃歸至特定分類群組之數字類別識別碼。
container_extension必填String without dot ("mp4", "mkv", "m3u8")"mp4"不含前導英文句點之影片封裝副檔名(例如 mp4, mkv, m3u8)。
is_adult選填Integer / String ("0" | "1")"0"成人年齡限制級內容標記旗標:若有限制則為 1,其餘則為 0。

影集與劇集資料欄位

欄位 / 標籤層級類型範例值說明
series_id必填Integer / String303在影集庫檔案系統中所配發予該部連續影集之專屬識別編號。
name必填String"Example Series"於連續影集總清單目錄中所登記之劇集標準正式片名。
cover選填URL (http/https)"https://stream.example.com:8080/images/series303.png"指向連續影集官方代表宣傳封面或海報之直接 HTTPS 網址。
category_id必填String / Integer"20"該部影集在電視劇總覽清單中所屬分類項目之類別編號。
season必填Integer / String1該特定劇集單集所隸屬之具體播映季別數字編號。
episode_num必填Integer / String1該單集於其所屬播映季之中所排定之循序集數序號。
container_extension必填String without dot ("mp4", "mkv")"mp4"該影集單集影片檔案之封裝副檔名(字首不含點號)。

串流網址格式規則

類別欄位 / 標籤範例值
即時電視{server}/live/{username}/{password}/{stream_id}.m3u8https://stream.example.com:8080/live/demo_user/demo_pass/101.m3u8
電影 (VOD){server}/movie/{username}/{password}/{stream_id}.{container_extension}https://stream.example.com:8080/movie/demo_user/demo_pass/202.mp4
影集單集{server}/series/{username}/{password}/{episode_id}.{container_extension}https://stream.example.com:8080/series/demo_user/demo_pass/30301.mp4

範例範本

GET /player_api.php (user_info & server_info)
{
  "user_info": {
    "username": "demo_user",
    "password": "demo_pass",
    "auth": 1,
    "status": "Active",
    "exp_date": "1775000000",
    "is_trial": "0",
    "active_cons": "0",
    "max_connections": "2",
    "created_at": "1700000000",
    "allowed_output_formats": [
      "m3u8",
      "ts",
      "mp4",
      "mkv"
    ]
  },
  "server_info": {
    "url": "stream.example.com",
    "port": "8080",
    "https_port": "8443",
    "server_protocol": "https",
    "rtmp_port": "8880",
    "timezone": "UTC",
    "timestamp_now": 1714000000,
    "time_now": "2026-10-26 10:00:00"
  }
}
get_live_streams & get_vod_streams
[
  {
    "num": 1,
    "name": "TRT 1 HD",
    "stream_type": "live",
    "stream_id": 101,
    "stream_icon": "https://stream.example.com:8080/images/101.png",
    "epg_channel_id": "trt1.tr",
    "added": "1700000000",
    "category_id": "1",
    "custom_sid": null,
    "tv_archive": 1,
    "direct_source": "",
    "tv_archive_duration": 3
  },
  {
    "num": 2,
    "name": "Example Movie (2026)",
    "stream_type": "movie",
    "stream_id": 202,
    "stream_icon": "https://stream.example.com:8080/images/202.png",
    "category_id": "10",
    "container_extension": "mp4",
    "rating": "8.4",
    "year": "2026"
  }
]
get_series_info (seasons & episodes)
{
  "seasons": [
    {
      "air_date": "2026-01-01",
      "episode_count": 10,
      "id": 1,
      "name": "Season 1",
      "overview": "First season overview",
      "season_number": 1,
      "cover": "https://stream.example.com:8080/images/season1.png"
    }
  ],
  "info": {
    "name": "Example Series",
    "cover": "https://stream.example.com:8080/images/series303.png",
    "plot": "Series plot description",
    "cast": "Actor One, Actor Two",
    "director": "Director Name",
    "genre": "Drama",
    "releaseDate": "2026-01-01",
    "rating": "8.7",
    "category_id": "20"
  },
  "episodes": {
    "1": [
      {
        "id": "30301",
        "episode_num": 1,
        "title": "Pilot",
        "container_extension": "mp4",
        "info": {
          "duration_secs": 2700,
          "duration": "00:45:00",
          "video": {},
          "audio": {},
          "bitrate": 4500
        },
        "season": 1
      }
    ]
  }
}

互動式格式驗證器

請在下方貼上您的 M3U 代碼片段或 Xtream JSON 回應,以確認與 Mayk IP TV 之相容性。

Xtream Codes API 檢驗查核表

  • 針對具備有效合約之訂閱者,務必回傳 user_info.auth = 1 及 Active 狀態。
  • 若目錄無對應內容,請一律回傳空陣列 [],切勿回傳 null 空值。
  • 確實檢查每一個 category_id 均能正確對應至具備定義之有效分類。
  • 填寫 container_extension 時請勿加上前導句點(例如填入 mp4 而非 .mp4)。
  • 必須完整支援 HTTP 206 Partial Content 規範以確保影片拖曳時能即時無縫跳轉。