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

Commit

Permalink
Merge branch 'release-0.7.2-beta2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudloff committed Apr 2, 2017
2 parents c8e8cac + f33ea5e commit 8c58c37
Show file tree
Hide file tree
Showing 20 changed files with 1,145 additions and 251 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ install:
- composer install
before_install:
- npm install -g npm@3
script: vendor/bin/phpunit
after_success:
- bash <(curl -s https://codecov.io/bash)
before_deploy:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ RUN apt-get install -y libicu-dev xz-utils git zlib1g-dev python nodejs
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install intl
RUN docker-php-ext-install zip
RUN npm install -g bower grunt-cli
RUN a2enmod rewrite
RUN curl -sS https://getcomposer.org/installer | php
COPY php.ini /usr/local/etc/php/
COPY . /var/www/html/
RUN php composer.phar install --prefer-dist
RUN npm install
RUN bower --allow-root install
RUN grunt
RUN ./node_modules/.bin/bower --allow-root install
RUN ./node_modules/.bin/grunt
ENV CONVERT=1
76 changes: 67 additions & 9 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ You can ususally download the video by doing *File > Save to* or *ctrl + S*.
You need to create a YAML file called `config.yml` at the root of your project.
Here are the parameters that you can set:

* youtubedl: path to your youtube-dl binary
* python: path to your python binary
* params: an array of parameters to pass to youtube-dl
* curl_params: an array of parameters to pass to curl
* convert: true to enable audio conversion
* avconv: path to your avconv or ffmpeg binary
* rtmpdump: path to your rtmpdump binary
* `youtubedl`: path to your youtube-dl binary
* `python`: path to your python binary
* `params`: an array of parameters to pass to youtube-dl
* `curl_params`: an array of parameters to pass to curl
* `convert`: true to enable audio conversion
* `avconv`: path to your avconv or ffmpeg binary
* `rtmpdump`: path to your rtmpdump binary

See [config.example.yml](config.example.yml) for default values.
See [`config.example.yml`](config.example.yml) for default values.

## How do I enable audio conversion?

Expand Down Expand Up @@ -61,7 +61,7 @@ Some websites generate an unique video URL for each IP address. When using Alltu
There are two known workarounds:

* You can run Alltube locally on your computer.
* You can use the experimental `feature/stream` branch which streams the video through the server in order to bypass IP restrictions.
* You can enable streaming videos through the server (see below).
Please note that this can use a lot of resources on the server (which is why we won't enable it on alltubedownload.net).

## CSS and JavaScript files are missing
Expand All @@ -71,3 +71,61 @@ You need to either:

* Use a [release package](https://github.com/Rudloff/alltube/releases)
* Run `npm install` (see detailed instructions in the [README](README.md#from-git))

## I get a 404 error on every page except the index

This is probably because your server does not have mod_rewrite or AllowOverride is disabled.
You can work around this by adding this to your `config.yml` file:

```yaml
uglyUrls: true
```

## How do I enable streaming videos through the server?

You need to add this to your `config.yml` file:

```yaml
stream: true
```

Note that this can use a lot of ressources on your server.

## I want to download M3U videos

You need to enable streaming (see above).

## The downloaded videos have a strange name like `videoplayback.mp4`

Alltube can rename videos automatically if you enable streaming (see above).

## I want to download a video that isn't available in my country

If the video is available in the server's country, you can download it if you enable streaming (see above).

## How do I run the Docker image?

```bash
docker run -p 8080:80 rudloff/alltube
```

## How do I run Heroku locally?

You should be able to use `heroku local` like this:

```bash
sudo APACHE_LOCK_DIR=. APACHE_PID_FILE=./pid APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data APACHE_LOG_DIR=. heroku local
```

You might need to create some symlinks before that:

```bash
ln -s /usr/sbin/apache2 /usr/sbin/httpd
ln -s /usr/sbin/php-fpm7.0 /usr/sbin/php-fpm
```

And you probably need to run this in another terminal after `heroku local` has finished launching `php-fpm`:

```bash
chmod 0667 /tmp/heroku.fcgi.5000.sock
```
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ chmod 777 templates_c/

If your web server is Apache, you need to set the `AllowOverride` setting to `All` or `FileInfo`.

#### Update

When updating from Git, you need to run npm and Composer again:

```bash
git pull
npm install
composer install
```

## Config

If you want to use a custom config, you need to create a config file:
Expand Down
9 changes: 8 additions & 1 deletion classes/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Config
*
* @var array
*/
public $params = ['--no-playlist', '--no-warnings', '-f best[protocol^=http]', '--playlist-end', 1];
public $params = ['--no-playlist', '--no-warnings', '--playlist-end', 1];

/**
* Enable audio conversion.
Expand Down Expand Up @@ -82,6 +82,13 @@ class Config
*/
public $uglyUrls = false;

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

/**
* YAML config file path.
*
Expand Down
29 changes: 29 additions & 0 deletions classes/VideoDownload.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,33 @@ public function getAudioStream($url, $format, $password = null)

return popen($chain->getProcess()->getCommandLine(), 'r');
}

/**
* Get video stream from an M3U playlist.
*
* @param \stdClass $video Video object returned by getJSON
*
* @return resource popen stream
*/
public function getM3uStream(\stdClass $video)
{
if (!shell_exec('which '.$this->config->avconv)) {
throw(new \Exception('Can\'t find avconv or ffmpeg'));
}

$procBuilder = ProcessBuilder::create(
[
$this->config->avconv,
'-v', 'quiet',
'-i', $video->url,
'-f', $video->ext,
'-c', 'copy',
'-bsf:a', 'aac_adtstoasc',
'-movflags', 'frag_keyframe+empty_moov',
'pipe:1',
]
);

return popen($procBuilder->getProcess()->getCommandLine(), 'r');
}
}
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
"symfony/process": "~3.2.0",
"ptachoire/process-builder-chain": "~1.2.0",
"rudloff/smarty-plugin-noscheme": "~0.1.0",
"guzzlehttp/guzzle": "~6.2.0",
"rudloff/rtmpdump-bin": "~2.3",
"aura/session": "~2.1.0"
},
"require-dev": {
"symfony/var-dumper": "~3.2.0",
"squizlabs/php_codesniffer": "~2.7.0",
"phpunit/phpunit": "~5.7.2",
"ffmpeg/ffmpeg": "dev-release",
"rg3/youtube-dl": "~2017.01.10",
"rg3/youtube-dl": "~2017.03.07",
"rudloff/rtmpdump-bin": "~2.3",
"heroku/heroku-buildpack-php": "*"
},
Expand All @@ -35,10 +37,10 @@
"type": "package",
"package": {
"name": "rg3/youtube-dl",
"version": "2017.01.10",
"version": "2017.03.07",
"dist": {
"type": "zip",
"url": "https://github.com/rg3/youtube-dl/archive/2017.01.10.zip"
"url": "https://github.com/rg3/youtube-dl/archive/2017.03.07.zip"
}
}
},
Expand All @@ -48,7 +50,7 @@
"name": "ffmpeg/ffmpeg",
"version": "dev-release",
"dist": {
"url": "http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz",
"url": "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz",
"type": "xz"
},
"bin": [
Expand Down Expand Up @@ -77,9 +79,6 @@
"Alltube\\Controller\\": "controllers/"
}
},
"config": {
"secure-http": false
},
"scripts": {
"compile": "composer install --dev"
}
Expand Down
Loading

0 comments on commit 8c58c37

Please sign in to comment.