</div> <?php echo "<h3>1. Download subtitles. Choose your lang:</h3>"; echo "<p>Right-click -> Save as...</p>"; $strEsUrl = $viki->subtitles($_GET['episode'], "es"); $strPtUrl = $viki->subtitles($_GET['episode'], "pt"); $strEnUrl = $viki->subtitles($_GET['episode'], "en"); $strFrUrl = $viki->subtitles($_GET['episode'], "fr"); echo "<p>"; echo "<a href='" . $strEsUrl . "' title='Download Spanish subtitles' class='btn btn-large btn-primary'><i class='icon-list-alt icon-white'></i> Spanish</a>"; echo " <a href='" . $strPtUrl . "' title='Download Português subtitles' class='btn btn-large btn-primary'><i class='icon-list-alt icon-white'></i> Português</a>"; echo " <a href='" . $strFrUrl . "' title='Download French subtitles' class='btn btn-large btn-primary'><i class='icon-list-alt icon-white'></i> French</a>"; echo " <a href='" . $strEnUrl . "' title='Download English subtitles' class='btn btn-large btn-primary'><i class='icon-list-alt icon-white'></i> English</a>"; echo "</p>"; $vikiStreams = $viki->streams($_GET['episode']); if ($vikiStreams !== FALSE) { echo "<h3>2. Download video. Choose your quality:</h3>"; echo "<p>Click, wait 5 sec, and then click again on the right up corner yellow button.</p>"; echo "<p>"; foreach ($vikiStreams as $quality => $data) { if ($quality == "external") { echo "Sory. No streams available to download :-("; } else { $adflyUrl = $adfly->getLink($_SERVER['SERVER_NAME'] . "/stream.php?id=" . $_GET['episode'] . "&quality=" . $quality); echo "<a href='" . $adflyUrl . "' title='Download video in " . $quality . "' class='btn btn-large btn-primary'><i class='icon-download-alt icon-white'></i> " . $quality . "</a> "; } } echo "</p>"; } } else {
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ************************/ include 'inc/functions.inc.php'; include 'inc/viki.inc.php'; if (isset($_GET['id']) && isset($_GET['quality'])) { $viki = new vikiAPI(); $vikiStreams = $viki->streams($_GET['id']); $count = count($vikiStreams); if ($count) { if (isset($vikiStreams[$_GET['quality']])) { $url = $vikiStreams[$_GET['quality']]['http']['url']; $ch = @curl_init(); @curl_setopt($ch, CURLOPT_URL, $url); @curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE); @curl_setopt($ch, CURLOPT_NOBODY, TRUE); //curl_setopt($ch, CURLOPT_HEADER, FALSE); @curl_exec($ch); $info = @curl_getinfo($ch); @curl_close($ch); @header("Cache-Control: no-cache, must-revalidate"); @header("Pragma: no-cache"); @header("Content-Disposition: attachment; filename= " . $_GET['id'] . "-" . $_GET['quality'] . ".mp4");