mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Improve autoplay
This commit is contained in:
parent
bb895db49c
commit
f8bbc93392
1 changed files with 92 additions and 97 deletions
27
plugin/DiscordNotify/DiscordNotify.php
Normal file → Executable file
27
plugin/DiscordNotify/DiscordNotify.php
Normal file → Executable file
|
@ -6,34 +6,32 @@ if (!isset($global['systemRootPath'])) {
|
|||
}
|
||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
|
||||
class DiscordNotify extends PluginAbstract
|
||||
{
|
||||
class DiscordNotify extends PluginAbstract {
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
public function getDescription() {
|
||||
return "Send video upload notifications to discord webhook";
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
public function getName() {
|
||||
return "DiscordNotify";
|
||||
}
|
||||
|
||||
public function getUUID()
|
||||
{
|
||||
public function getUUID() {
|
||||
return "cf145581-7d5e-4bb6-8c12-848a19j1564g";
|
||||
}
|
||||
public function getTags()
|
||||
{
|
||||
|
||||
public function getTags() {
|
||||
return array(
|
||||
'free',
|
||||
'notifications',
|
||||
'webhook'
|
||||
);
|
||||
}
|
||||
|
||||
public function getPluginVersion() {
|
||||
return "1.0";
|
||||
}
|
||||
|
||||
public function getEmptyDataObject() {
|
||||
global $global;
|
||||
$server = parse_url($global['webSiteRootURL']);
|
||||
|
@ -45,8 +43,8 @@ class DiscordNotify extends PluginAbstract
|
|||
$obj->footer_image = "";
|
||||
return $obj;
|
||||
}
|
||||
public function afterNewVideo($videos_id)
|
||||
{
|
||||
|
||||
public function afterNewVideo($videos_id) {
|
||||
global $global;
|
||||
$o = $this->getDataObject();
|
||||
$users_id = Video::getOwner($videos_id);
|
||||
|
@ -82,15 +80,12 @@ $hookObject = json_encode([
|
|||
"text" => $bot_username,
|
||||
"icon_url" => $footer_image
|
||||
],
|
||||
|
||||
"image" => [
|
||||
"url" => $videoThumbs,
|
||||
],
|
||||
|
||||
//"thumbnail" => [
|
||||
// "url" => $userThumbnail
|
||||
//],
|
||||
|
||||
"fields" => [
|
||||
[
|
||||
"name" => "Video Name",
|
||||
|
@ -115,7 +110,6 @@ $hookObject = json_encode([
|
|||
]
|
||||
]
|
||||
]
|
||||
|
||||
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
|
||||
$ch = curl_init();
|
||||
|
@ -132,4 +126,5 @@ curl_setopt_array( $ch, [
|
|||
|
||||
return curl_exec($ch);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue