Skip to content

Commit 351cfa0

Browse files
scebbersSCE
andauthored
Add MeTube as an enhanced app (#823)
* Added MeTube as an enhanced app * Deleted thumbs.db * Fix linting * Smaller icon png --------- Co-authored-by: SCE <[email protected]>
1 parent aeba429 commit 351cfa0

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

MeTube/MeTube.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace App\SupportedApps\MeTube;
4+
5+
class MeTube extends \App\SupportedApps implements \App\EnhancedApps
6+
{
7+
public $config;
8+
9+
//protected $login_first = true; // Uncomment if api requests need to be authed first
10+
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
11+
12+
public function __construct()
13+
{
14+
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
15+
}
16+
17+
public function test()
18+
{
19+
$test = parent::appTest($this->url('history'));
20+
echo $test->status;
21+
}
22+
23+
public function livestats()
24+
{
25+
$status = 'inactive';
26+
$res = parent::execute($this->url('history'));
27+
$details = json_decode($res->getBody());
28+
29+
$data['queue_size'] = count($details->queue);
30+
$data['done_size'] = count($details->done);
31+
return parent::getLiveStats($status, $data);
32+
}
33+
34+
public function url($endpoint)
35+
{
36+
$api_url = parent::normaliseurl($this->config->url) . $endpoint;
37+
return $api_url;
38+
}
39+
}

MeTube/app.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"appid": "d1c308982299c5face7a8b9bcf3f585ae08c13fd",
3+
"name": "MeTube",
4+
"website": "https://github.com/alexta69/metube",
5+
"license": "GNU Affero General Public License v3.0",
6+
"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.",
7+
"enhanced": true,
8+
"tile_background": "dark",
9+
"icon": "metube.png"
10+
}

MeTube/config.blade.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
2+
<div class="items">
3+
<div class="input">
4+
<label>{{ strtoupper(__('app.url')) }}</label>
5+
{!! Form::text('config[override_url]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
6+
</div>
7+
<div class="input">
8+
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
9+
</div>
10+
</div>
11+

MeTube/livestats.blade.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ul class="livestats">
2+
<li>
3+
<span class="title">Queue</span>
4+
<strong>{!! $queue_size !!}</strong>
5+
</li>
6+
<li>
7+
<span class="title">Done</span>
8+
<strong>{!! $done_size !!}</strong>
9+
</li>
10+
</ul>

MeTube/metube.png

6.02 KB
Loading

0 commit comments

Comments
 (0)