-
Posts
52 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Badchip
-
-
The two hash (#) have solved the problem. Thank you!
I have minimized the code:$unit = preg_replace('#[0-9]+\.#', '9.', $unit);
-
It doesn't work for me. I get a blank page. It's correct \\.test\\.com ?
I tried with:$unit = preg_replace('~[0-9]+~', '9', $unit);
... but it changes the whole URL... (all the numbers to 9)
Any idea? -
I'm using "extract_unit" function in order to extract a URL. Now I want to change the first number (15) to 9.
http://name15.test.com/live/test/index.m3u8?token=ab8hH3_1Y-d33BdyW_oxcQ&expires=1515075458
(The URL name/number can vary (for example "http://nemo2.test.com..."))
I used the function: $unit = preg_replace('~(?:\A..|(?!\A)\G)[^0-9]*\K[0-9]+~', '9', $unit);
but it changes all the numbers.Please can you help me with the regular expressions in order to change only the first number?
Thank you in advance.
-
So I need 2 PHP's for that? please, can you show me an example?
-
I would prefer via php instead .htaccess
-
1 hour ago, Don E said:
Are you saying that the actual file name is stream.php but the URL appears as steam.m3u8 in the browser but would like to see it in the browser as stream.php instead?
Exactly.
-
I'd like to open a php called "stream.php" and maintain the same url name when it's open (instead "http://www.site.com/stream.m3u8").
<?php header("Location: http://www.site.com/stream.m3u8"); ?>
What do I have to change?
Thank you in advance.
-
Can you give me a hand with the code? I need to open a stream between sunday 9:55PM and monday 1:30AM. I have solved the problem with 2 PHP's but I think it's not the best way.
QuotePHP1:
date_default_timezone_set('Europe/Madrid');
$current = new DateTime();
$start = DateTime::createFromFormat('D H:i', 'Sun 9:55PM');
$end = DateTime::createFromFormat('D H:i:s', 'Sun 11:59:59PM');if (($current > $start) && ($current < $end))
{
header("Location: event.php");
}
else
{
header("Location: php2.php");
}QuotePHP2:
date_default_timezone_set('Europe/Madrid');
$current = new DateTime();
$start = DateTime::createFromFormat('D H:i', 'Mon 00:00AM');
$end = DateTime::createFromFormat('D H:i', 'Mon 01:30AM');if (($current > $start) && ($current < $end))
{
header("Location: event.php");
}
else
{
header("Location: no_event.php");
} -
It works within the same day (for example, Sunday to Sunday)... but it does not work with different days (Sunday 9:55PM to Monday 1:30AM).
Quotedate_default_timezone_set('Europe/Madrid');
$current = new DateTime();
$start = DateTime::createFromFormat('D H:i', 'Sun 9:55PM');
$end = DateTime::createFromFormat('D H:i', 'Mon 1:30AM');if (($current > $start) && ($current < $end))
{
header("Location: url1.php");
}
else
{
header("Location: url2.php");
} -
Something like this? (stills opening only the url1.php)
date_default_timezone_set('Europe/Madrid'); $dtA = new DateTime('sunday 9:55PM'); $dtB = new DateTime('monday 1:00AM'); if ($dtA->getTimestamp() > $dtB->getTimestamp()) { header("Location: url1.php"); } else { header("Location: url2.php"); }
-
How do I apply it? I have tried two ways but I get an http error 500:
$dtA->getTimestamp('sunday 9:55PM') > $dtB->getTimestamp('monday 1:00AM'); if ($dtA > $dtB) { header("Location: url1.php"); } else { header("Location: url2.php"); }
if ($dtA->getTimestamp('sunday 9:55PM') > $dtB->getTimestamp('monday 1:00AM')) { header("Location: url1.php"); } else { header("Location: url2.php"); }
Thank you for your patience.
-
I'm trying to set a PHP in order to select another PHP between sunday and monday:
date_default_timezone_set('Europe/Madrid'); $dtA = new DateTime('sunday 9:55PM'); $dtB = new DateTime('monday 1:00AM'); if ($dtA > $dtB) { header("Location: url1.php"); } else { header("Location: url2.php"); }
It always send me to the url1.php. What am I doing wrong?
Thank you in advance.
-
-
I want to copy the code after ".m3u8?" in order to use it with another stream.
?hdnea=st=1510277838~exp=151027..................
Is it possible?
-
I just want the URL of the stream (http://stream.m3u8...") when you click http://link.theplatform.com/s/pf1NfC/9buCiIMqXE9z
-
I tried with:
<?php echo file_get_contents("http://link.theplatform.com/s/pf1NfC/9buCiIMqXE9z"); ?>
but I obtain the contain of the stream, not the URL:
#EXTM3U #EXT-X-VERSION:3 #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-STREAM-INF:BANDWIDTH=1100000,AVERAGE-BANDWIDTH=1100000,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=768x430,FRAME-RATE=29.970 master1000k.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2420000,AVERAGE-BANDWIDTH=2420000,CODECS="avc1.4d401f,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=29.970 master2500k.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=550000,AVERAGE-BANDWIDTH=550000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=480x270,FRAME-RATE=29.970 master500k.m3u8
I just need the second URL than opens http://link.theplatform.com/s/pf1NfC/9buCiIMqXE9z
-
This URL opens a ".m3u8" stream: http://link.theplatform.com/s/pf1NfC/9buCiIMqXE9z
I'd like to extract the URL (via PHP)
Thank you in advance. -
22 minutes ago, justsomeguy said:
If that highlighted part is a constant, then you can just use str_replace to find and replace all of them.
So can I open the same "index.html" via PHP without the higlighted part?
Would it be too much to ask an example? -
How to open my homepage "index.html" (via php) and remove the lines:
<a href="http://player.mysite.com/player.php?vid=site.com/file.m3u8">
...
(The result would be <a href="http://site.com/file.m3u8">
Thank you in advance. -
If that service is using geofencing then you need to either locate the server where they want you to, or convince them to disable geofencing.
No other way to detect the URL? (without headers 200|301|302|403 etc.)
-
Presumably the 403 happens because the web server isn't in Spain. If you're checking the URL with PHP then it's checking from the web server IP address.
The web server is located in Amsterdam, Netherlands.Do you know any alternative in order to skip this error? the only guy who answered my previous messages is you. -
I want to open a TV channel with a click. This channel have 3 random/variable URL's. (usually only one works)
$player = 'http://videoplayer.vodobox.com/vodobox_player.php?vid=';$enlace1 = 'http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8';$enlace2 = 'http://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/index_0_av-b.m3u8';$enlace3 = 'http://mdsios2-lh.akamaihd.net/i/mitele/esmediaset_21@168473/index_0_av-b.m3u8';function checkURL($url) {$headers = get_headers($url);if (preg_match('/^HTTP/d.ds+(200|301|302)/', $headers[0])){return true;}else return false;}?>if (checkURL($enlace1)) { echo ('');}else if (checkURL($enlace2)) {echo ('');}else if (checkURL($enlace3)) {echo ('');}?>
I receive this error: (try the debug here)
http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8 ====> HTTP/1.0 403 Forbiddenhttp://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/index_0_av-b.m3u8 ====> HTTP/1.0 200 OKhttp://mdsios2-lh.akamaihd.net/i/mitele/esmediaset_21@168473/index_0_av-b.m3u8 ====> HTTP/1.0 200 OK
However I can open/download the URL http://mdsiosgeo1-lh.akamaihd.net/i/mitele/esmediaset_11@168495/index_0_av-b.m3u8 without problems.
("http://mdsiosgeo1..." URL (geo) only works in Spain).
Is there any alternative to skip this error 403 Forbidden?
I could add the 403 header, but then the other URL's stop working.
Thank you in advance.
-
I suppose you can try sending ajax requests to each of them if that server allows cross-domain ajax requests, and then check the response headers to look for an error or something else that would indicate a problem.http://help.dottoro.com/ljxsrgqe.phpIf the server doesn't allow cross-domain ajax requests then you'll need to send an ajax request to a local file like a PHP script that can send the requests and check the headers.
The problem is I have no idea of programming. Some kind soul can help me out? I guess it's easy for any programmer.
-
Can someone help me out? I guess it should be easy for you.I need a script to do the following:
- Open the URL: http://token.mitele.es/?directo=telecinco. (enter the URL manually if doesn't works). The content will show something like this:videoTokenizer({"liveUrl":"http://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/master.m3u8?hdnea=st=1445529032~exp=1445529332~acl=/i/mitele/esmediaset_11@168471/*~hmac=5696c0b7f9af89eb8ce5371d99fd7a132e2782e5eda34eb32ae437eb389f3e6b"});
- Copy/open the URL with token (removing ""). The result would be:http://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/master.m3u8?hdnea=st=1445529032~exp=1445529332~acl=/i/mitele/esmediaset_11@168471/*~hmac=5696c0b7f9af89eb8ce5371d99fd7a132e2782e5eda34eb32ae437eb389f3e6b
- Open "master.m3u8" and copy/open the URL content, something like this:http://mdsios1-lh.akamaihd.net/i/mitele/esmediaset_11@168471/index_0_av-p.m3u8
Thank you in advance.
Stream not working using PHP...
in PHP
Posted · Edited by Badchip
I'm trying to access a public spanish sports channel (with geoblock), via PHP.
http://api.goltelevision.com/api/v1/media/hls/service/live
It contains:
{"code":200,"message":{"success":{"license":"","ip":"XX.XX.XX.XXX","manifest":"http://api-cdn.overon.es/SmilLive/getLiveIOS/playlist.m3u8?system=webgol&stream=webgol_gol24h&token=47836b419952abb5a0a768999ff9fb87&expire=5a503f1c","customData":"","hash":"webgol_gol24h","type":null}}}
If I copy/paste the URL (http://...), it opens the stream without problems. However if I extract the URL via PHP (using "extract_unit" function) it does not open.
Any idea?