-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/promise-any-and-ytdl' into enhanced
Signed-off-by: Tianling Shen <[email protected]>
- Loading branch information
Showing
6 changed files
with
92 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = tab | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
# Use 4 spaces for the Python files | ||
[*.py] | ||
indent_size = 4 | ||
max_line_length = 80 | ||
|
||
# The JSON files contain newlines inconsistently | ||
[*.json] | ||
insert_final_newline = ignore | ||
|
||
# Minified JavaScript files shouldn't be changed | ||
[**.min.js] | ||
indent_style = ignore | ||
insert_final_newline = ignore | ||
|
||
# Makefiles always use tabs for indentation | ||
[Makefile] | ||
indent_style = tab | ||
|
||
# Batch files use tabs for indentation | ||
[*.bat] | ||
indent_style = tab | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const DEFAULT_SOURCE = ["netease", "kuwo", "migu", "bilibili", "pyncmd"]; | ||
const PROVIDERS = { | ||
netease: require('./provider/netease'), | ||
qq: require('./provider/netease'), | ||
baidu: require('./provider/baidu'), | ||
kugou: require('./provider/kugou'), | ||
kuwo: require('./provider/kuwo'), | ||
migu: require('./provider/migu'), | ||
joox: require('./provider/joox'), | ||
youtube: require('./provider/youtube'), | ||
bilibili: require('./provider/bilibili'), | ||
pyncmd: require('./provider/pyncmd') | ||
} | ||
|
||
module.exports = { | ||
DEFAULT_SOURCE, | ||
PROVIDERS, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Polyfills | ||
*/ | ||
|
||
/** | ||
* The polyfill of Promise.any. | ||
* | ||
* commit e1e75a1410490906d2da1bda0d4aafb1788f2195 | ||
* file index.js | ||
* | ||
* Thanks to https://github.com/ungap/promise-any | ||
*/ | ||
Promise.any = (Promise.any || function ($) { | ||
return new Promise(function (D, E, A, L) { | ||
A = []; | ||
L = $.map(function ($, i) { | ||
return Promise.resolve($).then(D, function (O) { | ||
return ((A[i] = O), --L) || E({ errors: A }); | ||
}); | ||
}).length; | ||
}); | ||
}).bind(Promise); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters