use App\Fluidbook\Link\Custom\WescoLink;
use App\Fluidbook\Link\Custom\WescoSalesLink;
use Cubist\Util\ArrayUtil;
+use Cubist\Util\Files\Files;
+use Cubist\Util\YoutubeDL;
use Fluidbook\Tools\Links\CartLink;
use Fluidbook\Tools\Links\ZoomProductLink;
+
class Link extends \Fluidbook\Tools\Links\Link
{
public static function getInstance($id, $init, &$compiler)
$init['to'] = self::replaceCustomURL($init['to']);
switch ($init['type']) {
- case 7:
+ case Link::CUSTOM:
switch ($compiler->getSetting('basketManager')) {
case 'Puma':
return new PumaCartLink($id, $init, $compiler);
default :
break;
}
- case 12: // Basket / Cart links
+ case Link::CART: // Basket / Cart links
if ($compiler->getSetting('product_zoom_references', '') !== '') {
return new zoomProductLink($id, $init, $compiler);
}
default :
break;
}
+ case Link::WEBVIDEO:
+ if ($compiler->getSetting('webvideoAsLocal', false)) {
+ switch ($init['video_service']) {
+ case 'youtube':
+ $url = 'https://www.youtube.com/watch?v=' . $init['to'];
+ break;
+ case 'dailymotion':
+ $url = 'https://www.dailymotion.com/video/' . $init['to'];
+ break;
+ case 'vimeo':
+ $url = 'https://www.vimeo.com/' . $init['to'];
+ break;
+ default:
+ break;
+ }
+ if (isset($url)) {
+ $file = YoutubeDL::downloadVideo($url, protected_path('youtubedl'));
+ $file = new \SplFileInfo($file);
+ }
+ if (isset($file) && file_exists($file->getPathname())) {
+ $init['type'] = Link::VIDEO;
+ $init['to'] = $file->getFilename();
+ $init['video_sound_on'] = true;
+ $init['video_controls'] = true;
+ $dest = $compiler->getWorkingDir() . $file->getFilename();
+ if (file_exists($dest)) {
+ unlink($dest);
+ }
+ symlink($file->getPathname(), $dest);
+ }
+ }
+ return parent::getInstance($id, $init, $compiler);
+
+
default:
break;
}
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "405ef5be043ac66b9ba0b0a6f8e5908d",
+ "content-hash": "5ef081df1bbcadabd9bf56b9561f2d66",
"packages": [
{
"name": "ahmadshah/lucy",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_util.git",
- "reference": "18676401c228bfd48a6fc74c24f602e36a143bd2"
+ "reference": "1580562573f299560f916da3a9999eb29662a78c"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-a551df.tar",
- "reference": "18676401c228bfd48a6fc74c24f602e36a143bd2",
- "shasum": "675fd965b43b7bf9d3bce9bef535aeaca0224b0a"
+ "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-295bce.tar",
+ "reference": "1580562573f299560f916da3a9999eb29662a78c",
+ "shasum": "c808c6f7b74eee23eaafd92df05dd22ec8c70e63"
},
"require": {
"cubist/net": "dev-master",
"ext-simplexml": "*",
"ext-sodium": "*",
"laravel/framework": "~5.8|^6.0|^7.0|^8.0|^9.0|^10.0",
+ "norkunas/youtube-dl-php": "^2.2",
"php": ">=7.2"
},
"default-branch": true,
}
],
"description": "Utilities class",
- "time": "2023-05-04T13:49:10+00:00"
+ "time": "2023-05-05T13:35:12+00:00"
},
{
"name": "cviebrock/eloquent-sluggable",
],
"time": "2023-01-29T18:53:47+00:00"
},
+ {
+ "name": "norkunas/youtube-dl-php",
+ "version": "v2.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/norkunas/youtube-dl-php.git",
+ "reference": "173d5e4528cf55dcb6027869f5b9de8154330474"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/norkunas/youtube-dl-php/zipball/173d5e4528cf55dcb6027869f5b9de8154330474",
+ "reference": "173d5e4528cf55dcb6027869f5b9de8154330474",
+ "shasum": ""
+ },
+ "require": {
+ "ext-json": "*",
+ "php": ">=7.4.0",
+ "symfony/filesystem": "^4.4|^5.1|^6.0",
+ "symfony/polyfill-php80": "^1.26",
+ "symfony/process": "^4.4|^5.1|^6.0"
+ },
+ "require-dev": {
+ "mikey179/vfsstream": "^1.6.10",
+ "php-cs-fixer/shim": "^3.9",
+ "phpstan/phpstan": "^1.8",
+ "phpstan/phpstan-phpunit": "^1.1",
+ "symfony/phpunit-bridge": "^6.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "YoutubeDl\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Tomas Norkūnas",
+ "email": "norkunas.tom@gmail.com"
+ }
+ ],
+ "description": "youtube-dl / yt-dlp wrapper for php",
+ "keywords": [
+ "youtube",
+ "youtube-dl",
+ "yt-dlp"
+ ],
+ "support": {
+ "issues": "https://github.com/norkunas/youtube-dl-php/issues",
+ "source": "https://github.com/norkunas/youtube-dl-php/tree/v2.2.1"
+ },
+ "time": "2023-04-21T03:50:15+00:00"
+ },
{
"name": "nothingworks/blade-svg",
"version": "0.5.1",
],
"time": "2023-03-01T10:32:47+00:00"
},
+ {
+ "name": "symfony/filesystem",
+ "version": "v6.2.10",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/fd588debf7d1bc16a2c84b4b3b71145d9946b894",
+ "reference": "fd588debf7d1bc16a2c84b4b3b71145d9946b894",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.1",
+ "symfony/polyfill-ctype": "~1.8",
+ "symfony/polyfill-mbstring": "~1.8"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Provides basic utilities for the filesystem",
+ "homepage": "https://symfony.com",
+ "support": {
+ "source": "https://github.com/symfony/filesystem/tree/v6.2.10"
+ },
+ "funding": [
+ {
+ "url": "https://symfony.com/sponsor",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/fabpot",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-04-18T13:46:08+00:00"
+ },
{
"name": "symfony/finder",
"version": "v5.4.21",