Merge branch 'release/2.2.0'

This commit is contained in:
Pierre Rudloff 2020-03-21 20:59:34 +01:00
commit bb21129b58
14 changed files with 318 additions and 80 deletions

View File

@ -181,7 +181,7 @@ We also provide a JSON API that you can use like this:
[/json?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ](https://alltubedownload.net/json?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ)
It returns a JSON object generated by youtube-dl.
You can find a list of all the properties [in the youtube-dl documentation](https://github.com/rg3/youtube-dl#output-template).
You can find a list of all the properties [in the youtube-dl documentation](https://github.com/ytdl-org/youtube-dl#output-template).
## FAQ

View File

@ -27,7 +27,7 @@ class Config
*
* @var string
*/
public $youtubedl = 'vendor/rg3/youtube-dl/youtube_dl/__main__.py';
public $youtubedl = 'vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py';
/**
* python binary path.
@ -240,7 +240,7 @@ class Config
{
foreach (get_object_vars($this) as $prop => $value) {
$convert = new Convert($prop);
$env = getenv($convert->toSnake(true));
$env = getenv($convert->toMacro());
if ($env) {
$this->$prop = Yaml::parse($env);
}

View File

@ -21,7 +21,7 @@ class LocaleManager
*
* @var array
*/
private $supportedLocales = ['en_US', 'fr_FR', 'zh_CN', 'es_ES', 'pt_BR', 'de_DE', 'ar', 'pl_PL'];
private $supportedLocales = ['en_US', 'fr_FR', 'zh_CN', 'es_ES', 'pt_BR', 'de_DE', 'ar', 'pl_PL', 'tr_TR'];
/**
* Current locale.

View File

@ -86,6 +86,8 @@ class Video
*
* @param string $webpageUrl URL of the page containing the video
* @param string $requestedFormat Requested video format
* (can be any format string accepted by youtube-dl,
* including selectors like "[height<=720]")
* @param string $password Password
*/
public function __construct($webpageUrl, $requestedFormat = 'best', $password = null)

View File

@ -8,7 +8,7 @@
"aura/session": "~2.1.0",
"barracudanetworks/archivestream-php": "~1.0.5",
"guzzlehttp/guzzle": "~6.3.0",
"jawira/case-converter": "^1.2",
"jawira/case-converter": "^3.4",
"mathmarques/smarty-view": "~1.1.0",
"npm-asset/open-sans-fontface": "^1.4",
"rinvex/countries": "~3.1.0",
@ -27,12 +27,12 @@
"phpro/grumphp": "^0.17.0",
"phpstan/phpstan": "~0.9.2",
"phpunit/phpunit": "^8.4",
"rg3/youtube-dl": "^2019.09",
"roave/security-advisories": "dev-master",
"smarty-gettext/smarty-gettext": "^1.6",
"squizlabs/php_codesniffer": "^3.5",
"symfony/debug": "^4.0",
"symfony/var-dumper": "^4.0"
"symfony/var-dumper": "^4.0",
"ytdl-org/youtube-dl": "^2020.02"
},
"extra": {
"paas": {
@ -49,11 +49,11 @@
{
"type": "package",
"package": {
"name": "rg3/youtube-dl",
"version": "2019.09.28",
"name": "ytdl-org/youtube-dl",
"version": "2020.02.16",
"dist": {
"type": "zip",
"url": "https://github.com/rg3/youtube-dl/archive/2019.09.28.zip"
"url": "https://github.com/ytdl-org/youtube-dl/archive/2020.02.16.zip"
}
}
},
@ -104,7 +104,7 @@
"tsmarty2c.php templates > i18n/template.pot",
"xgettext --omit-header -kt -j -o i18n/template.pot classes/*.php classes/*/*.php controllers/*"
],
"youtube-dl": "vendor/rg3/youtube-dl/youtube_dl/__main__.py"
"youtube-dl": "vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py"
},
"config": {
"sort-packages": true,

56
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3d5ee035d64c39c270806f30282e60c8",
"content-hash": "bcc40aec18060593e21a8157b07c4f55",
"packages": [
{
"name": "aura/session",
@ -329,24 +329,25 @@
},
{
"name": "jawira/case-converter",
"version": "v1.2.0",
"version": "v3.4.1",
"source": {
"type": "git",
"url": "https://github.com/jawira/case-converter.git",
"reference": "79716629a298e44507a8eed9b997968f39367abc"
"reference": "756089a523ce268fb173a9f4af4ca95629b3a7f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jawira/case-converter/zipball/79716629a298e44507a8eed9b997968f39367abc",
"reference": "79716629a298e44507a8eed9b997968f39367abc",
"url": "https://api.github.com/repos/jawira/case-converter/zipball/756089a523ce268fb173a9f4af4ca95629b3a7f0",
"reference": "756089a523ce268fb173a9f4af4ca95629b3a7f0",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"php": ">=5.4"
"php": "^7.1"
},
"suggest": {
"pds/skeleton": "PHP Package Development Standards"
"pds/skeleton": "PHP Package Development Standards",
"phing/phing": "PHP Build Tool"
},
"type": "library",
"autoload": {
@ -360,16 +361,29 @@
],
"authors": [
{
"name": "Jawira Portugal"
"name": "Jawira Portugal",
"email": "dev@tugal.be",
"homepage": "http://jawira.com/"
}
],
"description": "Convert string between **Camel Case** ?, **Snake Case** ?and **Kebab Case** ?.",
"description": "Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.",
"homepage": "https://jawira.github.io/case-converter/",
"keywords": [
"Ada case",
"Cobol case",
"Macro case",
"Train case",
"camel case",
"dot notation",
"kebab case",
"snake case"
"lower case",
"pascal case",
"sentence case",
"snake case",
"title case",
"upper case"
],
"time": "2019-03-18T05:59:08+00:00"
"time": "2019-12-15T14:31:43+00:00"
},
{
"name": "mathmarques/smarty-view",
@ -472,7 +486,7 @@
"version": "1.4.2",
"source": {
"type": "git",
"url": "https://github.com/FontFaceKit/open-sans.git",
"url": "git@github.com:FontFaceKit/open-sans.git",
"reference": "2285c0300e6a4c8b102b98fb030fb38c26aa081c"
},
"dist": {
@ -4128,15 +4142,6 @@
],
"time": "2018-11-20T15:27:04+00:00"
},
{
"name": "rg3/youtube-dl",
"version": "2019.09.28",
"dist": {
"type": "zip",
"url": "https://github.com/rg3/youtube-dl/archive/2019.09.28.zip"
},
"type": "library"
},
{
"name": "roave/security-advisories",
"version": "dev-master",
@ -6009,6 +6014,15 @@
"validate"
],
"time": "2019-11-24T13:36:37+00:00"
},
{
"name": "ytdl-org/youtube-dl",
"version": "2020.02.16",
"dist": {
"type": "zip",
"url": "https://github.com/ytdl-org/youtube-dl/archive/2020.02.16.zip"
},
"type": "library"
}
],
"aliases": [],

View File

@ -1,6 +1,6 @@
---
# Path to your youtube-dl binary
youtubedl: vendor/rg3/youtube-dl/youtube_dl/__main__.py
youtubedl: vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py
# Path to your python binary
python: /usr/bin/python
@ -35,6 +35,7 @@ phantomjsDir: vendor/bin/
uglyUrls: false
# True to stream videos through server
# Set to "ask" if you want to allow it but not enable by default.
stream: false
# True to enable remux mode (merge best audio and best video)

View File

@ -17,7 +17,7 @@ use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Views\Smarty;
use Symfony\Component\Debug\ExceptionHandler;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\Debug\Exception\FlattenException;
/**
* Main controller.
@ -233,62 +233,40 @@ class FrontController extends BaseController
*
* @param Request $request PSR-7 request
* @param Response $response PSR-7 response
* @param Exception $exception Error to display
* @param Throwable $error Error to display
*
* @return Response HTTP response
*/
public function error(Request $request, Response $response, Exception $exception)
public function error(Request $request, Response $response, Throwable $error)
{
if ($this->config->debug) {
$exception = FlattenException::createFromThrowable($error);
$handler = new ExceptionHandler();
$handler->handle($exception);
$response->getBody()->write($handler->getHtml($exception));
return $response->withStatus($exception->getStatusCode());
} else {
if ($error instanceof Exception) {
$message = $error->getMessage();
} else {
$message = '';
}
$this->view->render(
$response,
'error.tpl',
[
'config' => $this->config,
'errors' => $exception->getMessage(),
'error' => $message,
'class' => 'video',
'title' => $this->localeManager->t('Error'),
'canonical' => $this->getCanonicalUrl($request),
'locale' => $this->localeManager->getLocale(),
]
);
return $response->withStatus(500);
}
return $response->withStatus(500);
}
/**
* Display an error page for fatal errors.
*
* @param Request $request PSR-7 request
* @param Response $response PSR-7 response
* @param Throwable $error Error to display
*
* @return Response HTTP response
*/
public function fatalError(Request $request, Response $response, Throwable $error)
{
if ($this->config->debug) {
$handler = new ExceptionHandler();
$handler->handle(new FatalThrowableError($error));
} else {
$this->view->render(
$response,
'error.tpl',
[
'config' => $this->config,
'class' => 'video',
'title' => $this->localeManager->t('Error'),
'canonical' => $this->getCanonicalUrl($request),
'locale' => $this->localeManager->getLocale(),
]
);
}
return $response->withStatus(500);
}
/**

View File

@ -5,6 +5,7 @@ parameters:
jsonlint: ~
xmllint: ~
yamllint: ~
composer: ~
phpcs:
standard: PSR12
ignore_patterns:

View File

@ -0,0 +1,247 @@
msgid ""
msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: POEditor.com\n"
"Project-Id-Version: Alltube\n"
"Language: tr\n"
#: templates/playlist.tpl:13
msgid "Videos extracted from @title:"
msgstr "@title`dan çıkarılan videolar."
#: templates/playlist.tpl:38 templates/password.tpl:11 templates/index.tpl:19
#: templates/info.tpl:98
msgid "Download"
msgstr "İndir"
#: templates/playlist.tpl:39
msgid "More options"
msgstr "Daha fazla seçenek"
#: templates/inc/header.tpl:4
msgid "Switch language"
msgstr "Dil Değiştir"
#: templates/inc/header.tpl:8
msgid "Set language"
msgstr "Dil Ayarla"
#: templates/inc/footer.tpl:8
msgid "Code by @dev"
msgstr "Kodlama "
#: templates/inc/footer.tpl:16
msgid "Design by @designer"
msgstr "Tasarım "
#: templates/inc/footer.tpl:21
msgid "Get the code"
msgstr "Kodu edin"
#: templates/inc/footer.tpl:29
msgid "Based on @youtubedl"
msgstr "Altyapı "
#: templates/inc/footer.tpl:33
msgid "Donate using Liberapay"
msgstr "Liberapay kullanarak bağış yapın"
#: templates/inc/footer.tpl:35
msgid "Donate"
msgstr "Bağış"
#: templates/password.tpl:5
msgid "This video is protected"
msgstr "Bu video parola korumalı"
#: templates/password.tpl:6
msgid "You need a password in order to download this video."
msgstr "Bu videoyu indirmek için bir parolaya ihtiyacınız var."
#: templates/password.tpl:8
msgid "Video password"
msgstr "Video parolası"
#: templates/index.tpl:8
msgid "Copy here the URL of your video (Youtube, Dailymotion, etc.)"
msgstr "Videonuzun URL'sini buraya kopyalayın (Youtube, Dailymotion, vb.)"
#: templates/index.tpl:25
msgid "Audio only (MP3)"
msgstr "Sadece ses (MP3)"
#: templates/index.tpl:28
msgid "From"
msgstr "Başlangıç"
#: templates/index.tpl:29
msgid "to"
msgstr "Bitiş"
#: templates/index.tpl:36
msgid "See all supported websites"
msgstr "Desteklenen tüm web sitelerini görün"
#: templates/index.tpl:38
msgid "Drag this to your bookmarks bar:"
msgstr "Bunu yer işaretleri çubuğunuza sürükleyin:"
#: templates/index.tpl:39
msgid "Bookmarklet"
msgstr "Bookmarklet"
#: templates/info.tpl:13
msgid "You are going to download @title."
msgstr "@title İndirilecek."
#: templates/info.tpl:31
msgid "Available formats:"
msgstr "Kullanılabilir dosya biçimleri:"
#: templates/info.tpl:33
msgid "Generic formats"
msgstr "Genel biçimler"
#: templates/info.tpl:38
msgid "Detailed formats"
msgstr "Ayrıntılı biçimler"
#: templates/info.tpl:80
msgid "Stream the video through the server"
msgstr "Videoyu sunucu üzerinden aktarın"
#: templates/info.tpl:85
msgid "Convert into a custom format:"
msgstr "Özel bir biçime dönüştürün:"
#: templates/info.tpl:86
msgid "Custom format"
msgstr "Özel biçim"
#: templates/info.tpl:86
msgid "Format to convert to"
msgstr "Dönüştürülecek biçim"
#: templates/info.tpl:91
msgid "with"
msgstr "ile"
#: templates/info.tpl:92
msgid "Bit rate"
msgstr "Bit hızı"
#: templates/info.tpl:93
msgid "Custom bitrate"
msgstr "Özel bit hızı"
#: templates/info.tpl:95
msgid "kbit/s audio"
msgstr "kbit/s ses"
#: templates/error.tpl:5
msgid "An error occurred"
msgstr "Bir hata oluştu"
#: templates/error.tpl:6
msgid "Please check the URL of your video."
msgstr "Lütfen videonuzun URL'sini kontrol edin."
#: templates/extractors.tpl:4 controllers/FrontController.php:109
msgid "Supported websites"
msgstr "Desteklenen web siteleri"
#: classes/Config.php:158
msgid "Best"
msgstr "En İyi"
#: classes/Config.php:159
msgid "Remux best video with best audio"
msgstr "En kaliteli görüntüyü en kalitesli sesle birleştirin"
#: classes/Config.php:160
msgid "Worst"
msgstr "En Kötü"
#: classes/Video.php:159
msgid "Wrong password"
msgstr "Hatalı parola"
#: classes/Video.php:250
msgid "youtube-dl returned an empty URL."
msgstr "youtube-dl boş bir URL döndürdü."
#: classes/Video.php:361 classes/Video.php:465
msgid "Can't find avconv or ffmpeg at @path."
msgstr "@path yolunda avconv veya ffmpeg bulunamıyor."
#: classes/Video.php:377
msgid "Invalid start time: @from."
msgstr "Hatalı başlangıç zamanı: @from."
#: classes/Video.php:384
msgid "Invalid end time: @to."
msgstr "Hatalı bitiş zamanı: @to."
#: classes/Video.php:430
msgid "Conversion of playlists is not supported."
msgstr "Oynatma listelerinin dönüştürülmesi desteklenmiyor."
#: classes/Video.php:435 classes/Video.php:578
msgid "Conversion of M3U8 files is not supported."
msgstr "M3U8 dosyaların dönüştürülmesi desteklenmiyor."
#: classes/Video.php:437
msgid "Conversion of DASH segments is not supported."
msgstr "DASH segmentleri desteklenmiyor."
#: classes/Video.php:446 classes/Video.php:488 classes/Video.php:525
#: classes/Video.php:558 classes/Video.php:586
msgid "Could not open popen stream."
msgstr "Popen akışıılamadı."
#: classes/Video.php:506
msgid "This video does not have two URLs."
msgstr "Bu videonun iki URL'si yok."
#: controllers/DownloadController.php:215
msgid "You need to enable remux mode to merge two formats."
msgstr "İki biçimi birleştirmek için remux modunu etkinleştirmeniz gerekir."
#: controllers/DownloadController.php:255
msgid "Can't find URL of video."
msgstr "Video URL'si bulunamadı."
#: controllers/FrontController.php:64
msgid "Easily download videos from Youtube, Dailymotion, Vimeo and other websites."
msgstr "Youtube, Dailymotion, Vimeo ve diğer web sitelerinden videoları kolayca indirin."
#: controllers/FrontController.php:110
msgid "List of all supported websites from which Alltube Download can extract video or audio files"
msgstr "Alltube Download'un video veya ses dosyalarını indirebileceğiniz, desteklenen tüm web sitelerinin listesi"
#: controllers/FrontController.php:136
msgid "Password prompt"
msgstr "Parola istemi"
#: controllers/FrontController.php:138
msgid "You need a password in order to download this video with Alltube Download"
msgstr "Bu videoyu Alltube Download ile indirmek için bir parolaya ihtiyacınız var"
#: controllers/FrontController.php:169
msgid "Video download"
msgstr "Video indirme"
#: controllers/FrontController.php:171
msgid "Download video from @extractor"
msgstr "@extractor kaynağından video indiriliyor"
#: controllers/FrontController.php:177
msgid "Download @title from @extractor"
msgstr "@extractor kaynağından @title indiriliyor."
#: controllers/FrontController.php:253 controllers/FrontController.php:284
msgid "Error"
msgstr "Hata"

View File

@ -56,7 +56,7 @@ $downloadController = new DownloadController($container);
// Error handling.
$container['errorHandler'] = [$frontController, 'error'];
$container['phpErrorHandler'] = [$frontController, 'fatalError'];
$container['phpErrorHandler'] = [$frontController, 'error'];
// Routes.
$app->get(

View File

@ -4,11 +4,6 @@
{include file="inc/logo.tpl"}
<h2>{t}An error occurred{/t}</h2>
{t}Please check the URL of your video.{/t}
<p><i>
{foreach $errors as $error}
{$error|escape}
<br/>
{/foreach}
</i></p>
<p><i>{$error|escape}</i></p>
</main>
{include file='inc/footer.tpl'}

View File

@ -23,7 +23,7 @@
&middot;
{$youtubedl="<a href='http://rg3.github.io/youtube-dl/'>
{$youtubedl="<a href='http://ytdl-org.github.io/youtube-dl/'>
youtube-dl
</a>"}
{t params=['@youtubedl'=>$youtubedl]}Based on @youtubedl{/t}

View File

@ -74,7 +74,7 @@
</select><br/><br/>
{/if}
{if $config->stream}
<input type="checkbox" checked name="stream" id="stream"/>
<input type="checkbox" {if $config->stream != 'ask'}checked{/if} name="stream" id="stream"/>
<label for="stream">{t}Stream the video through the server{/t}</label>
<br/><br/>
{/if}