mirror of https://github.com/calzoneman/sync.git
Add BitChute support
This commit is contained in:
parent
ba80c1591d
commit
16f183c117
|
@ -14,6 +14,7 @@ TYPE_MAP =
|
|||
sb: StreamablePlayer
|
||||
tc: TwitchClipPlayer
|
||||
cm: VideoJSPlayer
|
||||
bc: VideoJSPlayer
|
||||
pt: PeerPlayer
|
||||
|
||||
window.loadMediaPlayer = (data) ->
|
||||
|
|
|
@ -7,6 +7,7 @@ const mediaquery = require("@cytube/mediaquery");
|
|||
const YouTube = require("@cytube/mediaquery/lib/provider/youtube");
|
||||
const Vimeo = require("@cytube/mediaquery/lib/provider/vimeo");
|
||||
const PeerTube = require("@cytube/mediaquery/lib/provider/peertube");
|
||||
const BitChute = require("@cytube/mediaquery/lib/provider/bitchute");
|
||||
const Streamable = require("@cytube/mediaquery/lib/provider/streamable");
|
||||
const TwitchVOD = require("@cytube/mediaquery/lib/provider/twitch-vod");
|
||||
const TwitchClip = require("@cytube/mediaquery/lib/provider/twitch-clip");
|
||||
|
@ -387,6 +388,16 @@ var Getters = {
|
|||
}
|
||||
},
|
||||
|
||||
/* BitChute */
|
||||
bc: function (id, callback) {
|
||||
BitChute.lookup(id).then(video => {
|
||||
video = new Media(video.id, video.title, video.duration, "bc", video.meta);
|
||||
callback(null, video);
|
||||
}).catch(error => {
|
||||
callback(error.message || error);
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
|
|
@ -208,6 +208,8 @@
|
|||
case "pt":
|
||||
const [domain,uuid] = id.split(';');
|
||||
return `https://${domain}/videos/watch/${uuid}`;
|
||||
case "bc":
|
||||
return `https://www.bitchute.com/video/${id}/`;
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@ function formatURL(data) {
|
|||
} else {
|
||||
return `https://${data.meta.embed.domain}/w/${data.meta.embed.short}`;
|
||||
}
|
||||
case "bc":
|
||||
return `https://www.bitchute.com/video/${data.id}/`;
|
||||
default:
|
||||
return "#";
|
||||
}
|
||||
|
@ -1389,6 +1391,12 @@ function parseMediaLink(url) {
|
|||
if(data.pathname == '/open'){
|
||||
return { type: 'gd', id: data.searchParams.get('id') }
|
||||
}
|
||||
|
||||
case 'bitchute.com':
|
||||
if(data.pathname.startsWith('/video/')){
|
||||
return { type: 'bc', id: `${data.pathname.slice(7).split('/').shift()}` }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* PeerTubes */
|
||||
|
|
Loading…
Reference in New Issue