���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/vidoe.top/proxy/youtubedownload/example/ |
<?php class LinkHandler { /* * store the url pattern and corresponding downloader object * @var array */ private $link_array = array(); public function __construct() { $this->link_array = array("/^(?:http(?:s)?:\/\/)?(?:www\.)?(?:m\.)?(?:youtu\.be\/|youtube\.com\/(?:(?:watch)?\?(?:.*&)?v(?:i)?=|(?:embed)\/))([^\?&\"'>]+)/" => new YouTubeDownloader(), "/^(?:http(?:s)?:\/\/)?(?:www\.)?vimeo\.com\/\d{8}/"=>new VimeoDownloader() ); } /* * Get the url pattern * return array */ private function getPattern() { return array_keys($this->link_array); } /* * Get the downloader object if pattern matches else return false * @param string * return object or bool * */ public function getDownloader($url) { for($i = 0; $i < count($this->getPattern()); $i++) { $pattern_st = $this->getPattern()[$i]; /* * check the pattern match with the given video url */ if(preg_match($pattern_st, $url)) { return $this->link_array[$pattern_st]; } } return false; } }