Skip to content

Commit

Permalink
added archive.org (#679)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyhalight committed Jun 25, 2024
1 parent c6e0f01 commit 0c6d789
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 4 deletions.
1 change: 1 addition & 0 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ You can see all the restrictions related to site support in [wiki](https://githu
- **[Weverse](https://weverse.io/)**
- **[Egghead](https://egghead.io)**
- **[Youku](https://youku.com)**
- **[Archive.org](https://archive.org)**
- **[Newgrounds](https://newgrounds.com)**
- **[ProxiTok](https://proxitok.pabloferreiro.es/)**
- **[Invidious](https://yewtu.be)**
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
- **[Weverse](https://weverse.io/)**
- **[Egghead](https://egghead.io)**
- **[Youku](https://youku.com)**
- **[Archive.org](https://archive.org)**
- **[Newgrounds](https://newgrounds.com)**
- **[ProxiTok](https://proxitok.pabloferreiro.es/)**
- **[Invidious](https://yewtu.be)**
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# 1.x

- Добавлена поддержка Archive.org (#679)
- Теперь, при включенной опции "Не переводить с родного языка" проверяется соответствие только языка с которого переводится видео (ранее срабатывало только при одинаковой паре языков, например русский-русский, английкий-англиский и т.п.)
- Добавлена возможность выделения отдельных слов в субтитрах (#666)
- Добавлена поддержка VK Clips
Expand Down
3 changes: 2 additions & 1 deletion dist/vot-cloudflare-min.user.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/vot-cloudflare.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
// @match *://*.newgrounds.com/*
// @match *://*.egghead.io/*
// @match *://*.youku.com/*
// @match *://*.archive.org/*
// @match *://*/*.mp4*
// @exclude file://*/*.mp4*
// @connect yandex.ru
Expand Down Expand Up @@ -1436,6 +1437,9 @@ const getVideoId = (service, video) => {
return url.pathname.slice(1);
case "youku":
return url.pathname.match(/v_show\/id_[\w=]+/)?.[0];
case "archive": {
return url.pathname.match(/(details|embed)\/([^/]+)/)?.[2];
}
// case "sibnet": {
// const videoId = url.searchParams.get("videoid");
// if (videoId) {
Expand Down Expand Up @@ -4394,6 +4398,12 @@ const sites = () => {
match: /^v.youku.com$/,
selector: "#ykPlayer",
},
{
host: "archive",
url: "https://archive.org/details/",
match: /^archive.org$/,
selector: ".jw-media",
},
{
host: "directlink",
url: "stub", // This is a stub. The present value is set using window.location.origin. Check "src/index.js:videoObserver.onVideoAdded.addListener" to get more info
Expand Down Expand Up @@ -6290,6 +6300,7 @@ class VideoHandler {
"trovo",
"yandexdisk",
"coursehunter",
"archive",
"directlink",
].includes(this.site.host)
) {
Expand Down
3 changes: 2 additions & 1 deletion dist/vot-min.user.js

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/vot.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
// @match *://*.newgrounds.com/*
// @match *://*.egghead.io/*
// @match *://*.youku.com/*
// @match *://*.archive.org/*
// @match *://*/*.mp4*
// @exclude file://*/*.mp4*
// @connect yandex.ru
Expand Down Expand Up @@ -1670,6 +1671,9 @@ const getVideoId = (service, video) => {
return url.pathname.slice(1);
case "youku":
return url.pathname.match(/v_show\/id_[\w=]+/)?.[0];
case "archive": {
return url.pathname.match(/(details|embed)\/([^/]+)/)?.[2];
}
// case "sibnet": {
// const videoId = url.searchParams.get("videoid");
// if (videoId) {
Expand Down Expand Up @@ -4293,6 +4297,12 @@ const sites = () => {
match: /^v.youku.com$/,
selector: "#ykPlayer",
},
{
host: "archive",
url: "https://archive.org/details/",
match: /^archive.org$/,
selector: ".jw-media",
},
{
host: "directlink",
url: "stub", // This is a stub. The present value is set using window.location.origin. Check "src/index.js:videoObserver.onVideoAdded.addListener" to get more info
Expand Down Expand Up @@ -6180,6 +6190,7 @@ class VideoHandler {
"trovo",
"yandexdisk",
"coursehunter",
"archive",
"directlink",
].includes(this.site.host)
) {
Expand Down
6 changes: 6 additions & 0 deletions src/config/sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ const sites = () => {
match: /^v.youku.com$/,
selector: "#ykPlayer",
},
{
host: "archive",
url: "https://archive.org/details/",
match: /^archive.org$/,
selector: ".jw-media",
},
{
host: "directlink",
url: "stub", // This is a stub. The present value is set using window.location.origin. Check "src/index.js:videoObserver.onVideoAdded.addListener" to get more info
Expand Down
1 change: 1 addition & 0 deletions src/headers.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"*://*.newgrounds.com/*",
"*://*.egghead.io/*",
"*://*.youku.com/*",
"*://*.archive.org/*",
"*://*/*.mp4*"
],
"exclude": ["file://*/*.mp4*"],
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ class VideoHandler {
"trovo",
"yandexdisk",
"coursehunter",
"archive",
"directlink",
].includes(this.site.host)
) {
Expand Down
3 changes: 3 additions & 0 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ const getVideoId = (service, video) => {
return url.pathname.slice(1);
case "youku":
return url.pathname.match(/v_show\/id_[\w=]+/)?.[0];
case "archive": {
return url.pathname.match(/(details|embed)\/([^/]+)/)?.[2];
}
// case "sibnet": {
// const videoId = url.searchParams.get("videoid");
// if (videoId) {
Expand Down
13 changes: 13 additions & 0 deletions wiki/SITES-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,19 @@ Available (sub)domains:

- /v_show/VIDEO_ID

## Archive

Status: [] Working

Available (sub)domains:

- `archive.org`

Available (sub)domains:

- /details/VIDEO_ID
- /embed/VIDEO_ID

## Directlink

Status: [] Working
Expand Down
13 changes: 13 additions & 0 deletions wiki/SITES-RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,19 @@

- /v_show/VIDEO_ID

## Archive

Статус: [] Работает

Доступные (под)домены:

- `archive.org`

Доступные (под)домены:

- /details/VIDEO_ID
- /embed/VIDEO_ID

## Directlink

Статус: [] Работает
Expand Down
8 changes: 6 additions & 2 deletions wiki/gen-sites.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ const siteData = {
youku: {
paths: ["/v_show/VIDEO_ID"],
},
archive: {
paths: ["/details/VIDEO_ID", "/embed/VIDEO_ID"],
},
directlink: {
paths: ["/*.mp4"],
limits: [i18n.noLocalLinks],
Expand Down Expand Up @@ -338,20 +341,21 @@ function genMarkdown(sites, lang = "ru") {
const limitsData = hasData ? siteData[site.host].limits : [];
let limits = "";
if (limitsData?.length) {
limits = `\n\n${i18n.limitations[lang]}:\n- ${limitsData.map((limit) => limit[lang]).join("\n- ")}`;
limits = `\n\n${i18n.limitations[lang]}:\n\n- ${limitsData.map((limit) => limit[lang]).join("\n- ")}`;
}

const pathsData = hasData ? Array.from(siteData[site.host].paths) : [];
let paths = "";
if (pathsData.length) {
paths = `\n\n${i18n.availabledDomains[lang]}:\n- ${pathsData.join("\n- ")}`;
paths = `\n\n${i18n.availabledDomains[lang]}:\n\n- ${pathsData.join("\n- ")}`;
}

return `## ${ucFirst(site.host)}
${i18n.status[lang]}: [${site.status}] ${site.statusPhrase[lang]}
${i18n.availabledDomains[lang]}:
- ${site.domains}${paths}${limits}`;
});
}
Expand Down

0 comments on commit 0c6d789

Please sign in to comment.