1 | <?php |
||
9 | class Factory |
||
10 | { |
||
11 | /** |
||
12 | * @var ProviderInterface |
||
13 | */ |
||
14 | protected $provider; |
||
15 | |||
16 | /** |
||
17 | * @var array Get Default Available Providers. |
||
18 | */ |
||
19 | protected $providers = [ |
||
20 | 'facebook' => Facebook::class, |
||
21 | ]; |
||
22 | |||
23 | /** |
||
24 | * Factory constructor. |
||
25 | * |
||
26 | * @param null $provider |
||
27 | */ |
||
28 | public function __construct($provider = null) |
||
34 | |||
35 | /** |
||
36 | * @param $provider |
||
37 | * |
||
38 | * @throws VideoDownloaderException |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | public function make($provider) |
||
75 | |||
76 | /** |
||
77 | * Gets Video Download Links with Meta Data from the Provider. |
||
78 | * Returns HD & SD Quality Links. |
||
79 | * |
||
80 | * @param $url |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | public function getVideoInfo($url) |
||
88 | |||
89 | /** |
||
90 | * Download remote file from server |
||
91 | * and save it locally using HTTP Client. |
||
92 | * |
||
93 | * @param string $url The URL to Remote File to Download. |
||
94 | * @param string $dstFilename Destination Filename (Accepts File Path too). |
||
95 | * @param bool $isAsyncRequest |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function download($url, $dstFilename, $isAsyncRequest = false) |
||
103 | |||
104 | /** |
||
105 | * @param null $provider |
||
106 | * |
||
107 | * @return ProviderInterface |
||
108 | */ |
||
109 | public function getInstance($provider = null) |
||
117 | |||
118 | /** |
||
119 | * Add Provider to List. |
||
120 | * |
||
121 | * @param ProviderInterface $provider |
||
122 | * |
||
123 | * @return $this |
||
124 | */ |
||
125 | public function setProvider(ProviderInterface $provider) |
||
134 | |||
135 | /** |
||
136 | * Returns Current Provider Instance. |
||
137 | */ |
||
138 | public function getProvider() |
||
142 | } |
||
143 |