403Webshell
Server IP : 5.129.245.98  /  Your IP : 216.73.216.246
Web Server : Apache/2.4.66 (Debian)
System : Linux 1b8c17c336b9 6.8.0-111-generic #111-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 11 23:16:02 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/content-egg/application/modules/Youtube/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/content-egg/application/modules/Youtube/YoutubeModule.php
<?php

namespace ContentEgg\application\modules\Youtube;

defined('\ABSPATH') || exit;

use ContentEgg\application\components\ParserModule;
use ContentEgg\application\libs\google\YouTubeSearch;
use ContentEgg\application\components\Content;
use ContentEgg\application\helpers\TextHelper;
use ContentEgg\application\admin\PluginAdmin;
use ContentEgg\application\admin\GeneralConfig;

/**
 * YoutubeModule class file
 *
 * @author keywordrush.com <support@keywordrush.com>
 * @link https://www.keywordrush.com
 * @copyright Copyright &copy; 2025 keywordrush.com
 */
class YoutubeModule extends ParserModule
{

	public function info()
	{
		return array(
			'name'          => 'Youtube',
			'api_agreement' => 'http://code.google.com/apis/youtube/terms.html',
			'docs_uri'      => 'https://ce-docs.keywordrush.com/modules/content/youtube',
		);
	}

	public function getParserType()
	{
		return self::PARSER_TYPE_VIDEO;
	}

	public function isFree()
	{
		return true;
	}

	public function doRequest($keyword, $query_params = array(), $is_autoupdate = false)
	{
		$params = array();

		if ($is_autoupdate)
			$params['maxResults'] = $this->config('entries_per_page_update');
		else
			$params['maxResults'] = $this->config('entries_per_page');

		if (!empty($query_params['relevanceLanguage']))
			$params['relevanceLanguage'] = $query_params['relevanceLanguage'];
		else
		{
			$lang = GeneralConfig::getInstance()->option('lang');
			$parts = explode('_', $lang);
			$l = reset($parts);
			if ($l == 'br')
				$l = 'pt';
			$params['relevanceLanguage'] = $l;
		}

		$params['key'] = $this->config('api_key');

		if (!empty($query_params['order']))
			$params['order'] = $query_params['order'];
		else
			$params['order'] = $this->config('order');

		if (!empty($query_params['license']))
			$params['videoLicense'] = $query_params['license'];
		else
			$params['videoLicense'] = $this->config('license');

		try
		{
			$client = new YouTubeSearch('json');
			$data   = $client->search($keyword, $params);
		}
		catch (\Exception $e)
		{
			throw new \Exception(esc_html(wp_strip_all_tags($e->getMessage())));
		}

		if (!isset($data['items']) || !isset($data['items'][0]))
			$data['items'] = array();

		$data['items'] = array_slice($data['items'], 0, $params['maxResults']);

		$results = array();
		foreach ($data['items'] as $r)
		{
			if (!isset($r['id']['videoId']))
				continue;

			$guid = $r['id']['videoId'];

			$content            = new Content;
			$content->unique_id = $guid;
			$content->title     = strip_tags($r['snippet']['title']);
			$content->domain    = 'youtube.com';
			$content->img       = isset($r['snippet']['thumbnails']) ? $r['snippet']['thumbnails']['high']['url'] : '';

			if (isset($r['snippet']['description']) && !is_array($r['snippet']['description']))
			{
				$content->description = strip_tags($r['snippet']['description']);
				if ($max_size = $this->config('description_size'))
					$content->description = TextHelper::truncate($content->description, $max_size);
			}
			else
				$content->description = '';

			$content->url = 'https://www.youtube.com/watch?v=' . $r['id']['videoId'];

			$extra                = new ExtraDataYoutube;
			$extra->author        = strip_tags($r['snippet']['channelTitle']);
			$extra->date          = strtotime($r['snippet']['publishedAt']);
			$extra->guid          = $guid;
			$extra->category      = isset($r['snippet']['category'][1]) ? $r['snippet']['category'][1] : '';
			$extra->channel_title = isset($r['snippet']['channelTitle']) ? $r['snippet']['channelTitle'] : '';

			$content->extra = $extra;
			$results[]      = $content;
		}

		return $results;
	}

	public function enqueueScripts()
	{
		\wp_enqueue_script('cegg-youtube', \plugins_url('application/modules/Youtube/js/module.js', \ContentEgg\PLUGIN_FILE), array('contentegg-metabox-app'), null, false);
	}

	public function renderResults()
	{
		PluginAdmin::render('_metabox_results', array('module_id' => $this->getId()));
	}

	public function renderSearchResults()
	{
		$this->render('search_results', array('module_id' => $this->getId()));
	}

	public function renderSearchPanel()
	{
		$this->render('search_panel', array('module_id' => $this->getId()));
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit