Skip to content

Commit

Permalink
hosts: Add peertube (#5065)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alice Ferrazzi authored and larsjohnsen committed Feb 7, 2019
1 parent d9d780d commit 40436d1
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions lib/modules/hosts/peertube.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* @flow */

import { Host } from '../../core/host';

export default new Host('peertube', {
name: 'peertube',
domains: [
'peervideo.net',
'peertube.social',
'peertube.mastodon.host',
'evertron.tv',
'mplayer.demouliere.eu',
'cloud.allplayer.tk',
'video.tedomum.net',
'peertube.fr',
'hostyour.tv',
'videobit.cc',
'videoshare.cc',
'peertube.openstreetmap.fr',
'video.ploud.fr',
'tube.kdy.ch',
'lostpod.space',
'pe.ertu.be',
'peertube.live',
'peer.tube',
'watching.cypherpunk.observer',
'queertube.org',
'exode.me',
'framatube.org',
],
attribution: false,
detect: ({ hostname, pathname }) => {
const [, route, , id] = pathname.split('/');
if (route === 'videos') {
return [hostname, id];
}
},
handleLink(href, [hostname, id]) {
const embed = `https://${hostname}/videos/embed/${id}`;
return {
type: 'IFRAME',
embed,
embedAutoplay: `${embed}?autoplay=true`,
fixedRatio: true,
};
},
});

0 comments on commit 40436d1

Please sign in to comment.