Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/3.2.0-alpha'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudloff committed Apr 22, 2023
2 parents fcb3d2e + a9da231 commit ec95a8f
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 75 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ jobs:
strategy:
matrix:
php-version:
- '7.3'
- '7.4'
- '8.0'
- '8.1'
steps:
- uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php-version }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM php:7.3-apache
FROM php:7.4-apache
RUN apt-get update
RUN apt-get install -y libicu-dev xz-utils git python libgmp-dev unzip ffmpeg
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install intl
RUN docker-php-ext-install gmp
RUN a2enmod rewrite
Expand All @@ -12,4 +11,5 @@ RUN php composer.phar check-platform-reqs --no-dev
RUN php composer.phar install --prefer-dist --no-progress --no-dev --optimize-autoloader
RUN mkdir /var/www/html/templates_c/
RUN chmod 770 -R /var/www/html/templates_c/
RUN chown www-data -R /var/www/html/templates_c/
ENV CONVERT=1
44 changes: 26 additions & 18 deletions classes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,106 +24,114 @@ class Config
*
* @var string
*/
public $youtubedl = 'vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py';
public string $youtubedl = 'vendor/yt-dlp/yt-dlp/yt_dlp/__main__.py';

/**
* python binary path.
*
* @var string
*/
public $python = '/usr/bin/python';
public string $python = '/usr/bin/python';

/**
* youtube-dl parameters.
*
* @var string[]
*/
public $params = ['--no-warnings', '--ignore-errors', '--flat-playlist', '--restrict-filenames', '--no-playlist'];
public array $params = [
'--no-warnings',
'--ignore-errors',
'--flat-playlist',
'--restrict-filenames',
'--no-playlist',
'--use-extractors',
'default,-generic',
];

/**
* Enable audio conversion.
*
* @var bool
*/
public $convert = false;
public bool $convert = false;

/**
* Enable advanced conversion mode.
*
* @var bool
*/
public $convertAdvanced = false;
public bool $convertAdvanced = false;

/**
* List of formats available in advanced conversion mode.
*
* @var string[]
*/
public $convertAdvancedFormats = ['mp3', 'avi', 'flv', 'wav'];
public array $convertAdvancedFormats = ['mp3', 'avi', 'flv', 'wav'];

/**
* ffmpeg binary path.
*
* @var string
*/
public $ffmpeg = '/usr/bin/ffmpeg';
public string $ffmpeg = '/usr/bin/ffmpeg';

/**
* Path to the directory that contains the phantomjs binary.
*
* @var string
*/
public $phantomjsDir = '/usr/bin/';
public string $phantomjsDir = '/usr/bin/';

/**
* Disable URL rewriting.
*
* @var bool
*/
public $uglyUrls = false;
public bool $uglyUrls = false;

/**
* Stream downloaded files trough server?
*
* @var bool
*/
public $stream = false;
public bool $stream = false;

/**
* Allow to remux video + audio?
*
* @var bool
*/
public $remux = false;
public bool $remux = false;

/**
* MP3 bitrate when converting (in kbit/s).
*
* @var int
*/
public $audioBitrate = 128;
public int $audioBitrate = 128;

/**
* ffmpeg logging level.
* Must be one of these: quiet, panic, fatal, error, warning, info, verbose, debug.
*
* @var string
*/
public $ffmpegVerbosity = 'error';
public string $ffmpegVerbosity = 'error';

/**
* App name.
*
* @var string
*/
public $appName = 'AllTube Download';
public string $appName = 'AllTube Download';

/**
* Generic formats supported by youtube-dl.
*
* @var string[]
*/
public $genericFormats = [
public array $genericFormats = [
'best/bestvideo' => 'Best',
'bestvideo+bestaudio' => 'Remux best video with best audio',
'worst/worstvideo' => 'Worst',
Expand All @@ -134,21 +142,21 @@ class Config
*
* @var bool
*/
public $debug = false;
public bool $debug = false;

/**
* Default to audio.
*
* @var bool
*/
public $defaultAudio = false;
public bool $defaultAudio = false;

/**
* Disable audio conversion from/to seeker.
*
* @var bool
*/
public $convertSeek = true;
public bool $convertSeek = true;

/**
* Config constructor.
Expand Down
6 changes: 3 additions & 3 deletions classes/Controller/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ abstract class BaseController
*
* @var Video
*/
protected $video;
protected Video $video;

/**
* Default youtube-dl format.
*
* @var string
*/
protected $defaultFormat = 'best/bestvideo';
protected string $defaultFormat = 'best/bestvideo';

/**
* Slim dependency container.
*
* @var ContainerInterface
*/
protected $container;
protected ContainerInterface $container;

/**
* Config instance.
Expand Down
2 changes: 1 addition & 1 deletion classes/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function __toString(): string
*/
public function getFullName(): string
{
return PHPLocale::getDisplayName($this->getIso15897(), $this->getIso15897());
return mb_convert_case(PHPLocale::getDisplayName($this->getIso15897(), $this->getIso15897()), MB_CASE_TITLE);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions classes/LocaleManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class LocaleManager
*
* @var Locale|null
*/
private $curLocale;
private ?Locale $curLocale = null;

/**
* Session segment used to store session variables.
*
* @var Segment
*/
private $sessionSegment;
private Segment $sessionSegment;

/**
* Default locale.
Expand All @@ -48,7 +48,7 @@ class LocaleManager
*
* @var Translator
*/
private $translator;
private Translator $translator;

/**
* LocaleManager constructor.
Expand Down
1 change: 1 addition & 0 deletions classes/Robo/Plugin/Commands/ReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function release()
$gitTask = $this->taskExec('git');
$result = $gitTask
->arg('describe')
->interactive(false)
->run();

$tmpDir = $this->_tmpDir();
Expand Down
8 changes: 4 additions & 4 deletions classes/Stream/PlaylistArchiveStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
*
* @var Video[]
*/
private $videos = [];
private array $videos = [];

/**
* Stream used to store data before it is sent to the browser.
Expand All @@ -38,21 +38,21 @@ class PlaylistArchiveStream extends ZipArchive implements StreamInterface
*
* @var StreamInterface
*/
protected $curVideoStream;
protected StreamInterface $curVideoStream;

/**
* True if the archive is complete.
*
* @var bool
*/
private $isComplete = false;
private bool $isComplete = false;

/**
* Downloader object.
*
* @var Downloader
*/
protected $downloader;
protected Downloader $downloader;

/**
* PlaylistArchiveStream constructor.
Expand Down
2 changes: 1 addition & 1 deletion classes/Stream/YoutubeChunkStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class YoutubeChunkStream implements StreamInterface
*
* @var ResponseInterface
*/
private $response;
private ResponseInterface $response;

/**
* YoutubeChunkStream constructor.
Expand Down
20 changes: 8 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=7.4",
"ext-intl": "*",
"ext-json": "*",
"aura/session": "^2.1",
Expand All @@ -31,13 +31,13 @@
"mathmarques/smarty-view": "^1.2",
"oomphinc/composer-installers-extender": "^2.0",
"paragonie/csp-builder": "^2.5",
"rinvex/countries": "^6.1",
"rinvex/countries": "^7.3",
"rudloff/alltube-library": "^0.1.3",
"symfony/finder": "^5.4",
"symfony/translation": "^4.0",
"symfony/yaml": "^4.0",
"webfontkit/open-sans": "^1.0",
"ytdl-org/youtube-dl": "^2021.12",
"yt-dlp/yt-dlp": "^2023.03",
"zonuexe/http-accept-language": "^0.4.1"
},
"require-dev": {
Expand All @@ -62,11 +62,11 @@
{
"type": "package",
"package": {
"name": "ytdl-org/youtube-dl",
"version": "2021.12.17",
"name": "yt-dlp/yt-dlp",
"version": "2023.03.04",
"dist": {
"type": "tar",
"url": "https://yt-dl.org/downloads/2021.12.17/youtube-dl-2021.12.17.tar.gz"
"url": "https://github.com/yt-dlp/yt-dlp/releases/download/2023.03.04/yt-dlp.tar.gz"
}
}
}
Expand All @@ -92,7 +92,7 @@
"phpro/grumphp": true
},
"platform": {
"php": "7.3.11"
"php": "7.4.33"
},
"sort-packages": true
},
Expand All @@ -108,11 +108,7 @@
"installer-types": [
"library"
],
"patches": {
"ytdl-org/youtube-dl": {
"Disable the generic extractor": "patches/youtube-dl-disable-generic.diff"
}
}
"patches": {}
},
"scripts": {
"lint": "grumphp run --ansi",
Expand Down
Loading

0 comments on commit ec95a8f

Please sign in to comment.