@ormoshe/js-video-url-parser 0.5.17 → 0.5.19
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
CHANGED
|
@@ -1579,7 +1579,7 @@
|
|
|
1579
1579
|
|
|
1580
1580
|
Voomly.prototype.parseUrl = function(url) {
|
|
1581
1581
|
var match = url.match(
|
|
1582
|
-
/(?:v|embed)\/([
|
|
1582
|
+
/(?:v|embed)\/([\w-]+)/i
|
|
1583
1583
|
);
|
|
1584
1584
|
return match ? match[1] : undefined;
|
|
1585
1585
|
};
|
|
@@ -1859,6 +1859,47 @@
|
|
|
1859
1859
|
|
|
1860
1860
|
base.bind(new Streamable());
|
|
1861
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());
|
|
1902
|
+
|
|
1862
1903
|
var lib = base;
|
|
1863
1904
|
|
|
1864
1905
|
return lib;
|
|
@@ -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/lib/provider/voomly.js
CHANGED
package/package.json
CHANGED