Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions MeTube/MeTube.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace App\SupportedApps\MeTube;

class MeTube extends \App\SupportedApps implements \App\EnhancedApps
{
public $config;

//protected $login_first = true; // Uncomment if api requests need to be authed first
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST

public function __construct()
{
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
}

public function test()
{
$test = parent::appTest($this->url('history'));
echo $test->status;
}

public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('history'));
$details = json_decode($res->getBody());

$data['queue_size'] = count($details->queue);
$data['done_size'] = count($details->done);
return parent::getLiveStats($status, $data);
}

public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url) . $endpoint;
return $api_url;
}
}
10 changes: 10 additions & 0 deletions MeTube/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appid": "d1c308982299c5face7a8b9bcf3f585ae08c13fd",
"name": "MeTube",
"website": "https://github.com/alexta69/metube",
"license": "GNU Affero General Public License v3.0",
"description": "MeTube is a self-hosted web GUI for youtube-dl (using the yt-dlp fork) with playlist support. It allows you to download videos from YouTube and dozens of other sites.",
"enhanced": true,
"tile_background": "dark",
"icon": "metube.png"
}
11 changes: 11 additions & 0 deletions MeTube/config.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
<div class="items">
<div class="input">
<label>{{ strtoupper(__('app.url')) }}</label>
{!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
</div>
<div class="input">
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
</div>
</div>

10 changes: 10 additions & 0 deletions MeTube/livestats.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ul class="livestats">
<li>
<span class="title">Queue</span>
<strong>{!! $queue_size !!}</strong>
</li>
<li>
<span class="title">Done</span>
<strong>{!! $done_size !!}</strong>
</li>
</ul>
Binary file added MeTube/metube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.