<?php /** * @name Simple function to get link and download video on Facebook * @author Juno_okyo & Killer * @copyright 2013 by J2TeaM */ $url = 'https://www.facebook.com/photo.php?v=464181973622841&set=vb.405529542805619&type=3'; _Download($url); function _Download($url) { $useragent = 'Mozilla/5.0 (Linux; U; Android 2.3.3; de-de; HTC Desire Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, $useragent); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); $source = curl_exec($ch); curl_close($ch); $download = explode('/video_redirect/?src=', $source); $download = explode('&', $download[1]); $download = rawurldecode($download[0]); header('Location: ' . $download); exit(); } ?>Các bạn có thể thêm một đoạn GET để có thể download theo dạng ?url=LINK_VIDEO.
[PHP] Simple function to get link and download video on Facebook
[PHP] Simple function to get link and download video on Facebook | Juno_okyo's Blog
Leader at J2TEAM. Website: https://j2team.dev/