Force download when possible
This commit is contained in:
parent
e5ae99f256
commit
07ecc011ce
1 changed files with 4 additions and 2 deletions
6
api.php
6
api.php
|
@ -67,7 +67,7 @@ if (isset($_GET["url"])) {
|
||||||
<?php
|
<?php
|
||||||
echo '<li class="best" itemprop="encoding" itemscope
|
echo '<li class="best" itemprop="encoding" itemscope
|
||||||
itemtype="http://schema.org/VideoObject">';
|
itemtype="http://schema.org/VideoObject">';
|
||||||
echo '<a itemprop="contentUrl"
|
echo '<a download="'.$video->_filename.'" itemprop="contentUrl"
|
||||||
href="', htmlentities($video->url) ,'">';
|
href="', htmlentities($video->url) ,'">';
|
||||||
echo '<b>Best</b> (<span itemprop="encodingFormat">',
|
echo '<b>Best</b> (<span itemprop="encodingFormat">',
|
||||||
$video->ext, '</span>)';
|
$video->ext, '</span>)';
|
||||||
|
@ -75,7 +75,9 @@ if (isset($_GET["url"])) {
|
||||||
foreach ($video->formats as $format) {
|
foreach ($video->formats as $format) {
|
||||||
echo '<li itemprop="encoding"
|
echo '<li itemprop="encoding"
|
||||||
itemscope itemtype="http://schema.org/VideoObject">';
|
itemscope itemtype="http://schema.org/VideoObject">';
|
||||||
echo '<a itemprop="contentUrl"
|
echo '<a download="'.str_replace(
|
||||||
|
$video->ext, $format->ext, $video->_filename
|
||||||
|
).'" itemprop="contentUrl"
|
||||||
href="', htmlentities($format->url) ,'">';
|
href="', htmlentities($format->url) ,'">';
|
||||||
echo '<span itemprop="videoQuality">', $format->format,
|
echo '<span itemprop="videoQuality">', $format->format,
|
||||||
'</span> (<span itemprop="encodingFormat">',
|
'</span> (<span itemprop="encodingFormat">',
|
||||||
|
|
Loading…
Reference in a new issue