Jump to content

How to extract the URL from this URL (via PHP)


Badchip

Recommended Posts

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

Edited by Badchip
Link to comment
Share on other sites

That server is redirecting one URL to another, it sounds like you want the URL that it redirects to.  You might need to use a library like cURL to send a request to that URL and get the headers back.  The redirection URL will be in the Location header.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...