I
I
ilysion_in_life2018-04-14 10:03:15
PHP
ilysion_in_life, 2018-04-14 10:03:15

How to get a link and display it?

Hello, guys, tell me examples of how you can bring this idea to life?
In general, I have a website with a video player, when I start the video, when I click on the play button, the video is downloading, i.e. in the developer console in the Network tab, there are requests with a response code 200 status, I need to catch this link and display a simple alert for example ( ); I found how to find out the response code from the link,
but then I can’t figure out how to do it.

$url = 'ссылка';
$ch = curl_init($url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo $httpcode;

it is necessary to display the link that comes from the server when you click on the play button

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WhatIsHTML, 2018-04-14
@WhatIsHTML

var href = $('a').attr('href');

S
Stalker_RED, 2018-04-16
@Stalker_RED

If I understood correctly what you want, that is, ready-made plugins like "video download helper".
If not correct, then describe how the server with its curl should know from where you clicked play somewhere in your browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question