Skip to content

Commit

Permalink
added poketube support
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Aug 6, 2024
1 parent 85eed86 commit 7bd3a05
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
sitesPiped,
sitesProxiTok,
sitesPeertube,
sitesPoketube,
} from "vot.js/alternativeUrls";

const repo =
Expand Down Expand Up @@ -50,7 +51,13 @@ export default (env) => {

function altUrlsToMatch() {
// autogenerating match list by alternative urls sites
return [sitesInvidious, sitesPiped, sitesProxiTok, sitesPeertube]
return [
sitesInvidious,
sitesPiped,
sitesProxiTok,
sitesPeertube,
sitesPoketube,
]
.map((sites) =>
sites.map((site) => {
const isSubdomain = site.match(/\./g)?.length > 1;
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# 1.6.x

- Добавлена поддержка Poketube (#726)
- Исправлена работа Peertube

# 1.6.0
Expand Down
7 changes: 6 additions & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/vot.user.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions patches/vot.js+1.0.1+013+added-poketube.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/node_modules/vot.js/dist/config/sites.js b/node_modules/vot.js/dist/config/sites.js
index 3e05f90..3f42407 100644
--- a/node_modules/vot.js/dist/config/sites.js
+++ b/node_modules/vot.js/dist/config/sites.js
@@ -37,6 +37,7 @@ export default [
host: VideoService.poketube,
url: "https://youtu.be/",
match: sitesPoketube,
+ selector: ".video-player-container",
},
{
additionalData: "mobile",
diff --git a/node_modules/vot.js/dist/utils/videoData.js b/node_modules/vot.js/dist/utils/videoData.js
index cade01f..5e0a547 100644
--- a/node_modules/vot.js/dist/utils/videoData.js
+++ b/node_modules/vot.js/dist/utils/videoData.js
@@ -261,7 +261,7 @@ export async function getVideoData(service, video) {
throw new VideoDataError(`Entered unsupported link: "${service.host}"`);
}
if (service.host === VideoService.peertube) {
- service.url = new URL(url).origin;
+ service.url = window.location.origin;
}
if (service.rawResult) {
return {
1 change: 1 addition & 0 deletions src/styles/components/segmented-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
&-label {
margin-left: 8px;
white-space: nowrap;
color: inherit;
}
}

Expand Down

0 comments on commit 7bd3a05

Please sign in to comment.