protected function testDL($name = '') { if (strpos($this->page, "jwplayer('container').setup({") !== false) { // Removing the http will avoid to be catched by the download regexp and download with a wrong name. $this->page = str_replace("file: 'http", "file: 'xxxx", $this->page); } return parent::testDL($name); }
protected function testDL($name = '') { if (preg_match('@(https?://(?:[\\w\\-]+\\.)+[\\w\\-]+(?:\\:\\d+)?/)i/(?:[^/\\s\\"\'<>]+/)*\\w{12}(_t)?\\.jpe?g@i', $this->page, $SV) && preg_match('@[?&]h(?:ash)?=(\\w+)@i', $this->page, $hash)) { $DL = $SV[1] . $hash[1] . '/v.mp4'; // And that's how a XFS video download link is forged. if (empty($name)) { $name = $this->getFileName($DL[0]); } $this->RedirectDownload($DL, basename($name)); return true; } return parent::testDL($name); // Keep trying original method. }