如何获取流文件(m3u8)的wmsAuthSign?或PHP

时间:2018-04-29 20:52:29

标签: php m3u8

我目前正在处理一个PHP Regex代码,它为特定网站抓取令牌wmsAuthSign = *,如果我刷新链接它会创建一个新令牌,但是我能够在php中创建链接但是它没有玩。它给出了禁止的错误消息。以下是PHP文件。

如果任何一个能够帮助处理php代码的人都会欣赏这项工作。

<?php
$streamSite = "http://iptvbase.net/roku_interface/3C2/0/3/91B1D385899EEE9E7DB7DCB0F8655E16/KODI_Linux-localhost-3.4.0-12884729-_1_SMP_PREEMPT_Mon_Jan_15_16:53:44_KST_2018-armv7l--1522686885.0/0/getHotLink/19/7/687474703a2f2f73756e2e6368616e6e656c73697074762e636f6d2f73756e766a706f696e74744950545632326835626372323478623268333534362f73756e68642f706c61796c6973742e6d337538/1522686884";

function writeFile($url, $channel) {
    $File = $channel.".strm";
    $Handle = fopen($File, 'w');
    fwrite($Handle, $url);
    fclose($Handle);
}
$input = @file_get_contents($streamSite) or die("Please try again later: $url");
preg_match("/(http.*?wmsAuthSign\=[^\&\">]+)/", $input, $matches);

echo $matches[1];

0 个答案:

没有答案