I have been struggling to get the streaming source of this video.
it is using jwplayer and i can see its source via chrome developer tools.
But is there any way i can scrape and get it programatically via php?Any help will be highly appreciated.
The source for video is right there in the HTML of the page, in the script
section:
<div id="myVideo"></div>
<script type="text/JavaScript">
var playerInstance = jwplayer("myVideo");
var countplayer = 1;
var countcheck = 0;
playerInstance.setup({
sources:[{file: 'https://video.xx.fbcdn.net/v/t42.9040-2/10000000_187709758618199_5004280148501987328_n.mp4?_nc_cat=0&efg=eyJybHIiOjE1MDAsInJsYSI6NDA5NiwidmVuY29kZV90YWciOiJzdmVfaGQifQ%3D%3D&rl=1500&vabr=571&oh=0bdc32a88a81edb15ea8470c6dc1b9fd&oe=5B00DA98',label: 'auto P','type' : 'mp4'}],
You just have to get the file
value from the first sources
array.
preg_match("/sources:\[{file:\ '(.*?)'/s", $html, $match);
echo($match[1]);
gives the sought result:
https://video.xx.fbcdn.net/v/t42.9040-2/10000000_187709758618199_5004280148501987328_n.mp4?_nc_cat=0&efg=eyJybHIiOjE1MDAsInJsYSI6NDA5NiwidmVuY29kZV90YWciOiJzdmVfaGQifQ%3D%3D&rl=1500&vabr=571&oh=0bdc32a88a81edb15ea8470c6dc1b9fd&oe=5B00DA98