├── .gitignore
├── LICENSE
├── README.md
├── extension
├── background.js
├── icons
│ ├── checkmark.png
│ ├── error.png
│ ├── mpv.png
│ └── timer.png
└── manifest.json
└── native
├── build
├── linux
│ └── Makefile
├── moe.winneon.watchwithmpv.json
└── win
│ ├── install.bat
│ └── uninstall.bat
├── native.js
├── package-lock.json
├── package.json
└── zip.js
/.gitignore:
--------------------------------------------------------------------------------
1 | native/node_modules/
2 | native/dist/
3 |
4 | native/build/**/watch-with-mpv-native-*
5 | native/build/**/moe.winneon.watchwithmpv.json
6 | !native/build/moe.winneon.watchwithmpv.json
7 |
8 | **/*.crx
9 | **/*.pem
10 | **/*.zip
11 | **/*.rs.bk
12 | **/.DS_Store
13 | **/._*
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # watch-with-mpv
2 |
3 | Watch with MPV is a Chrome extension that allows you to open your current tab in MPV, assuming you have it installed. This extension works with every URL that is supported by youtube-dl.
4 |
5 | ## Prerequisites
6 |
7 | The below prerequisites are required to be in your system's `PATH` environment variable. The version requirements are important if you wish to watch paywalled/private videos.
8 |
9 | * `mpv` >= 0.27.0
10 | * `youtube-dl` >= 2017.08.06
11 |
12 | Google Chrome or Chromium are both supported and are required for the native host to function, but the native host can be installed without either browser being installed.
13 |
14 | ## Installation
15 |
16 | This Chrome extension makes use of a native host in order to work properly. This is because of Chrome's extension restrictions. Without the native host, the extension is unable to run MPV from the browser instance.
17 |
18 | Be sure you have the [Chrome extension](https://chrome.google.com/webstore/detail/gbgfakmgjoejbcffelendicfedkegllf) installed before you continue.
19 |
20 | ### Windows
21 |
22 | 1. Download the [latest Windows release](https://github.com/winneon/watch-with-mpv/releases/download/1.2.9/native-windows.zip).
23 | 2. Unzip the archive into the directory of your choice.
24 | 3. Run `install.bat` as administrator.
25 |
26 | **Do not remove the extracted directory after you have followed these steps.** If you wish to move or uninstall the native host, run `uninstall.bat` first. Then you may do as you like with the directory.
27 |
28 | ### Linux
29 |
30 | #### Arch Linux
31 |
32 | Install **[watch-with-mpv]** or **[watch-with-mpv-git]** from the AUR.
33 |
34 | [watch-with-mpv]: https://aur.archlinux.org/packages/watch-with-mpv/
35 | [watch-with-mpv-git]: https://aur.archlinux.org/packages/watch-with-mpv-git/
36 |
37 | #### Other Linux
38 |
39 | Run the following commands in the terminal of your choice. **Requires curl, unzip, and make to be installed.**
40 |
41 | ```
42 | $ curl -L -O https://github.com/winneon/watch-with-mpv/releases/download/1.2.9/native-linux.zip
43 | $ unzip native-linux.zip -d native-linux && cd native-linux
44 | $ sudo make install
45 | ```
46 |
47 | ## Usage
48 |
49 | Just click on the MPV icon in the top right Chrome toolbar when you're on a playable webpage. Examples include YouTube, Twitch, Vimeo, a raw video file, even naughty websites! For a full list of supported URLs, visit youtube-dl's [documentation](https://rg3.github.io/youtube-dl/supportedsites.html).
50 |
51 | ## Contributing
52 |
53 | To install the development version, run the following commands. Running the development version **requires** node.js, npm, and git to be installed.
54 |
55 | ```
56 | $ git clone https://github.com/winneon/watch-with-mpv
57 | $ cd watch-with-mpv/native
58 | $ npm install
59 | ```
60 |
61 | The extension's source files are located in `extension/`, and the native host's source files are located in `native/`. These two directories are independent of each other.
62 |
63 | To load the extension into Chrome, go to `chrome://extensions` and click `Load unpacked extension`. Then select the `extension/` directory.
64 |
65 | To install the native host, run the following commands according to your platform. You will need to re-install the native host each time you edit its files.
66 |
67 | ### Windows
68 |
69 | ```
70 | > cd native/build/win
71 | > npm run build
72 | > install.bat
73 | ```
74 |
75 | ### Linux
76 |
77 | ```
78 | $ cd native/build/linux
79 | $ npm run build
80 | $ sudo make install
81 | ```
82 |
--------------------------------------------------------------------------------
/extension/background.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | let interval = undefined
4 |
5 | function setIcon(type, callback) {
6 | switch (type) {
7 | case 'mpv':
8 | chrome.browserAction.setIcon({ path: 'icons/mpv.png' }, () => {
9 | chrome.browserAction.setBadgeText({ text: '' })
10 | if (callback) callback()
11 | })
12 |
13 | if (interval) {
14 | clearInterval(interval)
15 | interval = undefined
16 | }
17 |
18 | break
19 | case 'error':
20 | chrome.browserAction.setIcon({ path: 'icons/error.png' }, () => {
21 | chrome.browserAction.setBadgeText({ text: '' })
22 |
23 | if (callback) callback()
24 | setIcon('mpv')
25 | })
26 |
27 | if (interval) {
28 | clearInterval(interval)
29 | interval = undefined
30 | }
31 |
32 | break
33 | case 'completed':
34 | chrome.browserAction.setIcon({ path: 'icons/checkmark.png' }, () => {
35 | chrome.browserAction.setBadgeText({ text: '' })
36 | setTimeout(() => chrome.browserAction.setIcon({ path: 'icons/mpv.png' }), 1000)
37 | })
38 |
39 | if (interval) {
40 | clearInterval(interval)
41 | interval = undefined
42 | }
43 |
44 | break
45 | case 'working':
46 | function run(num) {
47 | chrome.browserAction.setIcon({ path: 'icons/timer.png' }, () => {
48 | let str = ' '
49 |
50 | for (i = 0; i < num; i++){
51 | str += '. '
52 | }
53 |
54 | chrome.browserAction.setBadgeText({ text: str })
55 | })
56 | }
57 |
58 | let i = 1
59 | run(i)
60 |
61 | interval = setInterval(() => {
62 | if (i < 3) {
63 | i++
64 | run(i)
65 | } else {
66 | i = 1
67 | run(i)
68 | }
69 | }, 500)
70 |
71 | break
72 | }
73 | }
74 |
75 | function runNative(url){
76 | let split = url.split('/')
77 |
78 | chrome.cookies.getAll({
79 | url: `${split[0]}//${split[2]}`
80 | }, (cookies) => {
81 | let list = [ '# Netscape HTTP Cookie File' ]
82 |
83 | cookies.forEach((cookie) => {
84 | let expirationDate = cookie.expirationDate ? Math.round(cookie.expirationDate) : 0
85 | let dot = cookie.domain.startsWith('.').toString().toUpperCase()
86 |
87 | list.push(`${cookie.domain} ${dot} ${cookie.path} ${cookie.secure.toString().toUpperCase()} ${expirationDate} ${cookie.name} ${cookie.value}`.replace(/\s/g, '\t'))
88 | })
89 |
90 | setIcon('working')
91 |
92 | chrome.runtime.sendNativeMessage('moe.winneon.watchwithmpv', {
93 | text: url,
94 | cookies: list
95 | }, (data) => {
96 | let runtimeError = chrome.runtime.lastError
97 | console.log(runtimeError)
98 |
99 | if (runtimeError && runtimeError.message === 'Specified native messaging host not found.'){
100 | console.log(runtimeError.message)
101 | let bool = confirm(
102 | `Unable to connect to the native host. You may not have it installed.
103 |
104 | Click OK to redirect to the download page.`)
105 |
106 | if (bool){
107 | chrome.tabs.create({ url: 'https://github.com/winneon/watch-with-mpv/releases/latest' })
108 | }
109 |
110 | setIcon('mpv')
111 | } else {
112 | if (!data) {
113 | setIcon('error', () => {
114 | alert(
115 | `The native host has quit unexpectedly. The reasoning is unknown.
116 |
117 | If this was not done by you, then feel free to make a GitHub issue describing this error and exactly what you did before this error occured. Thank you.`)
118 | })
119 | } else if (!data.version || data.version !== chrome.app.getDetails().version) {
120 | setIcon('error', () => {
121 | alert(
122 | `Your extension's version does not match the native host's version. Please make sure that this extension and the native host are both updated and are the same version.
123 |
124 | Afterwards, try again.`)
125 | })
126 | } else if (data.error === 'success') {
127 | setIcon('completed')
128 | } else if (data.error === 'error'){
129 | setIcon('error', () => {
130 | let bool = confirm(
131 | `An error occured while trying to open MPV. The error has been logged in the console.
132 |
133 | This error is most likely because the URL you specified is not supported by youtube-dl, or you do not have youtube-dl installed.
134 |
135 | Make sure that youtube-dl is installed, and then click OK to view supported URLs. Otherwise, click Cancel.`)
136 |
137 | if (bool){
138 | chrome.tabs.create({ url: 'https://rg3.github.io/youtube-dl/supportedsites.html' })
139 | }
140 | })
141 | } else {
142 | setIcon('error', () => {
143 | alert(
144 | `An unknown error has occured when opening mpv. The error has been logged into this extension's console.
145 |
146 | To view the error, right click on this extension's icon in your toolbar, click 'Manage extensions', and click on 'Inspect views: background page'. The error should be shown in the Console tab of the window that just popped up.
147 |
148 | Feel free to report this error if you're unable to resolve the issue yourself. Thank you.`)
149 | })
150 | }
151 | }
152 | })
153 | })
154 | }
155 |
156 | chrome.contextMenus.create({
157 | title: 'Watch with MPV',
158 | contexts: [ 'link' ],
159 | onclick: (info, tab) => runNative(info.linkUrl)
160 | }, (error) => {
161 | if (chrome.runtime.lastError){
162 | console.log(chrome.runtime.lastError)
163 | }
164 | })
165 |
166 | chrome.browserAction.onClicked.addListener(tab => runNative(tab.url))
167 |
--------------------------------------------------------------------------------
/extension/icons/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/winneon/watch-with-mpv/9c3ca63026a8d8cc1046500b9c251a53c7dc6c7d/extension/icons/checkmark.png
--------------------------------------------------------------------------------
/extension/icons/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/winneon/watch-with-mpv/9c3ca63026a8d8cc1046500b9c251a53c7dc6c7d/extension/icons/error.png
--------------------------------------------------------------------------------
/extension/icons/mpv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/winneon/watch-with-mpv/9c3ca63026a8d8cc1046500b9c251a53c7dc6c7d/extension/icons/mpv.png
--------------------------------------------------------------------------------
/extension/icons/timer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/winneon/watch-with-mpv/9c3ca63026a8d8cc1046500b9c251a53c7dc6c7d/extension/icons/timer.png
--------------------------------------------------------------------------------
/extension/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 2,
3 | "name": "Watch with MPV",
4 | "description": "Open the current web stream with MPV.",
5 | "version": "1.2.9",
6 | "icons": {
7 | "128": "icons/mpv.png"
8 | },
9 | "browser_action": {
10 | "default_icon": "icons/mpv.png"
11 | },
12 | "background": {
13 | "scripts": [ "background.js" ]
14 | },
15 | "permissions": [
16 | "nativeMessaging",
17 | "activeTab",
18 | "contextMenus",
19 | "cookies",
20 | "*://*/*"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/native/build/linux/Makefile:
--------------------------------------------------------------------------------
1 | PREFIX ?= /usr
2 | SYSCONFDIR ?= /etc
3 |
4 | all:
5 | @echo "Run 'make install' to install watch-with-mpv-native."
6 |
7 | install:
8 | @echo "Making directories..."
9 | mkdir -p $(DESTDIR)$(PREFIX)/bin
10 | mkdir -p $(DESTDIR)$(SYSCONFDIR)/opt/chrome/native-messaging-hosts
11 | mkdir -p $(DESTDIR)$(SYSCONFDIR)/chromium/native-messaging-hosts
12 |
13 | @echo -e "\nInstalling binary..."
14 | cp -p watch-with-mpv-native-linux $(DESTDIR)$(PREFIX)/bin
15 |
16 | @echo -e "\nInstalling native host manifest..."
17 | cp -p moe.winneon.watchwithmpv.json $(DESTDIR)$(SYSCONFDIR)/opt/chrome/native-messaging-hosts
18 | cp -p moe.winneon.watchwithmpv.json $(DESTDIR)$(SYSCONFDIR)/chromium/native-messaging-hosts
19 |
20 | uninstall:
21 | @echo "Removing files..."
22 | rm -rf $(DESTDIR)$(PREFIX)/bin/watch-with-mpv-native-linux
23 | rm -rf $(DESTDIR)$(SYSCONFDIR)/opt/chrome/native-messaging-hosts/moe.winneon.watchwithmpv.json
24 | rm -rf $(DESTDIR)$(SYSCONFDIR)/chromium/native-messaging-hosts/moe.winneon.watchwithmpv.json
25 |
--------------------------------------------------------------------------------
/native/build/moe.winneon.watchwithmpv.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "moe.winneon.watchwithmpv",
3 | "description": "Native host for the Watch with MPV Chrome extension.",
4 | "type": "stdio",
5 | "allowed_origins": [
6 | "chrome-extension://gbgfakmgjoejbcffelendicfedkegllf/",
7 | "chrome-extension://lmlbdcdnnkmkfbjfhalaibekhiopgipi/"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/native/build/win/install.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\moe.winneon.watchwithmpv" /ve /t REG_SZ /d "%~dp0moe.winneon.watchwithmpv.json" /f
4 | pause
5 |
--------------------------------------------------------------------------------
/native/build/win/uninstall.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | REG DELETE "HKCU\Software\Google\Chrome\NativeMessagingHosts\moe.winneon.watchwithmpv" /f
4 | pause
5 |
--------------------------------------------------------------------------------
/native/native.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const native = require('chrome-native-messaging')
4 | const MPV = require('node-mpv')
5 | const { spawn } = require('child_process')
6 | const path = require('path')
7 | const fs = require('fs')
8 | const version = require('./package.json').version
9 |
10 | process.stdin
11 | .pipe(new native.Input())
12 | .pipe(new native.Transform((message, push, done) => {
13 | let directory = path.join(process.platform === 'linux' ? '/tmp' : process.env.TEMP, 'cookies.txt')
14 | fs.writeFileSync(directory, message.cookies.join('\n'))
15 |
16 | let player = new MPV({
17 | debug: false,
18 | ipc_command: '--input-ipc-server'
19 | }, [
20 | '--cookies',
21 | process.platform === 'win32' ? `--cookies-file="${directory}"` : `--cookies-file=${directory}`,
22 | process.platform === 'win32' ? `--ytdl-raw-options=cookies=\"${directory}\"` : `--ytdl-raw-options=cookies=${directory}`
23 | ])
24 |
25 | let loadedBeforeEnded = false
26 |
27 | player.mpvPlayer.on('error', err => {
28 | console.error(err)
29 |
30 | push({
31 | error: err,
32 | version: version
33 | })
34 |
35 | done()
36 | process.exit(1)
37 | })
38 |
39 | player.socket.on('message', data => {
40 | if (data.event) {
41 | switch (data.event) {
42 | case 'file-loaded':
43 | loadedBeforeEnded = true
44 |
45 | push({
46 | error: 'success',
47 | version: version
48 | })
49 |
50 | done()
51 | process.exit(0)
52 |
53 | break
54 | case 'end-file':
55 | if (!loadedBeforeEnded) {
56 | push({
57 | error: 'error',
58 | version: version
59 | })
60 |
61 | done()
62 | process.exit(1)
63 | }
64 |
65 | process.exit(0)
66 |
67 | break
68 | }
69 | }
70 | })
71 |
72 | player.load(message.text)
73 | }))
74 | .pipe(new native.Output())
75 | .pipe(process.stdout)
76 |
--------------------------------------------------------------------------------
/native/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "watch-with-mpv-native",
3 | "version": "1.1.1",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "acorn": {
8 | "version": "5.1.1",
9 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.1.tgz",
10 | "integrity": "sha512-vOk6uEMctu0vQrvuSqFdJyqj1Q0S5VTDL79qtjo+DhRr+1mmaD+tluFSCZqhvi/JUhXSzoZN2BhtstaPEeE8cw==",
11 | "dev": true
12 | },
13 | "ajv": {
14 | "version": "4.11.8",
15 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
16 | "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=",
17 | "dev": true,
18 | "requires": {
19 | "co": "4.6.0",
20 | "json-stable-stringify": "1.0.1"
21 | }
22 | },
23 | "amdefine": {
24 | "version": "1.0.1",
25 | "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
26 | "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
27 | "dev": true,
28 | "optional": true
29 | },
30 | "ansi-styles": {
31 | "version": "3.2.0",
32 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
33 | "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
34 | "dev": true,
35 | "requires": {
36 | "color-convert": "1.9.0"
37 | }
38 | },
39 | "archiver": {
40 | "version": "2.0.3",
41 | "resolved": "https://registry.npmjs.org/archiver/-/archiver-2.0.3.tgz",
42 | "integrity": "sha1-tDYLtYSvFDeZGUJxbyHXxSPR270=",
43 | "dev": true,
44 | "requires": {
45 | "archiver-utils": "1.3.0",
46 | "async": "2.5.0",
47 | "buffer-crc32": "0.2.13",
48 | "glob": "7.1.2",
49 | "lodash": "4.17.4",
50 | "readable-stream": "2.3.3",
51 | "tar-stream": "1.5.4",
52 | "walkdir": "0.0.11",
53 | "zip-stream": "1.2.0"
54 | }
55 | },
56 | "archiver-utils": {
57 | "version": "1.3.0",
58 | "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-1.3.0.tgz",
59 | "integrity": "sha1-5QtMCccL89aA4y/xt5lOn52JUXQ=",
60 | "dev": true,
61 | "requires": {
62 | "glob": "7.1.2",
63 | "graceful-fs": "4.1.11",
64 | "lazystream": "1.0.0",
65 | "lodash": "4.17.4",
66 | "normalize-path": "2.1.1",
67 | "readable-stream": "2.3.3"
68 | }
69 | },
70 | "array-union": {
71 | "version": "1.0.2",
72 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
73 | "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
74 | "dev": true,
75 | "requires": {
76 | "array-uniq": "1.0.3"
77 | }
78 | },
79 | "array-uniq": {
80 | "version": "1.0.3",
81 | "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
82 | "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
83 | "dev": true
84 | },
85 | "asap": {
86 | "version": "2.0.6",
87 | "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
88 | "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
89 | },
90 | "asn1": {
91 | "version": "0.2.3",
92 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
93 | "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=",
94 | "dev": true
95 | },
96 | "assert-plus": {
97 | "version": "0.2.0",
98 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
99 | "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=",
100 | "dev": true
101 | },
102 | "async": {
103 | "version": "2.5.0",
104 | "resolved": "https://registry.npmjs.org/async/-/async-2.5.0.tgz",
105 | "integrity": "sha512-e+lJAJeNWuPCNyxZKOBdaJGyLGHugXVQtrAwtuAe2vhxTYxFTKE73p8JuTmdH0qdQZtDvI4dhJwjZc5zsfIsYw==",
106 | "dev": true,
107 | "requires": {
108 | "lodash": "4.17.4"
109 | }
110 | },
111 | "asynckit": {
112 | "version": "0.4.0",
113 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
114 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
115 | "dev": true
116 | },
117 | "aws-sign2": {
118 | "version": "0.6.0",
119 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
120 | "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=",
121 | "dev": true
122 | },
123 | "aws4": {
124 | "version": "1.6.0",
125 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz",
126 | "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=",
127 | "dev": true
128 | },
129 | "babel-runtime": {
130 | "version": "6.25.0",
131 | "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.25.0.tgz",
132 | "integrity": "sha1-M7mOql1IK7AajRqmtDetKwGuxBw=",
133 | "dev": true,
134 | "requires": {
135 | "core-js": "2.5.1",
136 | "regenerator-runtime": "0.10.5"
137 | }
138 | },
139 | "balanced-match": {
140 | "version": "1.0.0",
141 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
142 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
143 | "dev": true
144 | },
145 | "bcrypt-pbkdf": {
146 | "version": "1.0.1",
147 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
148 | "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
149 | "dev": true,
150 | "optional": true,
151 | "requires": {
152 | "tweetnacl": "0.14.5"
153 | }
154 | },
155 | "bl": {
156 | "version": "1.2.1",
157 | "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz",
158 | "integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=",
159 | "dev": true,
160 | "requires": {
161 | "readable-stream": "2.3.3"
162 | }
163 | },
164 | "boom": {
165 | "version": "2.10.1",
166 | "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
167 | "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=",
168 | "dev": true,
169 | "requires": {
170 | "hoek": "2.16.3"
171 | }
172 | },
173 | "brace-expansion": {
174 | "version": "1.1.8",
175 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
176 | "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
177 | "dev": true,
178 | "requires": {
179 | "balanced-match": "1.0.0",
180 | "concat-map": "0.0.1"
181 | }
182 | },
183 | "browser-fingerprint": {
184 | "version": "0.0.1",
185 | "resolved": "https://registry.npmjs.org/browser-fingerprint/-/browser-fingerprint-0.0.1.tgz",
186 | "integrity": "sha1-jfPNyiW/fVs1QtYVRdcwBT/OYEo="
187 | },
188 | "buffer-crc32": {
189 | "version": "0.2.13",
190 | "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
191 | "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=",
192 | "dev": true
193 | },
194 | "byline": {
195 | "version": "5.0.0",
196 | "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
197 | "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=",
198 | "dev": true
199 | },
200 | "caseless": {
201 | "version": "0.12.0",
202 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
203 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
204 | "dev": true
205 | },
206 | "chalk": {
207 | "version": "2.1.0",
208 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
209 | "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
210 | "dev": true,
211 | "requires": {
212 | "ansi-styles": "3.2.0",
213 | "escape-string-regexp": "1.0.5",
214 | "supports-color": "4.4.0"
215 | }
216 | },
217 | "chrome-native-messaging": {
218 | "version": "0.2.0",
219 | "resolved": "https://registry.npmjs.org/chrome-native-messaging/-/chrome-native-messaging-0.2.0.tgz",
220 | "integrity": "sha1-wULN5SS9GxhU4U9X4HijlqbaOCY=",
221 | "dev": true
222 | },
223 | "co": {
224 | "version": "4.6.0",
225 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
226 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
227 | "dev": true
228 | },
229 | "color-convert": {
230 | "version": "1.9.0",
231 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
232 | "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=",
233 | "dev": true,
234 | "requires": {
235 | "color-name": "1.1.3"
236 | }
237 | },
238 | "color-name": {
239 | "version": "1.1.3",
240 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
241 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
242 | "dev": true
243 | },
244 | "combined-stream": {
245 | "version": "1.0.5",
246 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
247 | "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=",
248 | "dev": true,
249 | "requires": {
250 | "delayed-stream": "1.0.0"
251 | }
252 | },
253 | "compress-commons": {
254 | "version": "1.2.0",
255 | "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-1.2.0.tgz",
256 | "integrity": "sha1-WFhwku8g03y1i68AARLJJ4/3O58=",
257 | "dev": true,
258 | "requires": {
259 | "buffer-crc32": "0.2.13",
260 | "crc32-stream": "2.0.0",
261 | "normalize-path": "2.1.1",
262 | "readable-stream": "2.3.3"
263 | }
264 | },
265 | "concat-map": {
266 | "version": "0.0.1",
267 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
268 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
269 | "dev": true
270 | },
271 | "core-js": {
272 | "version": "2.5.1",
273 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz",
274 | "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=",
275 | "dev": true
276 | },
277 | "core-util-is": {
278 | "version": "1.0.2",
279 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
280 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
281 | "dev": true
282 | },
283 | "crc": {
284 | "version": "3.4.4",
285 | "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz",
286 | "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=",
287 | "dev": true
288 | },
289 | "crc32-stream": {
290 | "version": "2.0.0",
291 | "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-2.0.0.tgz",
292 | "integrity": "sha1-483TtN8xaN10494/u8t7KX/pCPQ=",
293 | "dev": true,
294 | "requires": {
295 | "crc": "3.4.4",
296 | "readable-stream": "2.3.3"
297 | }
298 | },
299 | "cryptiles": {
300 | "version": "2.0.5",
301 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
302 | "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=",
303 | "dev": true,
304 | "requires": {
305 | "boom": "2.10.1"
306 | }
307 | },
308 | "cuid": {
309 | "version": "1.3.8",
310 | "resolved": "https://registry.npmjs.org/cuid/-/cuid-1.3.8.tgz",
311 | "integrity": "sha1-S4deCWm612T37AcGz0T1+wgx9rc=",
312 | "requires": {
313 | "browser-fingerprint": "0.0.1",
314 | "core-js": "1.2.7",
315 | "node-fingerprint": "0.0.2"
316 | },
317 | "dependencies": {
318 | "core-js": {
319 | "version": "1.2.7",
320 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
321 | "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY="
322 | }
323 | }
324 | },
325 | "dashdash": {
326 | "version": "1.14.1",
327 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
328 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
329 | "dev": true,
330 | "requires": {
331 | "assert-plus": "1.0.0"
332 | },
333 | "dependencies": {
334 | "assert-plus": {
335 | "version": "1.0.0",
336 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
337 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
338 | "dev": true
339 | }
340 | }
341 | },
342 | "deep-is": {
343 | "version": "0.1.3",
344 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
345 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
346 | "dev": true
347 | },
348 | "delayed-stream": {
349 | "version": "1.0.0",
350 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
351 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
352 | "dev": true
353 | },
354 | "ecc-jsbn": {
355 | "version": "0.1.1",
356 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
357 | "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
358 | "dev": true,
359 | "optional": true,
360 | "requires": {
361 | "jsbn": "0.1.1"
362 | }
363 | },
364 | "end-of-stream": {
365 | "version": "1.4.0",
366 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz",
367 | "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=",
368 | "dev": true,
369 | "requires": {
370 | "once": "1.4.0"
371 | }
372 | },
373 | "escape-string-regexp": {
374 | "version": "1.0.5",
375 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
376 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
377 | "dev": true
378 | },
379 | "escodegen": {
380 | "version": "1.8.1",
381 | "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz",
382 | "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=",
383 | "dev": true,
384 | "requires": {
385 | "esprima": "2.7.3",
386 | "estraverse": "1.9.3",
387 | "esutils": "2.0.2",
388 | "optionator": "0.8.2",
389 | "source-map": "0.2.0"
390 | }
391 | },
392 | "esprima": {
393 | "version": "2.7.3",
394 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
395 | "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
396 | "dev": true
397 | },
398 | "estraverse": {
399 | "version": "1.9.3",
400 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz",
401 | "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=",
402 | "dev": true
403 | },
404 | "esutils": {
405 | "version": "2.0.2",
406 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
407 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
408 | "dev": true
409 | },
410 | "expand-template": {
411 | "version": "1.0.3",
412 | "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.0.3.tgz",
413 | "integrity": "sha1-bDAzIxd6YrGyLAcCefeGEoe2mxo=",
414 | "dev": true
415 | },
416 | "extend": {
417 | "version": "3.0.1",
418 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
419 | "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
420 | "dev": true
421 | },
422 | "extsprintf": {
423 | "version": "1.3.0",
424 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
425 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
426 | "dev": true
427 | },
428 | "fast-levenshtein": {
429 | "version": "2.0.6",
430 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
431 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
432 | "dev": true
433 | },
434 | "forever-agent": {
435 | "version": "0.6.1",
436 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
437 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
438 | "dev": true
439 | },
440 | "form-data": {
441 | "version": "2.1.4",
442 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz",
443 | "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=",
444 | "dev": true,
445 | "requires": {
446 | "asynckit": "0.4.0",
447 | "combined-stream": "1.0.5",
448 | "mime-types": "2.1.17"
449 | }
450 | },
451 | "fs-extra": {
452 | "version": "4.0.1",
453 | "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.1.tgz",
454 | "integrity": "sha1-f8DGyJV/mD9X8waiTlud3Y0N2IA=",
455 | "dev": true,
456 | "requires": {
457 | "graceful-fs": "4.1.11",
458 | "jsonfile": "3.0.1",
459 | "universalify": "0.1.1"
460 | }
461 | },
462 | "fs.realpath": {
463 | "version": "1.0.0",
464 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
465 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
466 | "dev": true
467 | },
468 | "getpass": {
469 | "version": "0.1.7",
470 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
471 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
472 | "dev": true,
473 | "requires": {
474 | "assert-plus": "1.0.0"
475 | },
476 | "dependencies": {
477 | "assert-plus": {
478 | "version": "1.0.0",
479 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
480 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
481 | "dev": true
482 | }
483 | }
484 | },
485 | "glob": {
486 | "version": "7.1.2",
487 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
488 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
489 | "dev": true,
490 | "requires": {
491 | "fs.realpath": "1.0.0",
492 | "inflight": "1.0.6",
493 | "inherits": "2.0.3",
494 | "minimatch": "3.0.4",
495 | "once": "1.4.0",
496 | "path-is-absolute": "1.0.1"
497 | }
498 | },
499 | "globby": {
500 | "version": "6.1.0",
501 | "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz",
502 | "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=",
503 | "dev": true,
504 | "requires": {
505 | "array-union": "1.0.2",
506 | "glob": "7.1.2",
507 | "object-assign": "4.1.1",
508 | "pify": "2.3.0",
509 | "pinkie-promise": "2.0.1"
510 | }
511 | },
512 | "graceful-fs": {
513 | "version": "4.1.11",
514 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
515 | "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
516 | "dev": true
517 | },
518 | "har-schema": {
519 | "version": "1.0.5",
520 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz",
521 | "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=",
522 | "dev": true
523 | },
524 | "har-validator": {
525 | "version": "4.2.1",
526 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz",
527 | "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=",
528 | "dev": true,
529 | "requires": {
530 | "ajv": "4.11.8",
531 | "har-schema": "1.0.5"
532 | }
533 | },
534 | "has-flag": {
535 | "version": "2.0.0",
536 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
537 | "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=",
538 | "dev": true
539 | },
540 | "hawk": {
541 | "version": "3.1.3",
542 | "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
543 | "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=",
544 | "dev": true,
545 | "requires": {
546 | "boom": "2.10.1",
547 | "cryptiles": "2.0.5",
548 | "hoek": "2.16.3",
549 | "sntp": "1.0.9"
550 | }
551 | },
552 | "hoek": {
553 | "version": "2.16.3",
554 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
555 | "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=",
556 | "dev": true
557 | },
558 | "http-signature": {
559 | "version": "1.1.1",
560 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
561 | "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=",
562 | "dev": true,
563 | "requires": {
564 | "assert-plus": "0.2.0",
565 | "jsprim": "1.4.1",
566 | "sshpk": "1.13.1"
567 | }
568 | },
569 | "in-publish": {
570 | "version": "2.0.0",
571 | "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz",
572 | "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=",
573 | "dev": true
574 | },
575 | "inflight": {
576 | "version": "1.0.6",
577 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
578 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
579 | "dev": true,
580 | "requires": {
581 | "once": "1.4.0",
582 | "wrappy": "1.0.2"
583 | }
584 | },
585 | "inherits": {
586 | "version": "2.0.3",
587 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
588 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
589 | "dev": true
590 | },
591 | "is-typedarray": {
592 | "version": "1.0.0",
593 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
594 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
595 | "dev": true
596 | },
597 | "isarray": {
598 | "version": "1.0.0",
599 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
600 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
601 | "dev": true
602 | },
603 | "isstream": {
604 | "version": "0.1.2",
605 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
606 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
607 | "dev": true
608 | },
609 | "jsbn": {
610 | "version": "0.1.1",
611 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
612 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
613 | "dev": true,
614 | "optional": true
615 | },
616 | "json-schema": {
617 | "version": "0.2.3",
618 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
619 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
620 | "dev": true
621 | },
622 | "json-stable-stringify": {
623 | "version": "1.0.1",
624 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz",
625 | "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=",
626 | "dev": true,
627 | "requires": {
628 | "jsonify": "0.0.0"
629 | }
630 | },
631 | "json-stringify-safe": {
632 | "version": "5.0.1",
633 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
634 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
635 | "dev": true
636 | },
637 | "jsonfile": {
638 | "version": "3.0.1",
639 | "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz",
640 | "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=",
641 | "dev": true,
642 | "requires": {
643 | "graceful-fs": "4.1.11"
644 | }
645 | },
646 | "jsonify": {
647 | "version": "0.0.0",
648 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz",
649 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=",
650 | "dev": true
651 | },
652 | "jsprim": {
653 | "version": "1.4.1",
654 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
655 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
656 | "dev": true,
657 | "requires": {
658 | "assert-plus": "1.0.0",
659 | "extsprintf": "1.3.0",
660 | "json-schema": "0.2.3",
661 | "verror": "1.10.0"
662 | },
663 | "dependencies": {
664 | "assert-plus": {
665 | "version": "1.0.0",
666 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
667 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
668 | "dev": true
669 | }
670 | }
671 | },
672 | "lazystream": {
673 | "version": "1.0.0",
674 | "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz",
675 | "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=",
676 | "dev": true,
677 | "requires": {
678 | "readable-stream": "2.3.3"
679 | }
680 | },
681 | "levn": {
682 | "version": "0.3.0",
683 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
684 | "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
685 | "dev": true,
686 | "requires": {
687 | "prelude-ls": "1.1.2",
688 | "type-check": "0.3.2"
689 | }
690 | },
691 | "lodash": {
692 | "version": "4.17.4",
693 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
694 | "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
695 | },
696 | "mime-db": {
697 | "version": "1.30.0",
698 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz",
699 | "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=",
700 | "dev": true
701 | },
702 | "mime-types": {
703 | "version": "2.1.17",
704 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz",
705 | "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=",
706 | "dev": true,
707 | "requires": {
708 | "mime-db": "1.30.0"
709 | }
710 | },
711 | "minimatch": {
712 | "version": "3.0.4",
713 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
714 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
715 | "dev": true,
716 | "requires": {
717 | "brace-expansion": "1.1.8"
718 | }
719 | },
720 | "minimist": {
721 | "version": "1.2.0",
722 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
723 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
724 | "dev": true
725 | },
726 | "mkdirp": {
727 | "version": "0.5.1",
728 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
729 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
730 | "dev": true,
731 | "requires": {
732 | "minimist": "0.0.8"
733 | },
734 | "dependencies": {
735 | "minimist": {
736 | "version": "0.0.8",
737 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
738 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
739 | "dev": true
740 | }
741 | }
742 | },
743 | "multistream": {
744 | "version": "2.1.0",
745 | "resolved": "https://registry.npmjs.org/multistream/-/multistream-2.1.0.tgz",
746 | "integrity": "sha1-YlwmfVxEQkrWKUeItbtNo9yzLx0=",
747 | "dev": true,
748 | "requires": {
749 | "inherits": "2.0.3",
750 | "readable-stream": "2.3.3"
751 | }
752 | },
753 | "node-fingerprint": {
754 | "version": "0.0.2",
755 | "resolved": "https://registry.npmjs.org/node-fingerprint/-/node-fingerprint-0.0.2.tgz",
756 | "integrity": "sha1-Mcur63GmeufdWn3AQuUcPHWGhQE="
757 | },
758 | "node-mpv": {
759 | "version": "1.3.1",
760 | "resolved": "https://registry.npmjs.org/node-mpv/-/node-mpv-1.3.1.tgz",
761 | "integrity": "sha512-muNUTg1kPQ7bywhHcv13hULd+zE/8TXb+NjAW0u6rwd2wI2aA9hcFamiwDgBzur05Kgx6CucaxbiqGtoJqAzLA==",
762 | "requires": {
763 | "cuid": "1.3.8",
764 | "lodash": "4.17.4",
765 | "promise": "7.3.1"
766 | }
767 | },
768 | "normalize-path": {
769 | "version": "2.1.1",
770 | "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
771 | "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
772 | "dev": true,
773 | "requires": {
774 | "remove-trailing-separator": "1.1.0"
775 | }
776 | },
777 | "oauth-sign": {
778 | "version": "0.8.2",
779 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
780 | "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
781 | "dev": true
782 | },
783 | "object-assign": {
784 | "version": "4.1.1",
785 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
786 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
787 | "dev": true
788 | },
789 | "once": {
790 | "version": "1.4.0",
791 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
792 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
793 | "dev": true,
794 | "requires": {
795 | "wrappy": "1.0.2"
796 | }
797 | },
798 | "optionator": {
799 | "version": "0.8.2",
800 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
801 | "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
802 | "dev": true,
803 | "requires": {
804 | "deep-is": "0.1.3",
805 | "fast-levenshtein": "2.0.6",
806 | "levn": "0.3.0",
807 | "prelude-ls": "1.1.2",
808 | "type-check": "0.3.2",
809 | "wordwrap": "1.0.0"
810 | }
811 | },
812 | "os-tmpdir": {
813 | "version": "1.0.2",
814 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
815 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
816 | "dev": true
817 | },
818 | "path-is-absolute": {
819 | "version": "1.0.1",
820 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
821 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
822 | "dev": true
823 | },
824 | "path-parse": {
825 | "version": "1.0.5",
826 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
827 | "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
828 | "dev": true
829 | },
830 | "performance-now": {
831 | "version": "0.2.0",
832 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz",
833 | "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=",
834 | "dev": true
835 | },
836 | "pify": {
837 | "version": "2.3.0",
838 | "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
839 | "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
840 | "dev": true
841 | },
842 | "pinkie": {
843 | "version": "2.0.4",
844 | "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
845 | "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
846 | "dev": true
847 | },
848 | "pinkie-promise": {
849 | "version": "2.0.1",
850 | "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
851 | "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
852 | "dev": true,
853 | "requires": {
854 | "pinkie": "2.0.4"
855 | }
856 | },
857 | "pkg": {
858 | "version": "4.2.4",
859 | "resolved": "https://registry.npmjs.org/pkg/-/pkg-4.2.4.tgz",
860 | "integrity": "sha512-v9WZ3B7mjswOf+VIX0gIfU2DsH68dz/tQt6+AOg+6Q700UyFTK3q2cDFN1BZEkGOM2mZxlhbsXnYGWPZzS9lvQ==",
861 | "dev": true,
862 | "requires": {
863 | "acorn": "5.1.1",
864 | "babel-runtime": "6.25.0",
865 | "chalk": "2.1.0",
866 | "escodegen": "1.8.1",
867 | "fs-extra": "4.0.1",
868 | "globby": "6.1.0",
869 | "in-publish": "2.0.0",
870 | "minimist": "1.2.0",
871 | "multistream": "2.1.0",
872 | "pkg-fetch": "2.3.10",
873 | "progress": "2.0.0",
874 | "resolve": "1.4.0",
875 | "simple-bufferstream": "1.0.0",
876 | "stream-meter": "1.0.4"
877 | }
878 | },
879 | "pkg-fetch": {
880 | "version": "2.3.10",
881 | "resolved": "https://registry.npmjs.org/pkg-fetch/-/pkg-fetch-2.3.10.tgz",
882 | "integrity": "sha512-qxcwfdvgGLThbYdf8U8T3gWRhFYAgJ4iNHY//3PGa0UrnH6LR2HQIaLUBnuscqh28tZvs/VGFs57K4kq98rJnA==",
883 | "dev": true,
884 | "requires": {
885 | "babel-runtime": "6.25.0",
886 | "byline": "5.0.0",
887 | "chalk": "2.1.0",
888 | "expand-template": "1.0.3",
889 | "fs-extra": "4.0.1",
890 | "in-publish": "2.0.0",
891 | "minimist": "1.2.0",
892 | "progress": "2.0.0",
893 | "request": "2.81.0",
894 | "request-progress": "3.0.0",
895 | "semver": "5.4.1",
896 | "unique-temp-dir": "1.0.0"
897 | }
898 | },
899 | "prelude-ls": {
900 | "version": "1.1.2",
901 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
902 | "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
903 | "dev": true
904 | },
905 | "process-nextick-args": {
906 | "version": "1.0.7",
907 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
908 | "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
909 | "dev": true
910 | },
911 | "progress": {
912 | "version": "2.0.0",
913 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
914 | "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
915 | "dev": true
916 | },
917 | "promise": {
918 | "version": "7.3.1",
919 | "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
920 | "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
921 | "requires": {
922 | "asap": "2.0.6"
923 | }
924 | },
925 | "punycode": {
926 | "version": "1.4.1",
927 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
928 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
929 | "dev": true
930 | },
931 | "qs": {
932 | "version": "6.4.0",
933 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz",
934 | "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=",
935 | "dev": true
936 | },
937 | "readable-stream": {
938 | "version": "2.3.3",
939 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
940 | "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==",
941 | "dev": true,
942 | "requires": {
943 | "core-util-is": "1.0.2",
944 | "inherits": "2.0.3",
945 | "isarray": "1.0.0",
946 | "process-nextick-args": "1.0.7",
947 | "safe-buffer": "5.1.1",
948 | "string_decoder": "1.0.3",
949 | "util-deprecate": "1.0.2"
950 | }
951 | },
952 | "regenerator-runtime": {
953 | "version": "0.10.5",
954 | "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
955 | "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=",
956 | "dev": true
957 | },
958 | "remove-trailing-separator": {
959 | "version": "1.1.0",
960 | "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
961 | "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=",
962 | "dev": true
963 | },
964 | "request": {
965 | "version": "2.81.0",
966 | "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz",
967 | "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=",
968 | "dev": true,
969 | "requires": {
970 | "aws-sign2": "0.6.0",
971 | "aws4": "1.6.0",
972 | "caseless": "0.12.0",
973 | "combined-stream": "1.0.5",
974 | "extend": "3.0.1",
975 | "forever-agent": "0.6.1",
976 | "form-data": "2.1.4",
977 | "har-validator": "4.2.1",
978 | "hawk": "3.1.3",
979 | "http-signature": "1.1.1",
980 | "is-typedarray": "1.0.0",
981 | "isstream": "0.1.2",
982 | "json-stringify-safe": "5.0.1",
983 | "mime-types": "2.1.17",
984 | "oauth-sign": "0.8.2",
985 | "performance-now": "0.2.0",
986 | "qs": "6.4.0",
987 | "safe-buffer": "5.1.1",
988 | "stringstream": "0.0.5",
989 | "tough-cookie": "2.3.2",
990 | "tunnel-agent": "0.6.0",
991 | "uuid": "3.1.0"
992 | }
993 | },
994 | "request-progress": {
995 | "version": "3.0.0",
996 | "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz",
997 | "integrity": "sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4=",
998 | "dev": true,
999 | "requires": {
1000 | "throttleit": "1.0.0"
1001 | }
1002 | },
1003 | "resolve": {
1004 | "version": "1.4.0",
1005 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz",
1006 | "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==",
1007 | "dev": true,
1008 | "requires": {
1009 | "path-parse": "1.0.5"
1010 | }
1011 | },
1012 | "safe-buffer": {
1013 | "version": "5.1.1",
1014 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
1015 | "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
1016 | "dev": true
1017 | },
1018 | "semver": {
1019 | "version": "5.4.1",
1020 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
1021 | "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
1022 | "dev": true
1023 | },
1024 | "simple-bufferstream": {
1025 | "version": "1.0.0",
1026 | "resolved": "https://registry.npmjs.org/simple-bufferstream/-/simple-bufferstream-1.0.0.tgz",
1027 | "integrity": "sha1-XKsQ6FGqccZnt3th/hux2QpguqQ=",
1028 | "dev": true
1029 | },
1030 | "sntp": {
1031 | "version": "1.0.9",
1032 | "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
1033 | "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=",
1034 | "dev": true,
1035 | "requires": {
1036 | "hoek": "2.16.3"
1037 | }
1038 | },
1039 | "source-map": {
1040 | "version": "0.2.0",
1041 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz",
1042 | "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=",
1043 | "dev": true,
1044 | "optional": true,
1045 | "requires": {
1046 | "amdefine": "1.0.1"
1047 | }
1048 | },
1049 | "sshpk": {
1050 | "version": "1.13.1",
1051 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz",
1052 | "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=",
1053 | "dev": true,
1054 | "requires": {
1055 | "asn1": "0.2.3",
1056 | "assert-plus": "1.0.0",
1057 | "bcrypt-pbkdf": "1.0.1",
1058 | "dashdash": "1.14.1",
1059 | "ecc-jsbn": "0.1.1",
1060 | "getpass": "0.1.7",
1061 | "jsbn": "0.1.1",
1062 | "tweetnacl": "0.14.5"
1063 | },
1064 | "dependencies": {
1065 | "assert-plus": {
1066 | "version": "1.0.0",
1067 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
1068 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
1069 | "dev": true
1070 | }
1071 | }
1072 | },
1073 | "stream-meter": {
1074 | "version": "1.0.4",
1075 | "resolved": "https://registry.npmjs.org/stream-meter/-/stream-meter-1.0.4.tgz",
1076 | "integrity": "sha1-Uq+Vql6nYKJJFxZwTb/5D3Ov3R0=",
1077 | "dev": true,
1078 | "requires": {
1079 | "readable-stream": "2.3.3"
1080 | }
1081 | },
1082 | "string_decoder": {
1083 | "version": "1.0.3",
1084 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
1085 | "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
1086 | "dev": true,
1087 | "requires": {
1088 | "safe-buffer": "5.1.1"
1089 | }
1090 | },
1091 | "stringstream": {
1092 | "version": "0.0.5",
1093 | "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
1094 | "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=",
1095 | "dev": true
1096 | },
1097 | "supports-color": {
1098 | "version": "4.4.0",
1099 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
1100 | "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
1101 | "dev": true,
1102 | "requires": {
1103 | "has-flag": "2.0.0"
1104 | }
1105 | },
1106 | "tar-stream": {
1107 | "version": "1.5.4",
1108 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.5.4.tgz",
1109 | "integrity": "sha1-NlSc8E7RrumyowwBQyUiONr5QBY=",
1110 | "dev": true,
1111 | "requires": {
1112 | "bl": "1.2.1",
1113 | "end-of-stream": "1.4.0",
1114 | "readable-stream": "2.3.3",
1115 | "xtend": "4.0.1"
1116 | }
1117 | },
1118 | "throttleit": {
1119 | "version": "1.0.0",
1120 | "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.0.tgz",
1121 | "integrity": "sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw=",
1122 | "dev": true
1123 | },
1124 | "tough-cookie": {
1125 | "version": "2.3.2",
1126 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.2.tgz",
1127 | "integrity": "sha1-8IH3bkyFcg5sN6X6ztc3FQ2EByo=",
1128 | "dev": true,
1129 | "requires": {
1130 | "punycode": "1.4.1"
1131 | }
1132 | },
1133 | "tunnel-agent": {
1134 | "version": "0.6.0",
1135 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
1136 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
1137 | "dev": true,
1138 | "requires": {
1139 | "safe-buffer": "5.1.1"
1140 | }
1141 | },
1142 | "tweetnacl": {
1143 | "version": "0.14.5",
1144 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
1145 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
1146 | "dev": true,
1147 | "optional": true
1148 | },
1149 | "type-check": {
1150 | "version": "0.3.2",
1151 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
1152 | "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
1153 | "dev": true,
1154 | "requires": {
1155 | "prelude-ls": "1.1.2"
1156 | }
1157 | },
1158 | "uid2": {
1159 | "version": "0.0.3",
1160 | "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz",
1161 | "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=",
1162 | "dev": true
1163 | },
1164 | "unique-temp-dir": {
1165 | "version": "1.0.0",
1166 | "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz",
1167 | "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=",
1168 | "dev": true,
1169 | "requires": {
1170 | "mkdirp": "0.5.1",
1171 | "os-tmpdir": "1.0.2",
1172 | "uid2": "0.0.3"
1173 | }
1174 | },
1175 | "universalify": {
1176 | "version": "0.1.1",
1177 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz",
1178 | "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=",
1179 | "dev": true
1180 | },
1181 | "util-deprecate": {
1182 | "version": "1.0.2",
1183 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
1184 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
1185 | "dev": true
1186 | },
1187 | "uuid": {
1188 | "version": "3.1.0",
1189 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
1190 | "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==",
1191 | "dev": true
1192 | },
1193 | "verror": {
1194 | "version": "1.10.0",
1195 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
1196 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
1197 | "dev": true,
1198 | "requires": {
1199 | "assert-plus": "1.0.0",
1200 | "core-util-is": "1.0.2",
1201 | "extsprintf": "1.3.0"
1202 | },
1203 | "dependencies": {
1204 | "assert-plus": {
1205 | "version": "1.0.0",
1206 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
1207 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
1208 | "dev": true
1209 | }
1210 | }
1211 | },
1212 | "walkdir": {
1213 | "version": "0.0.11",
1214 | "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.11.tgz",
1215 | "integrity": "sha1-oW0CXrkxvQO1LzCMrtD0D86+lTI=",
1216 | "dev": true
1217 | },
1218 | "wordwrap": {
1219 | "version": "1.0.0",
1220 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
1221 | "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=",
1222 | "dev": true
1223 | },
1224 | "wrappy": {
1225 | "version": "1.0.2",
1226 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
1227 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
1228 | "dev": true
1229 | },
1230 | "xtend": {
1231 | "version": "4.0.1",
1232 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
1233 | "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
1234 | "dev": true
1235 | },
1236 | "zip-stream": {
1237 | "version": "1.2.0",
1238 | "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-1.2.0.tgz",
1239 | "integrity": "sha1-qLxF9MG0lpnGuQGYuqyqzbzUugQ=",
1240 | "dev": true,
1241 | "requires": {
1242 | "archiver-utils": "1.3.0",
1243 | "compress-commons": "1.2.0",
1244 | "lodash": "4.17.4",
1245 | "readable-stream": "2.3.3"
1246 | }
1247 | }
1248 | }
1249 | }
1250 |
--------------------------------------------------------------------------------
/native/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "watch-with-mpv-native",
3 | "description": "The native host for the Watch with MPV Chrome extension.",
4 | "author": "Jesse Bryan ",
5 | "version": "1.2.9",
6 | "license": "MIT",
7 | "repository": "winneon/watch-with-mpv",
8 | "bin": {
9 | "native": "native.js"
10 | },
11 | "pkg": {
12 | "targets": [
13 | "latest-linux-x64",
14 | "latest-win-x64"
15 | ],
16 | "name": "native"
17 | },
18 | "scripts": {
19 | "build": "pkg --out-path build .",
20 | "postbuild": "node zip"
21 | },
22 | "devDependencies": {
23 | "archiver": "^2.0.0",
24 | "chrome-native-messaging": "^0.2.0",
25 | "node-mpv": "^1.3.1",
26 | "pkg": "^4.1.2"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/native/zip.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | const archiver = require('archiver')
4 | const path = require('path')
5 | const fs = require('fs')
6 |
7 | function finishLog(target){
8 | console.log(`Finished building the ${target} target. The zip file can be found in dist/.`)
9 | }
10 |
11 | function archiveWarn(err){
12 | if (err.code === 'ENOENT'){
13 | console.error(err)
14 | } else {
15 | throw err
16 | }
17 | }
18 |
19 | function archiveError(err){
20 | throw err
21 | }
22 |
23 | try {
24 | fs.mkdirSync(path.join(__dirname, 'dist'))
25 | } catch (err){
26 | if (err.code !== 'EEXIST') throw err
27 | }
28 |
29 | let jsonName = 'moe.winneon.watchwithmpv.json'
30 |
31 | let execLinux = 'watch-with-mpv-native-linux'
32 | let execWin = 'watch-with-mpv-native-win.exe'
33 |
34 | let jsonFile = require(`./build/${jsonName}`)
35 |
36 | jsonFile.path = '/usr/bin/' + execLinux
37 | fs.writeFileSync(path.join('build', 'linux', jsonName), JSON.stringify(jsonFile, null, 2))
38 |
39 | jsonFile.path = execWin
40 | fs.writeFileSync(path.join('build', 'win', jsonName), JSON.stringify(jsonFile, null, 2))
41 |
42 | fs.renameSync(path.join('build', execLinux), path.join('build', 'linux', execLinux))
43 | fs.renameSync(path.join('build', execWin), path.join('build', 'win', execWin))
44 |
45 | let outputLinux = fs.createWriteStream(path.join(__dirname, 'dist', 'native-linux.zip'))
46 | let outputWin = fs.createWriteStream(path.join(__dirname, 'dist', 'native-windows.zip'))
47 |
48 | let archiveLinux = archiver('zip', {
49 | zlib: { level: 9 }
50 | })
51 |
52 | let archiveWin = archiver('zip', {
53 | zlib: { level: 9 }
54 | })
55 |
56 | outputLinux.on('close', () => finishLog('linux'))
57 | outputWin.on('close', () => finishLog('windows'))
58 |
59 | archiveLinux.on('warning', archiveWarn)
60 | archiveWin.on('warning', archiveWarn)
61 |
62 | archiveLinux.on('error', archiveError)
63 | archiveWin.on('error', archiveError)
64 |
65 | archiveLinux.pipe(outputLinux)
66 | archiveWin.pipe(outputWin)
67 |
68 | archiveLinux.directory(path.join('build', 'linux'), false)
69 | archiveWin.directory(path.join('build', 'win'), false)
70 |
71 | archiveLinux.finalize()
72 | archiveWin.finalize()
73 |
--------------------------------------------------------------------------------