@ormoshe/js-video-url-parser 0.5.16 → 0.5.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsVideoUrlParser.js +42 -1
- package/lib/provider/bigcommand.js +42 -0
- package/lib/provider/bigcommand.ts +14 -0
- package/package.json +1 -1
package/dist/jsVideoUrlParser.js
CHANGED
|
@@ -1857,7 +1857,48 @@
|
|
|
1857
1857
|
return this.createUrl('https://streamable.com/', vi, params);
|
|
1858
1858
|
};
|
|
1859
1859
|
|
|
1860
|
-
base.bind(new
|
|
1860
|
+
base.bind(new Streamable());
|
|
1861
|
+
|
|
1862
|
+
var combineParams$m = util.combineParams;
|
|
1863
|
+
|
|
1864
|
+
function Bigcommand() {
|
|
1865
|
+
this.provider = 'bigcommand';
|
|
1866
|
+
this.defaultFormat = 'long';
|
|
1867
|
+
this.formats = {
|
|
1868
|
+
long: this.createLongUrl,
|
|
1869
|
+
};
|
|
1870
|
+
this.mediaTypes = {
|
|
1871
|
+
VIDEO: 'video',
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
Bigcommand.prototype.parse = function(url, params) {
|
|
1876
|
+
var match = url.match(
|
|
1877
|
+
/(?:watch)\/([\w-]+)/i
|
|
1878
|
+
);
|
|
1879
|
+
var result = {
|
|
1880
|
+
mediaType: this.mediaTypes.VIDEO,
|
|
1881
|
+
params: params,
|
|
1882
|
+
id: match[1]
|
|
1883
|
+
};
|
|
1884
|
+
return result.id ? result : undefined;
|
|
1885
|
+
};
|
|
1886
|
+
|
|
1887
|
+
Bigcommand.prototype.createUrl = function(baseUrl, vi, params) {
|
|
1888
|
+
if (!vi.id || vi.mediaType !== this.mediaTypes.VIDEO) {
|
|
1889
|
+
return undefined;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
var url = baseUrl + vi.library + '/' + vi.id;
|
|
1893
|
+
url += combineParams$m(params);
|
|
1894
|
+
return url;
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
Bigcommand.prototype.createLongUrl = function(vi, params) {
|
|
1898
|
+
return this.createUrl('https://adilo.bigcommand.com/watch/', vi, params);
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
base.bind(new Bigcommand());
|
|
1861
1902
|
|
|
1862
1903
|
var lib = base;
|
|
1863
1904
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const { combineParams } = require('../util');
|
|
2
|
+
|
|
3
|
+
function Bigcommand() {
|
|
4
|
+
this.provider = 'bigcommand';
|
|
5
|
+
this.defaultFormat = 'long';
|
|
6
|
+
this.formats = {
|
|
7
|
+
long: this.createLongUrl,
|
|
8
|
+
};
|
|
9
|
+
this.mediaTypes = {
|
|
10
|
+
VIDEO: 'video',
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = Bigcommand;
|
|
15
|
+
|
|
16
|
+
Bigcommand.prototype.parse = function(url, params) {
|
|
17
|
+
var match = url.match(
|
|
18
|
+
/(?:watch)\/([\w-]+)/i
|
|
19
|
+
);
|
|
20
|
+
var result = {
|
|
21
|
+
mediaType: this.mediaTypes.VIDEO,
|
|
22
|
+
params: params,
|
|
23
|
+
id: match[1]
|
|
24
|
+
};
|
|
25
|
+
return result.id ? result : undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
Bigcommand.prototype.createUrl = function(baseUrl, vi, params) {
|
|
29
|
+
if (!vi.id || vi.mediaType !== this.mediaTypes.VIDEO) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var url = baseUrl + vi.library + '/' + vi.id;
|
|
34
|
+
url += combineParams(params);
|
|
35
|
+
return url;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Bigcommand.prototype.createLongUrl = function(vi, params) {
|
|
39
|
+
return this.createUrl('https://adilo.bigcommand.com/watch/', vi, params);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
require('../base').bind(new Bigcommand());
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VideoInfo } from '../urlParser';
|
|
2
|
+
|
|
3
|
+
export interface BigcommandeUrlParameters {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type BigcommandeMediaTypes = 'video';
|
|
8
|
+
|
|
9
|
+
export interface BigcommandeVideoInfo extends VideoInfo<BigcommandeUrlParameters, BigcommandeMediaTypes> {
|
|
10
|
+
provider: 'bigcommande';
|
|
11
|
+
channel: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type VoomlyParseResult = BigcommandeVideoInfo | undefined;
|
package/package.json
CHANGED