├── README.md
├── helper.php
├── index.php
├── screenshot
├── 1.png
└── 2.png
└── storyboard.php
/README.md:
--------------------------------------------------------------------------------
1 | # youtube-downloader
2 |
3 | run with PHP
4 |
5 | `
6 | copy code to your directory
7 | `
8 |
9 | open url
10 | `
11 | http://YOUR_URL/PATH/TO/FILE/index.php?v=YOUTUBE_ID
12 | `
13 |
14 | ## How to merge Video and Audio with VLC
15 | 1. file > advanced open file
16 | 2. select tab file
17 | 3. browse video file
18 | 4. checked Play another media synchronously and browse audio file
19 | 5. checked Streamimg/Saving and click setting...
20 | 6. browse file for save output
21 | 7. select mpeg 4
22 | 8. click OK
23 | 9. click open and wait
24 |
25 | 
26 | 
27 |
--------------------------------------------------------------------------------
/helper.php:
--------------------------------------------------------------------------------
1 | $v) {
23 | if (gettype($v) == 'array') {
24 | foreach ($v as $_v) {
25 | $result[$f][] = convertData($_v);
26 | }
27 | } else if (strpos($v, '&') !== false) {
28 | $result[$f] = convertData($v);
29 | } else if (substr($v, 0, 1) == '[' || substr($v, 0, 1) == '{') {
30 | $t = json_decode($v, true);
31 | if (json_last_error() === JSON_ERROR_NONE) {
32 | $result[$f] = json_decode($v, true);
33 | }
34 | } else {
35 | $result[$f] = $v;
36 | }
37 |
38 | }
39 | return $result;
40 | }
41 |
42 | $tmp = convertData($data);
43 | var_dump($tmp);
44 | ?>
45 |
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 | '.$arr['title'].'';
31 | echo '
';
32 | echo 'views: '.number_format($arr['view_count']).' channel: '.$arr['author'].'
';
33 |
34 | if (isset($arr['storyboard_spec'])) {
35 | list($story_url, $l0, $l1, $l2) = explode('|', $arr['storyboard_spec']);
36 | list($p1, $p2, $per_pic, $p4, $p5, $p6, $p7, $sigh) = explode('#', $l2);
37 | $qty = ceil($arr['length_seconds']/$per_pic)+2;
38 | echo 'story board
';
39 | }
40 |
41 | if (isset($arr['dashmpd'])) {
42 |
43 | $dashmpd = @file_get_contents($arr['dashmpd']);
44 |
45 | if ($dashmpd) {
46 | $xml = new SimpleXMLElement($dashmpd);
47 | $json = json_decode( json_encode($xml), true);
48 | foreach ($json['Period']['AdaptationSet'] as $row) {
49 | echo '