Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
v1.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekVolsk committed Aug 9, 2022
1 parent 7d486e3 commit 10912ad
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# YtVideo

![Version](https://img.shields.io/badge/VERSION-1.8.4-0366d6.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.8.5-0366d6.svg?style=for-the-badge)
![Joomla](https://img.shields.io/badge/joomla-3.7+-1A3867.svg?style=for-the-badge)
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)

Expand Down
2 changes: 1 addition & 1 deletion README.ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# YtVideo

![Version](https://img.shields.io/badge/VERSION-1.8.4-0366d6.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.8.5-0366d6.svg?style=for-the-badge)
![Joomla](https://img.shields.io/badge/joomla-3.7+-1A3867.svg?style=for-the-badge)
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)

Expand Down
4 changes: 2 additions & 2 deletions pkg_ytvideo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<authorUrl>https://alekvolsk.pw</authorUrl>
<copyright>(C) Aleksey A. Morozov. All right reserved.</copyright>
<license>GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt</license>
<creationDate>July 2022</creationDate>
<creationDate>August 2022</creationDate>
<packager>Aleksey A. Morozov</packager>
<packagerurl>https://alekvolsk.pw</packagerurl>
<version>1.8.4</version>
<version>1.8.5</version>
<description>PKG_YTVIDEO_DESC</description>
<php_minimum>5.6</php_minimum>
<scriptfile>pkg_script.php</scriptfile>
Expand Down
7 changes: 3 additions & 4 deletions plg_content_ytvideo/ytvideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ public function onContentPrepare($context, &$article, &$params, $page = 0)
if (count($match) > 1) {
$resultImage = false;
$id = $match[1];
$cachedImage = $cachFolder . $id . ($isWebP ? '.webp' : '.jpg');

$cachedImage = $cachFolder . $id . '.jpg';
if (!file_exists($cachedImage)) {
foreach ($images as $img) {
$image = 'https://i.ytimg.com/vi' . ($isWebP ? '_webp/' : '/') . $id . '/' . $img . ($isWebP ? '.webp' : '.jpg');
$image = 'https://i.ytimg.com/vi/' . $id . '/' . $img . '.jpg';
$headers = get_headers($image);
if (is_array($headers) && strpos($headers[0], ' 404') !== false) {
if (is_array($headers) && strpos($headers[0], ' 200') > 0) {
$buffer = file_get_contents($image);
if ((bool) $buffer !== false) {
$resultImage = true;
Expand Down
4 changes: 2 additions & 2 deletions plg_content_ytvideo/ytvideo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorUrl>https://alekvolsk.pw</authorUrl>
<copyright>(C) Aleksey A. Morozov. All right reserved.</copyright>
<license>GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt</license>
<creationDate>July 2022</creationDate>
<version>1.8.4</version>
<creationDate>August 2022</creationDate>
<version>1.8.5</version>
<description>PLG_YTVIDEO_DESC</description>
<scriptfile>script.php</scriptfile>
<files>
Expand Down

0 comments on commit 10912ad

Please sign in to comment.