Document exceptions in VideoDownload

This commit is contained in:
Pierre Rudloff 2017-12-19 15:20:52 +01:00
parent cdc4c00344
commit 17df0b63cb

View file

@ -29,6 +29,9 @@ class VideoDownload
/** /**
* VideoDownload constructor. * VideoDownload constructor.
*
* @throws \Exception If youtube-dl is missing
* @throws \Exception If Python is missing
*/ */
public function __construct(Config $config = null) public function __construct(Config $config = null)
{ {
@ -69,6 +72,10 @@ class VideoDownload
* @param string $prop Property * @param string $prop Property
* @param string $password Video password * @param string $password Video password
* *
* @throws PasswordException If the video is protected by a password and no password was specified
* @throws \Exception If the password is wrong
* @throws \Exception If youtube-dl returns an error
*
* @return string * @return string
*/ */
private function getProp($url, $format = null, $prop = 'dump-json', $password = null) private function getProp($url, $format = null, $prop = 'dump-json', $password = null)
@ -220,6 +227,8 @@ class VideoDownload
* *
* @param object $video Video object returned by youtube-dl * @param object $video Video object returned by youtube-dl
* *
* @throws \Exception If rtmpdump is missing
*
* @return \Symfony\Component\Process\Process Process * @return \Symfony\Component\Process\Process Process
*/ */
private function getRtmpProcess(\stdClass $video) private function getRtmpProcess(\stdClass $video)
@ -265,6 +274,8 @@ class VideoDownload
* *
* @param string $url URL of the video file * @param string $url URL of the video file
* *
* @throws \Exception If avconv/ffmpeg is missing
*
* @return \Symfony\Component\Process\Process Process * @return \Symfony\Component\Process\Process Process
*/ */
private function getAvconvMp3Process($url) private function getAvconvMp3Process($url)
@ -300,6 +311,9 @@ class VideoDownload
* @param string $format Format to use for the video * @param string $format Format to use for the video
* @param string $password Video password * @param string $password Video password
* *
* @throws \Exception If your try to convert and M3U8 video
* @throws \Exception If the popen stream was not created correctly
*
* @return resource popen stream * @return resource popen stream
*/ */
public function getAudioStream($url, $format, $password = null) public function getAudioStream($url, $format, $password = null)
@ -333,6 +347,9 @@ class VideoDownload
* *
* @param \stdClass $video Video object returned by getJSON * @param \stdClass $video Video object returned by getJSON
* *
* @throws \Exception If avconv/ffmpeg is missing
* @throws \Exception If the popen stream was not created correctly
*
* @return resource popen stream * @return resource popen stream
*/ */
public function getM3uStream(\stdClass $video) public function getM3uStream(\stdClass $video)
@ -367,6 +384,8 @@ class VideoDownload
* *
* @param array $urls URLs of the video ($urls[0]) and audio ($urls[1]) files * @param array $urls URLs of the video ($urls[0]) and audio ($urls[1]) files
* *
* @throws \Exception If the popen stream was not created correctly
*
* @return resource popen stream * @return resource popen stream
*/ */
public function getRemuxStream(array $urls) public function getRemuxStream(array $urls)
@ -398,6 +417,8 @@ class VideoDownload
* *
* @param \stdClass $video Video object returned by getJSON * @param \stdClass $video Video object returned by getJSON
* *
* @throws \Exception If the popen stream was not created correctly
*
* @return resource popen stream * @return resource popen stream
*/ */
public function getRtmpStream(\stdClass $video) public function getRtmpStream(\stdClass $video)
@ -416,6 +437,8 @@ class VideoDownload
* @param object $video Video object returned by youtube-dl * @param object $video Video object returned by youtube-dl
* @param string $format Requested format * @param string $format Requested format
* *
* @throws \Exception If the popen stream was not created correctly
*
* @return resource * @return resource
*/ */
public function getPlaylistArchiveStream(\stdClass $video, $format) public function getPlaylistArchiveStream(\stdClass $video, $format)