Merge pull request #530 from movie-web/dev

Bump version
This commit is contained in:
William Oldham 2023-12-15 22:37:36 +00:00 committed by GitHub
commit 295ccba292
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
493 changed files with 26671 additions and 22002 deletions

View file

@ -8,26 +8,34 @@ const a11yOff = Object.keys(require("eslint-plugin-jsx-a11y").rules).reduce(
module.exports = {
env: {
browser: true,
browser: true
},
extends: [
"airbnb",
"airbnb/hooks",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:prettier/recommended"
],
ignorePatterns: [
"public/*",
"dist/*",
"/*.js",
"/*.ts",
"/plugins/*.ts",
"/plugins/*.mjs",
"/themes/**/*.ts"
],
ignorePatterns: ["public/*", "dist/*", "/*.js", "/*.ts"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
tsconfigRootDir: "./",
tsconfigRootDir: "./"
},
settings: {
"import/resolver": {
typescript: {
project: "./tsconfig.json",
},
},
project: "./tsconfig.json"
}
}
},
plugins: ["@typescript-eslint", "import", "prettier"],
rules: {
@ -37,7 +45,7 @@ module.exports = {
"react/destructuring-assignment": "off",
"no-underscore-dangle": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-console": "off",
"no-console": ["warn", { allow: ["warn", "error", "debug", "info"] }],
"@typescript-eslint/no-this-alias": "off",
"import/prefer-default-export": "off",
"@typescript-eslint/no-empty-function": "off",
@ -52,18 +60,19 @@ module.exports = {
"no-await-in-loop": "off",
"no-nested-ternary": "off",
"prefer-destructuring": "off",
"no-param-reassign": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"react/jsx-filename-extension": [
"error",
{ extensions: [".js", ".tsx", ".jsx"] },
{ extensions: [".js", ".tsx", ".jsx"] }
],
"import/extensions": [
"error",
"ignorePackages",
{
ts: "never",
tsx: "never",
},
tsx: "never"
}
],
"import/order": [
"error",
@ -74,14 +83,14 @@ module.exports = {
"internal",
["sibling", "parent"],
"index",
"unknown",
"unknown"
],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
caseInsensitive: true
}
}
],
"sort-imports": [
"error",
@ -90,9 +99,9 @@ module.exports = {
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
allowSeparatedGroups: true,
},
allowSeparatedGroups: true
}
],
...a11yOff,
},
...a11yOff
}
};

View file

@ -85,28 +85,10 @@ Here are some tips to make sure that your pull requests are :pinched_fingers: fi
### Language Contributions
Language contributions help movie-web massively, allowing people worldwide to use our app!
Like most apps, our translations are stored in `.json` files. Each language string has a unique key (For example, `notFound.genericTitle`) that references a language string in the appropriate language file.
We use weblate for crowdsourcing our translations. [Click here to go to our translation tool.](https://weblate.movie-web.app/projects/movie-web/website/)
Each language file is called `translation.json` and is stored in the `src/setup/languages/<language code>/` folder. For example, the English language file is located at `src/setup/languages/en/translation.json`.
> **Warning**
>
> Before you start a translation, please:
> - Check there isn't an existing GitHub [issue](https://github.com/movie-web/movie-web/issues) or [pull request](https://github.com/movie-web/movie-web/pulls) open for the language.
> - Make sure we aren't in the middle of a new feature update. When releasing major versions, we only accept changes to translations once the new version is complete. Otherwise, the language files would need to be updated.
>
> Please speak to us before starting a language PR. We want to use your time effectively.
To make a translation:
- Copy the `en` folder inside the `src/setup/languages` folder
- Rename the copied folder to the 2-letter code for the country/language which is being translated.
- [Click this link to see a list of codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Use the codes in the `639-1` column!
- For example, Arabic is `ar`
- Edit the language strings inside the `translation.json` file
- **Do not** edit the keys. Only edit the values.
- e.g. in `"stopEditing": "Stop editing",` - only change the `Stop editing` part, not the `stopEditing` part.
- In the `src/setup/i18n.ts` file:
- Import your new translation file, e.g. `import ar from "./locales/ar/translation.json";`
- Add your translation to the `locales` object (Look at other languages for an example)
Once you have completed your translation, please open a pull request. We do not accept partial translations, so please ensure every language string is translated to the intended language.
1. First make sure you make an account. (click the link above)
2. Click the language you want to help translate, if it's not listed you can click the plus top left to add a new language.
3. In the top right of the screen, click "translate"
4. Here you will be prompted a key to translate, fill in a translation and proceed to the next item by pressing "save and continue".
5. Thats all there is to it, every translation will eventually come through and be pushed with an update. This usually doesn't take longer than a week.

11
.github/logo-dark.svg vendored Normal file
View file

@ -0,0 +1,11 @@
<svg width="2147" height="1121" viewBox="0 0 2147 1121" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1663.06 591.678H1719.49C1745.2 591.678 1763.85 595.357 1775.42 602.716C1787.08 609.992 1792.91 621.609 1792.91 637.566C1792.91 648.398 1790.35 657.286 1785.22 664.231C1780.18 671.177 1773.44 675.352 1765.01 676.758V677.998C1776.5 680.561 1784.77 685.357 1789.81 692.385C1794.94 699.413 1797.5 708.756 1797.5 720.414C1797.5 736.951 1791.51 749.849 1779.52 759.109C1767.61 768.37 1751.4 773 1730.9 773H1663.06V591.678ZM1701.51 663.487H1723.83C1734.25 663.487 1741.77 661.875 1746.4 658.65C1751.12 655.426 1753.47 650.093 1753.47 642.651C1753.47 635.706 1750.91 630.745 1745.78 627.769C1740.74 624.709 1732.72 623.18 1721.72 623.18H1701.51V663.487ZM1701.51 693.997V741.25H1726.56C1737.14 741.25 1744.96 739.224 1750 735.173C1755.04 731.121 1757.56 724.92 1757.56 716.569C1757.56 701.521 1746.82 693.997 1725.32 693.997H1701.51Z" fill="white"/>
<path d="M1625.11 773H1520.68V591.678H1625.11V623.18H1559.13V662.991H1620.52V694.493H1559.13V741.25H1625.11V773Z" fill="white"/>
<path d="M1451.72 773H1407.94L1383.39 677.75C1382.48 674.36 1380.91 667.373 1378.67 656.79C1376.52 646.124 1375.28 638.972 1374.95 635.334C1374.46 639.799 1373.22 646.992 1371.23 656.914C1369.25 666.753 1367.72 673.781 1366.64 677.998L1342.21 773H1298.55L1252.29 591.678H1290.12L1313.31 690.648C1317.36 708.921 1320.3 724.755 1322.12 738.149C1322.61 733.437 1323.73 726.16 1325.47 716.321C1327.29 706.399 1328.98 698.71 1330.55 693.253L1356.97 591.678H1393.31L1419.72 693.253C1420.88 697.8 1422.33 704.746 1424.07 714.089C1425.8 723.432 1427.12 731.452 1428.03 738.149C1428.86 731.7 1430.18 723.68 1432 714.089C1433.82 704.415 1435.48 696.602 1436.96 690.648L1460.03 591.678H1497.86L1451.72 773Z" fill="white"/>
<path d="M1178 720.414V689.408H1244.6V720.414H1178Z" fill="white"/>
<path d="M1155.31 773H1050.88V591.678H1155.31V623.18H1089.33V662.991H1150.72V694.493H1089.33V741.25H1155.31V773Z" fill="white"/>
<path d="M966.791 773V591.678H1005.24V773H966.791Z" fill="white"/>
<path d="M905.027 591.678H943.847L882.207 773H840.287L778.771 591.678H817.591L851.697 699.578C853.599 705.945 855.542 713.386 857.526 721.902C859.593 730.336 860.875 736.206 861.371 739.514C862.281 731.907 865.381 718.595 870.673 699.578L905.027 591.678Z" fill="white"/>
<path d="M764.012 682.091C764.012 712.104 756.57 735.173 741.688 751.296C726.805 767.419 705.473 775.48 677.691 775.48C649.91 775.48 628.578 767.419 613.695 751.296C598.812 735.173 591.371 712.022 591.371 681.843C591.371 651.664 598.812 628.637 613.695 612.762C628.661 596.804 650.076 588.825 677.939 588.825C705.803 588.825 727.094 596.845 741.812 612.886C756.612 628.926 764.012 651.994 764.012 682.091ZM631.679 682.091C631.679 702.348 635.523 717.603 643.213 727.855C650.902 738.108 662.395 743.234 677.691 743.234C708.367 743.234 723.704 722.853 723.704 682.091C723.704 641.246 708.449 620.823 677.939 620.823C662.643 620.823 651.109 625.991 643.337 636.326C635.565 646.579 631.679 661.834 631.679 682.091Z" fill="white"/>
<path d="M436.591 773L392.935 630.745H391.818C393.389 659.684 394.175 678.99 394.175 688.664V773H359.82V591.678H412.158L455.07 730.336H455.814L501.331 591.678H553.669V773H517.826V687.176C517.826 683.124 517.868 678.453 517.95 673.161C518.116 667.869 518.694 653.813 519.687 630.993H518.57L471.813 773H436.591Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

11
.github/logo-light.svg vendored Normal file
View file

@ -0,0 +1,11 @@
<svg width="2147" height="1121" viewBox="0 0 2147 1121" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1663.06 599.678H1719.49C1745.2 599.678 1763.85 603.357 1775.42 610.716C1787.08 617.992 1792.91 629.609 1792.91 645.566C1792.91 656.398 1790.35 665.286 1785.22 672.231C1780.18 679.177 1773.44 683.352 1765.01 684.758V685.998C1776.5 688.561 1784.77 693.357 1789.81 700.385C1794.94 707.413 1797.5 716.756 1797.5 728.414C1797.5 744.951 1791.51 757.849 1779.52 767.109C1767.61 776.37 1751.4 781 1730.9 781H1663.06V599.678ZM1701.51 671.487H1723.83C1734.25 671.487 1741.77 669.875 1746.4 666.65C1751.12 663.426 1753.47 658.093 1753.47 650.651C1753.47 643.706 1750.91 638.745 1745.78 635.769C1740.74 632.709 1732.72 631.18 1721.72 631.18H1701.51V671.487ZM1701.51 701.997V749.25H1726.56C1737.14 749.25 1744.96 747.224 1750 743.173C1755.04 739.121 1757.56 732.92 1757.56 724.569C1757.56 709.521 1746.82 701.997 1725.32 701.997H1701.51Z" fill="black"/>
<path d="M1625.11 781H1520.68V599.678H1625.11V631.18H1559.13V670.991H1620.52V702.493H1559.13V749.25H1625.11V781Z" fill="black"/>
<path d="M1451.72 781H1407.94L1383.39 685.75C1382.48 682.36 1380.91 675.373 1378.67 664.79C1376.52 654.124 1375.28 646.972 1374.95 643.334C1374.46 647.799 1373.22 654.992 1371.23 664.914C1369.25 674.753 1367.72 681.781 1366.64 685.998L1342.21 781H1298.55L1252.29 599.678H1290.12L1313.31 698.648C1317.36 716.921 1320.3 732.755 1322.12 746.149C1322.61 741.437 1323.73 734.16 1325.47 724.321C1327.29 714.399 1328.98 706.71 1330.55 701.253L1356.97 599.678H1393.31L1419.72 701.253C1420.88 705.8 1422.33 712.746 1424.07 722.089C1425.8 731.432 1427.12 739.452 1428.03 746.149C1428.86 739.7 1430.18 731.68 1432 722.089C1433.82 712.415 1435.48 704.602 1436.96 698.648L1460.03 599.678H1497.86L1451.72 781Z" fill="black"/>
<path d="M1178 728.414V697.408H1244.6V728.414H1178Z" fill="black"/>
<path d="M1155.31 781H1050.88V599.678H1155.31V631.18H1089.33V670.991H1150.72V702.493H1089.33V749.25H1155.31V781Z" fill="black"/>
<path d="M966.791 781V599.678H1005.24V781H966.791Z" fill="black"/>
<path d="M905.027 599.678H943.847L882.207 781H840.287L778.771 599.678H817.591L851.697 707.578C853.599 713.945 855.542 721.386 857.526 729.902C859.593 738.336 860.875 744.206 861.371 747.514C862.281 739.907 865.381 726.595 870.673 707.578L905.027 599.678Z" fill="black"/>
<path d="M764.012 690.091C764.012 720.104 756.57 743.173 741.688 759.296C726.805 775.419 705.473 783.48 677.691 783.48C649.91 783.48 628.578 775.419 613.695 759.296C598.812 743.173 591.371 720.022 591.371 689.843C591.371 659.664 598.812 636.637 613.695 620.762C628.661 604.804 650.076 596.825 677.939 596.825C705.803 596.825 727.094 604.845 741.812 620.886C756.612 636.926 764.012 659.994 764.012 690.091ZM631.679 690.091C631.679 710.348 635.523 725.603 643.213 735.855C650.902 746.108 662.395 751.234 677.691 751.234C708.367 751.234 723.704 730.853 723.704 690.091C723.704 649.246 708.449 628.823 677.939 628.823C662.643 628.823 651.109 633.991 643.337 644.326C635.565 654.579 631.679 669.834 631.679 690.091Z" fill="black"/>
<path d="M436.591 781L392.935 638.745H391.818C393.389 667.684 394.175 686.99 394.175 696.664V781H359.82V599.678H412.158L455.07 738.336H455.814L501.331 599.678H553.669V781H517.826V695.176C517.826 691.124 517.868 686.453 517.95 681.161C518.116 675.869 518.694 661.813 519.687 638.993H518.57L471.813 781H436.591Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -6,49 +6,92 @@ on:
- master
jobs:
build:
name: Build
build_pwa:
name: Build PWA
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install pnpm packages
run: pnpm install
- name: Build project
run: pnpm run build:pwa
- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: pwa
path: ./dist
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install Yarn packages
run: yarn install
cache: 'pnpm'
- name: Install pnpm packages
run: pnpm install
- name: Build project
run: yarn build
run: pnpm run build
- name: Upload production-ready build files
uses: actions/upload-artifact@v3
with:
name: production-files
name: normal
path: ./dist
release:
name: Release
needs: build
needs: [build, build_pwa]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download artifact
- name: Download PWA artifact
uses: actions/download-artifact@v3
with:
name: production-files
path: ./dist
name: pwa
path: ./dist_pwa
- name: Zip files
run: cd dist && zip -r ../movie-web.zip .
- name: Zip PWA files
run: cd dist_pwa && zip -r ../movie-web.pwa.zip .
- name: Download normal artifact
uses: actions/download-artifact@v3
with:
name: normal
path: ./dist_normal
- name: Zip normal files
run: cd dist_normal && zip -r ../movie-web.zip .
- name: Get version
id: package-version
@ -65,7 +108,18 @@ jobs:
draft: false
prerelease: false
- name: Upload Release Asset
- name: Upload release (PWA)
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./movie-web.pwa.zip
asset_name: movie-web.pwa.zip
asset_content_type: application/zip
- name: Upload Release (Normal)
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:

View file

@ -15,18 +15,22 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Install Yarn packages
run: yarn install
cache: 'pnpm'
- name: Install pnpm packages
run: pnpm install
- name: Run ESLint
run: yarn lint
run: pnpm run lint
building:
name: Build project
@ -36,14 +40,18 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache: 'pnpm'
- name: Install Yarn packages
run: yarn install
- name: Install pnpm packages
run: pnpm install
- name: Build Project
run: yarn build
run: pnpm run build

4
.gitignore vendored
View file

@ -20,9 +20,9 @@ dev-dist
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# other package managers
yarn.lock
package-lock.json
# config

1
.npmrc Normal file
View file

@ -0,0 +1 @@
shamefully-hoist=true

View file

@ -4,5 +4,8 @@
"eslint.format.enable": true,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
}
}

122
README.md
View file

@ -1,81 +1,95 @@
<h1>movie-web</h1>
<p align="center"><img align="center" width="280" src="./.github/logo-dark.svg#gh-dark-mode-only"/></p>
<p align="center"><img align="center" width="280" src="./.github/logo-light.svg#gh-light-mode-only"/></p>
<p align="center">
<a href="https://github.com/movie-web/movie-web/actions"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/movie-web/movie-web/deploying.yml?branch=master&style=flat-square"></a>
<a href="https://github.com/movie-web/movie-web/blob/master/LICENSE.md"><img alt="GitHub license" src="https://img.shields.io/github/license/movie-web/movie-web?style=flat-square"></a>
<a href="https://github.com/movie-web/movie-web/network"><img alt="GitHub forks" src="https://img.shields.io/github/forks/movie-web/movie-web?style=flat-square"></a>
<a href="https://github.com/movie-web/movie-web/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/movie-web/movie-web?style=flat-square"></a><br/>
<a href="https://discord.movie-web.app"><img src="https://discord.com/api/guilds/871713465100816424/widget.png?style=banner2" alt="Discord Server"></a>
<img src="https://skillicons.dev/icons?i=react,vite,ts" />
<br/>
<a href="https://discord.movie-web.app"><kbd>🔵 discord</kbd></a> <a href="https://movie-web.app"><kbd>🟢 website</kbd></a>
</p>
<br/><br/>
movie-web is a web app for watching movies easily. Check it out at **[movie-web.app](https://movie-web.app)**.
# ⚡What is movie-web?
movie-web is a web app for watching movies easily. Check it out at <a href="https://movie-web.app"><kbd>movie-web.app</kbd></a>.
This service works by displaying video files from third-party providers inside an intuitive and aesthetic user interface.
Features include:
# 🔥Features
- 🕑 Saving of your progress so you can come back to a video at any time!
- 🔖 Bookmarks to keep track of videos you would like to watch.
- 🎞️ Easy switching between seasons and episodes for a TV series; binge away!
- ✖️ Supports multiple types of content including movies, TV shows and Anime (coming soon™)
- Automatic saving of progress - optionally synced to an account.
- Bookmark shows or movies, keep track of what you want to watch.
- Minimalistic interface that only shows whats required - no algorithm to consume you.
## Goals of movie-web
## 🍄 Philosophy
- No ads
- No BS: just a search bar and a video player
- No responsibility on the hoster, no databases or api's hosted by us, just a static site
This project is meant to be simple and easy to use. Keep features minimal but polished.
We do not want this project to be yet another bulky streaming site, instead it aims for minimalism.
## Self-hosting
On top of that, hosting should be as cheap and simple as possible. Just a static website with a proxy, with an optional backend if you want cross-device syncing.
A simple guide has been written to assist in hosting your own instance of movie-web.
Content is fetched from third parties and scraping is done fully done on the client. This means that the hoster has no files or media on their server. All files are streamed directly from the third parties.
Check it out here: [https://github.com/movie-web/movie-web/blob/dev/SELFHOSTING.md](https://github.com/movie-web/movie-web/blob/dev/SELFHOSTING.md)
## ⚠️ Limitations
## Running locally for development
- Due to being a static site, there can be no SSR
- To keep it cheap to host, amount of proxied requests need to be kept to a minimum
- Also to keep it cheap, no content must ever be streamed through the proxy. So only streams not protected by CORS headers.
To run this project locally for contributing or testing, run the following commands:
<h5><b>note: must use yarn to install packages and run NodeJS 16</b></h5>
# 🧬 Running locally for development
To run locally, you must first clone the repository. After that run the following commands in the root of the repository:
```bash
git clone https://github.com/movie-web/movie-web
cd movie-web
yarn install
yarn dev
pnpm install
pnpm run dev
```
To build production files, simply run `yarn build`.
You have to also make an `.env` file to configure your environment. Inspire it from the content of `example.env`.
You'll need to deploy a cloudflare service worker as well. Check the [selfhosting guide](https://github.com/movie-web/movie-web/blob/dev/SELFHOSTING.md) on how to run the service worker. Afterwards you can make a `.env` file and put in the URL. (see `example.env` for an example)
To build production files, run:
```bash
pnpm build
```
<h2>Contributing - <a href="https://github.com/movie-web/movie-web/issues"><img alt="GitHub issues" src="https://img.shields.io/github/issues/movie-web/movie-web?style=flat-square"></a>
<a href="https://github.com/movie-web/movie-web/pulls"><img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/movie-web/movie-web?style=flat-square"></a></h2>
> [!TIP]
> You must use pnpm (`npm i -g pnpm`) and run NodeJS 20
Check out [this project's issues](https://github.com/movie-web/movie-web/issues) for inspiration for contribution. Pull requests are always welcome.
# 🥔 Selfhosting
**All pull requests must be merged into the `dev` branch. it will then be deployed with the next version**
A simple guide has been written to assist in hosting your own instance of movie-web. Check it out below
## Credits
|[Selfhosting guide](https://docs.movie-web.app)|
|---|
# 🤝 Contributors
This project would not be possible without our amazing contributors and the community.
<a href="https://github.com/movie-web/movie-web/graphs/contributors"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/movie-web/movie-web?style=flat-square"></a>
<div style="display:flex;align-items:center;grid-gap:10px">
<img src="https://github.com/JamesHawkinss.png?size=20" width="20"><span><a href="https://github.com/JamesHawkinss">@JamesHawkinss</a> for original concept.</span>
</div>
<div style="display:flex;align-items:center;grid-gap:10px">
<img src="https://github.com/JipFr.png?size=20" width="20"><span><a href="https://github.com/JipFr">@JipFr</a> for initial work on <a href="https://github.com/JipFr/movie-cli">movie-cli</a>.</span>
</div>
<div style="display:flex;align-items:center;grid-gap:10px">
<img src="https://github.com/mrjvs.png?size=20" width="20"><span><a href="https://github.com/mrjvs">@mrjvs</a> for leading the port to React, and for the beautiful design.</span>
</div>
<div style="display:flex;align-items:center;grid-gap:10px">
<img src="https://github.com/binaryoverload.png?size=20" width="20"><span><a href="https://github.com/binaryoverload">@binaryoverload</a> for help rewriting the application into React and making the README look ✨ pretty ✨.</span>
</div>
<div style="display:flex;align-items:center;grid-gap:10px">
<img src="https://github.com/lem6ns.png?size=20" width="20"><span><a href="https://github.com/lem6ns">@lem6ns</a> for helpfully implementing extra scrapers.</span>
</div>
<table>
<tbody>
<tr>
<td align="center" valign="top" width="100px">
<img src="https://images.weserv.nl/?url=https://github.com/JamesHawkinss.png&mask=circle"/><br />
<sub><a href="https://github.com/JamesHawkinss">@JamesHawkinss</a></sub>
</td>
<td align="center" valign="top" width="100px">
<img src="https://images.weserv.nl/?url=https://github.com/JipFr.png&mask=circle"/><br />
<sub><a href="https://github.com/JipFr">@JipFr</a></sub>
</td>
<td align="center" valign="top" width="100px">
<img src="https://images.weserv.nl/?url=https://github.com/mrjvs.png&mask=circle"/><br />
<sub><a href="https://github.com/mrjvs">@mrjvs</a></sub>
</td>
<td align="center" valign="top" width="100px">
<img src="https://images.weserv.nl/?url=https://github.com/binaryoverload.png&mask=circle"/><br />
<sub><a href="https://github.com/binaryoverload">@binaryoverload</a></sub>
</td>
</tr>
<tr>
<td align="center" valign="top" width="100px">
<img src="https://images.weserv.nl/?url=https://github.com/lem6ns.png&mask=circle"/><br />
<sub><a href="https://github.com/lem6ns">@lem6ns</a></sub>
</td>
</tr>
</tbody>
</table>

View file

@ -1,41 +0,0 @@
# Self-hosting tutorial
> **Note**
> We **do not** provide support on how to self-host. If you can't figure it out then tough luck. Please do not make GitHub issues or ask in our Discord server for support on how to self-host.
So you would like to self-host. This app is made of two parts:
- The proxy
- The client
## Hosting the proxy
The proxy is made as a Cloudflare worker. Cloudflare has a generous free plan, so you don't need to pay anything unless you get hundreds of users.
1. Create a Cloudflare account at [https://dash.cloudflare.com](https://dash.cloudflare.com).
2. Navigate to `Workers`.
3. If it asks you, choose a subdomain.
4. If it asks for a workers plan, press "Continue with free".
5. Create a new service with a name of your choice. Must be type `HTTP handler`.
6. On the service page, Click `Quick edit`.
7. Remove the template code in the quick edit window.
7. Download the `worker.js` file from the latest release of the proxy: [https://github.com/movie-web/simple-proxy/releases/latest](https://github.com/movie-web/simple-proxy/releases/latest).
8. Open the downloaded `worker.js` file in Notepad, Visual Studio Code or similar.
9. Copy the text contents of the `worker.js` file.
10. Paste the text contents into the edit screen of the Cloudflare service worker.
11. Click `Save and deploy` and confirm.
Your proxy is now hosted on Cloudflare. Note the url of your worker as you will need it later.
## Hosting the client
1. Download the file `movie-web.zip` from the latest release: [https://github.com/movie-web/movie-web/releases/latest](https://github.com/movie-web/movie-web/releases/latest).
2. Extract the zip file so you can edit the files.
3. Open `config.js` in Notepad, Visual Studio Code or similar.
4. Put your Cloudflare proxy URL in-between the double quotes of `VITE_CORS_PROXY_URL: ""`. Make sure to not have a slash at the end of your URL.
Example (THIS IS AN EXAMPLE, IT WON'T WORK FOR YOU): `VITE_CORS_PROXY_URL: "https://test-proxy.test.workers.dev"`
5. Put your TMDB read access token inside the quotes of `VITE_TMDB_READ_API_KEY: ""`. You can generate it for free at [https://www.themoviedb.org/settings/api](https://www.themoviedb.org/settings/api).
6. Save the file
Your client has now been prepared, you can now host it with any static website hosting (Common ones include [GitHub Pages](https://pages.github.com/), [Netlify](https://www.netlify.com/) and [Vercel](https://vercel.com/) but any will work!).
It doesn't require PHP, it's just a standard static page.

View file

@ -1,10 +1,15 @@
FROM node:16.15-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package*.json ./
RUN yarn install
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY package.json ./
COPY pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY . ./
RUN yarn build
RUN pnpm run build
# production environment
FROM nginx:stable-alpine

View file

@ -1,3 +1,8 @@
VITE_TMDB_READ_API_KEY=...
VITE_OPENSEARCH_ENABLED=false
# make sure the cors proxy url does NOT have a slash at the end
VITE_CORS_PROXY_URL=...
VITE_TMDB_READ_API_KEY=...
# make sure the domain does NOT have a slash at the end
VITE_APP_DOMAIN=http://localhost:5173

View file

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=1.0, user-scalable=no" />
<meta
name="description"
content="The place for your favourite movies & shows"
@ -19,11 +19,11 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap"
href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap"
rel="stylesheet"
/>
<script src="config.js"></script>
<script src="/config.js"></script>
<script src="https://cdn.jsdelivr.net/gh/movie-web/6C6F6C7A@8b821f445b83d51ef1b8f42c99b7346f6b47dce5/out.js"></script>
<!-- prevent darkreader extension from messing with our already dark site -->
@ -33,6 +33,28 @@
<meta name="referrer" content="no-referrer" />
<title>movie-web</title>
{{#if opensearchEnabled }}
<!-- OpenSearch -->
<link rel="search" type="application/opensearchdescription+xml" title="movie-web" href="/opensearch.xml">
<!-- Google Sitelinks -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "{{ routeDomain }}",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "{{ routeDomain }}/browse/?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}
</script>
{{/if}}
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View file

@ -1,48 +1,18 @@
{
"name": "movie-web",
"version": "3.2.6",
"version": "4.0.0",
"private": true,
"homepage": "https://movie-web.app",
"dependencies": {
"@formkit/auto-animate": "^1.0.0-beta.5",
"@headlessui/react": "^1.5.0",
"@react-spring/web": "^9.7.1",
"@sentry/integrations": "^7.49.0",
"@sentry/react": "^7.49.0",
"@use-gesture/react": "^10.2.24",
"core-js": "^3.29.1",
"crypto-js": "^4.1.1",
"dompurify": "^3.0.1",
"fscreen": "^1.2.0",
"fuse.js": "^6.4.6",
"hls.js": "^1.0.7",
"i18next": "^22.4.5",
"i18next-browser-languagedetector": "^7.0.1",
"json5": "^2.2.0",
"lodash.throttle": "^4.1.1",
"nanoid": "^4.0.0",
"ofetch": "^1.0.0",
"pako": "^2.1.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-ga4": "^2.0.0",
"react-helmet": "^6.1.0",
"react-i18next": "^12.1.1",
"react-router-dom": "^5.2.0",
"react-stickynode": "^4.1.0",
"react-transition-group": "^4.4.5",
"react-use": "^17.4.0",
"subsrt-ts": "^2.1.1",
"unpacker": "^1.0.1"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"build:pwa": "cross-env VITE_PWA_ENABLED=true vite build",
"test": "vitest run",
"preview": "vite preview",
"lint": "eslint --ext .tsx,.ts src",
"lint:fix": "eslint --fix --ext .tsx,.ts src",
"lint:report": "eslint --ext .tsx,.ts --output-file eslint_report.json --format json src"
"lint:report": "eslint --ext .tsx,.ts --output-file eslint_report.json --format json src",
"preinstall": "npx -y only-allow pnpm"
},
"browserslist": {
"production": [
@ -55,15 +25,51 @@
"last 1 safari version"
]
},
"dependencies": {
"@formkit/auto-animate": "^0.7.0",
"@headlessui/react": "^1.5.0",
"@movie-web/providers": "^1.1.5",
"@noble/hashes": "^1.3.2",
"@react-spring/web": "^9.7.1",
"@scure/bip39": "^1.2.1",
"@sozialhelden/ietf-language-tags": "^5.4.2",
"@types/node-forge": "^1.3.8",
"classnames": "^2.3.2",
"core-js": "^3.29.1",
"dompurify": "^3.0.1",
"flag-icons": "^6.11.1",
"focus-trap-react": "^10.2.3",
"fscreen": "^1.2.0",
"fuse.js": "^6.4.6",
"hls.js": "^1.0.7",
"i18next": "^22.4.5",
"immer": "^10.0.2",
"iso-639-1": "^3.1.0",
"lodash.isequal": "^4.5.0",
"node-forge": "^1.3.1",
"ofetch": "^1.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-ga4": "^2.0.0",
"react-google-recaptcha-v3": "^1.10.1",
"react-helmet-async": "^1.3.0",
"react-i18next": "^12.1.1",
"react-router-dom": "^5.2.0",
"react-sticky-el": "^2.1.0",
"react-use": "^17.4.0",
"slugify": "^1.6.6",
"subsrt-ts": "^2.1.1",
"zustand": "^4.3.9"
},
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.21.0",
"@tailwindcss/line-clamp": "^0.4.2",
"@types/chromecast-caf-sender": "^1.0.5",
"@types/crypto-js": "^4.1.1",
"@types/dompurify": "^2.4.0",
"@types/fscreen": "^1.0.1",
"@types/lodash.isequal": "^4.5.8",
"@types/lodash.throttle": "^4.1.7",
"@types/node": "^17.0.15",
"@types/pako": "^2.0.0",
@ -78,6 +84,7 @@
"@typescript-eslint/parser": "^5.13.0",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.13",
"cross-env": "^7.0.3",
"eslint": "^8.10.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "^8.6.0",
@ -87,19 +94,30 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "7.29.4",
"eslint-plugin-react-hooks": "4.3.0",
"glob": "^10.3.3",
"handlebars": "^4.7.7",
"jsdom": "^21.1.0",
"postcss": "^8.4.20",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.7",
"tailwind-scrollbar": "^2.0.1",
"tailwindcss": "^3.2.4",
"tailwindcss-themer": "^3.1.0",
"type-fest": "^4.3.3",
"typescript": "^4.6.4",
"vite": "^4.0.1",
"vite": "^4.4.12",
"vite-plugin-checker": "^0.5.6",
"vite-plugin-package-version": "^1.0.2",
"vite-plugin-pwa": "^0.14.4",
"vitest": "^0.28.5",
"workbox-build": "^6.5.4",
"workbox-window": "^6.5.4"
"vite-plugin-pwa": "^0.16.5",
"vite-plugin-static-copy": "^0.16.0",
"vitest": "^0.28.5"
},
"pnpm": {
"overrides": {
"get-func-name@<2.0.1": ">=2.0.1",
"postcss@<8.4.31": ">=8.4.31",
"@babel/traverse@<7.23.2": ">=7.23.2",
"crypto-js@<4.2.0": ">=4.2.0"
}
}
}

1
plugins/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
figmaTokens.json

View file

@ -0,0 +1,43 @@
/**
* This script turns output from the figma plugin "style to JSON" into a usuable theme.
* It expects a format of "themes/{NAME}/anythinghere"
*/
import fs from "fs";
const fileLocation = "./figmaTokens.json";
const theme = "blue";
const fileContents = fs.readFileSync(fileLocation, {
encoding: "utf-8"
});
const tokens = JSON.parse(fileContents);
const themeTokens = tokens.themes[theme];
const output = {};
function setKey(obj, key, defaultVal) {
const realKey = key.match(/^\d+$/g) ? "c" + key : key;
if (obj[key]) return obj[key];
obj[realKey] = defaultVal;
return obj[realKey];
}
function handleToken(token, path) {
if (typeof token.name === "string" && typeof token.description === "string") {
let ref = output;
const lastKey = path.pop();
path.forEach((v) => {
ref = setKey(ref, v, {});
});
setKey(ref, lastKey, token.hex);
return;
}
for (let key in token) {
handleToken(token[key], [...path, key]);
}
}
handleToken(themeTokens, []);
console.log(JSON.stringify(output, null, 2));

41
plugins/handlebars.ts Normal file
View file

@ -0,0 +1,41 @@
import { globSync } from "glob";
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { PluginOption } from "vite";
import Handlebars from "handlebars";
import path from "path";
export const handlebars = (options: { vars?: Record<string, any> } = {}): PluginOption[] => {
const files = globSync("src/assets/**/**.hbs");
function render(content: string): string {
const template = Handlebars.compile(content);
return template(options?.vars ?? {});
}
return [
{
name: 'hbs-templating',
enforce: "pre",
transformIndexHtml: {
order: 'pre',
handler(html) {
return render(html);
}
},
},
viteStaticCopy({
silent: true,
targets: files.map(file => ({
src: file,
dest: '',
rename: path.basename(file).slice(0, -4), // remove .hbs file extension
transform: {
encoding: 'utf8',
handler(content: string) {
return render(content);
}
}
}))
})
]
}

6795
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

View file

@ -3,3 +3,11 @@
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Referrer-Policy: origin-when-cross-origin
Cache-Control: public, max-age=0, s-maxage=0, must-revalidate
/manifest.webmanifest
Content-Type: application/manifest+json
# assets get a long cache instead of no cache
/assets/*
Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable

View file

@ -1 +1,2 @@
/assets/* /assets/:splat 200
/* /index.html 200

View file

@ -1,5 +1,19 @@
window.__CONFIG__ = {
// url must NOT end with a slash
VITE_CORS_PROXY_URL: "",
VITE_TMDB_READ_API_KEY: ""
// The URL for the CORS proxy, the URL must NOT end with a slash!
VITE_CORS_PROXY_URL: "CHANGEME",
// The READ API key to access TMDB
VITE_TMDB_READ_API_KEY: "CHANGEME",
// The DMCA email displayed in the footer, null to hide the DMCA link
VITE_DMCA_EMAIL: null,
// Whether to disable hash-based routing, leave this as false if you don't know what this is
VITE_NORMAL_ROUTER: false,
// The backend URL to communicate with, defaults to the movie-web hosted one at backend.movie-web.app
VITE_BACKEND_URL: null,
// A comma separated list of disallowed IDs in the case of a DMCA claim - in the format "series-<id>" and "movie-<id>"
VITE_DISALLOWED_IDS: ""
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg fill="#fff" height="800px" width="800px" version="1.1" id="Capa_1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 298 298" xml:space="preserve">
<g>
<path d="M289.5,140.5h-24.606l11.031-11.03c2.93-2.929,2.93-7.678,0.001-10.606c-2.929-2.929-7.678-2.93-10.606-0.001
L243.681,140.5h-36.369l16.182-17.392c2.821-3.032,2.65-7.777-0.383-10.6c-1.243-1.156-2.775-1.802-4.345-1.961
c-0.952-0.047-21.495-0.003-21.495-0.003L221.315,86.5H251.5c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5h-15.186l17.69-17.69
c2.929-2.93,2.929-7.678,0-10.608c-2.93-2.928-7.844-2.928-10.774,0L225.167,61.1V45.5c0-4.143-3.357-7.5-7.5-7.5
c-4.143,0-7.5,3.357-7.5,7.5v30.601l-24.837,25.004l-0.415-22.645c-0.001-0.036,0.035-0.07,0.034-0.106
c-0.035-1.824-0.704-3.641-2.07-5.059c-2.873-2.982-7.778-3.07-10.761-0.194l-15.951,15.226V53.107l21.47-21.304
c2.929-2.93,3.012-7.678,0.083-10.607c-2.93-2.928-7.803-2.928-10.732,0l-10.821,10.696V7.5c0-4.143-3.357-7.5-7.5-7.5
c-4.143,0-7.5,3.357-7.5,7.5v24.393l-10.53-10.696c-2.93-2.928-7.594-2.928-10.524,0c-2.929,2.93-3.054,7.678-0.125,10.607
l21.179,21.304v35.421l-16.176-15.475c-3.009-2.847-7.67-2.718-10.52,0.289c-1.075,1.136-1.683,2.52-1.914,3.955
c-0.142,0.583-0.203,1.188-0.201,1.811l-0.088,21.229l-25.1-24.944V45.5c0-4.143-3.357-7.5-7.5-7.5s-7.5,3.357-7.5,7.5v14.894
L55.142,43.202c-2.93-2.928-7.594-2.928-10.524,0c-2.929,2.93-2.887,7.678,0.042,10.608L62.392,71.5H46.5
c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h30.892l24.744,24.744l-23.057,0.831c-4.021,0.146-7.524,3.435-7.563,7.418
c-0.004,0.112-0.349,0.225-0.349,0.337c0,0.003,0,0.007,0,0.011c0,0.008,0.345,0.017,0.345,0.024
c0.045,1.875,0.955,3.736,2.395,5.158L89.748,140.5H55.025l-21.638-21.638c-2.93-2.928-7.678-2.928-10.607,0
c-2.929,2.93-2.929,7.678,0,10.607l11.03,11.03H8.5c-4.143,0-7.5,3.357-7.5,7.5s3.357,7.5,7.5,7.5h25.02L22.78,166.239
c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196c1.919,0,3.839-0.732,5.304-2.196L54.734,155.5h35.027
l-15.253,16.394c-2.821,3.032-2.65,7.777,0.383,10.6c1.444,1.344,3.277,2.009,5.106,2.009c0.034,0,0.068-0.005,0.103-0.005
c0.022,0,0.044,0.003,0.065,0.003c0.018,0,0.037,0,0.055,0l22.005-0.125L77.101,209.5H46.5c-4.143,0-7.5,3.357-7.5,7.5
s3.357,7.5,7.5,7.5h15.601l-17.399,17.399c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196
c1.919,0,3.672-0.732,5.137-2.196l17.025-17.191V250.5c0,4.143,3.357,7.5,7.5,7.5s7.5-3.357,7.5-7.5v-30.185l25.445-25.278
l0.977,24.39c0.148,4.046,3.517,7.306,7.532,7.225c1.364-0.027,2.844-0.465,4.312-1.543c1.063-0.781,15.734-15.812,15.734-15.812
v35.385l-20.971,21.137c-2.93,2.929-2.846,7.678,0.082,10.607c1.465,1.465,3.425,2.197,5.345,2.197
c1.919,0,3.693-0.732,5.157-2.196l10.387-10.532V290.5c0,4.143,3.357,7.5,7.5,7.5c4.143,0,7.5-3.357,7.5-7.5v-25.31l11.404,11.237
c1.465,1.464,3.468,2.196,5.387,2.196c1.919,0,3.881-0.732,5.345-2.196c2.929-2.93,2.783-7.678-0.146-10.607l-21.99-21.845v-35.7
c0,0,13.729,12.896,15.896,14.976c2.167,2.08,3.942,3.25,6.525,3.25c0.015,0,0.03,0,0.046,0c4.142,0,7.48-3.604,7.455-7.746
l-0.306-23.696l24.384,24.551V250.5c0,4.143,3.357,7.5,7.5,7.5c4.143,0,7.5-3.357,7.5-7.5v-15.891l18.064,17.897
c1.465,1.464,3.467,2.196,5.387,2.196c1.919,0,3.88-0.732,5.345-2.196c2.929-2.93,2.95-7.678,0.021-10.607L236.605,224.5H251.5
c4.143,0,7.5-3.357,7.5-7.5s-3.357-7.5-7.5-7.5h-29.894l-25.742-25.742l23.059-0.831c0.082-0.003,0.162-0.016,0.243-0.021
c0.03-0.002,0.06-0.005,0.09-0.008c3.977-0.319,7.037-3.709,6.892-7.736c-0.087-2.424-1.32-4.531-3.155-5.837L209.138,155.5h34.835
l21.345,21.346c1.465,1.465,3.384,2.197,5.304,2.197c1.919,0,3.839-0.732,5.303-2.196c2.93-2.929,2.93-7.678,0.001-10.606
l-10.74-10.74H289.5c4.143,0,7.5-3.357,7.5-7.5S293.643,140.5,289.5,140.5z M200.795,125.483L186.823,140.5h-19.507l15.002-15.002
L200.795,125.483z M170.21,95.784l0.356,20.002l-14.399,14.315V109.16L170.21,95.784z M127.263,95.865l13.904,13.323v20.205
l-13.925-14.008L127.263,95.865z M96.862,126.444l19.762-0.712l14.768,14.768h-20.299L96.862,126.444z M97.246,169.477
L110.25,155.5h20.851l-13.841,13.841L97.246,169.477z M127.863,201.599l-0.854-21.042l14.158-14.241v21.604L127.863,201.599z
M170.819,201.264l-14.652-13.478v-22.179l14.442,14.359L170.819,201.264z M200.991,168.564l-19.614,0.706l-13.77-13.77h20.292
L200.991,168.564z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

1
public/skull.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#CCD6DD" d="M27.865 16.751c0-6.242-4.411-9.988-9.927-9.988s-9.835 3.746-9.835 9.988c0 3.48-.103 6.485 3.897 7.89v2.722c0 1.034.966 1.872 2 1.872 1.035 0 2-.838 2-1.872v-1.97 1.97c0 1.034.965 1.872 2 1.872 1.036 0 2-.838 2-1.872v-1.97 1.97c0 1.034.966 1.872 2 1.872s2-.838 2-1.872v-2.722c4-1.405 3.865-4.41 3.865-7.89z"/><circle fill="#292F33" cx="13.629" cy="15.503" r="3.121"/><path fill="#292F33" d="M25.488 15.503c0 1.724 0 3.121-3.121 3.121-3.12 0-3.12-1.397-3.12-3.121s1.396-3.121 3.12-3.121c1.725 0 3.121 1.397 3.121 3.121zm-6.301 5.656c-.157-.382-.626-.662-1.189-.662-.561 0-1.031.28-1.188.662-.394.11-.685.469-.685.898 0 .517.419.936.937.936.409 0 .753-.263.88-.628.019 0 .037.004.056.004.019 0 .037-.004.057-.004.128.365.472.628.88.628.517 0 .936-.419.936-.936 0-.429-.291-.786-.684-.898z"/><path d="M11 27c0-.367.075-.713.195-1.038-.984-.447-1.831-1.082-2.503-1.97-1.107.969-2.163 1.876-3.127 2.695C4.985 26.26 4.275 26 3.5 26 1.567 26 0 27.566 0 29.5c0 1.778 1.33 3.229 3.046 3.454C3.271 34.671 4.722 36 6.5 36c1.933 0 3.5-1.566 3.5-3.5 0-.775-.26-1.485-.686-2.065.6-.706 1.246-1.46 1.931-2.25C11.088 27.821 11 27.421 11 27zm16.872-15.482c.884-.769 1.729-1.495 2.515-2.163.569.403 1.262.645 2.013.645 1.934 0 3.5-1.567 3.5-3.5 0-1.743-1.277-3.177-2.945-3.444C32.735 1.335 31.281 0 29.5 0 27.566 0 26 1.567 26 3.5c0 .775.26 1.485.687 2.065-.594.7-1.233 1.445-1.911 2.227 1.3.871 2.361 2.095 3.096 3.726zM3.5 10c.775 0 1.485-.26 2.065-.687.799.679 1.661 1.419 2.564 2.204.735-1.631 1.795-2.855 3.096-3.726-.679-.781-1.317-1.527-1.912-2.226.427-.58.687-1.29.687-2.065C10 1.567 8.433 0 6.5 0 4.722 0 3.271 1.33 3.046 3.046 1.33 3.271 0 4.722 0 6.5 0 8.433 1.567 10 3.5 10zm28.9 16c-.752 0-1.444.242-2.014.645-.952-.809-1.99-1.701-3.079-2.653-.672.889-1.519 1.523-2.503 1.971.121.324.196.67.196 1.037 0 .421-.088.821-.245 1.185.685.79 1.331 1.544 1.931 2.25-.426.58-.686 1.29-.686 2.065 0 1.934 1.566 3.5 3.5 3.5 1.781 0 3.235-1.334 3.455-3.056 1.668-.267 2.945-1.701 2.945-3.444 0-1.934-1.566-3.5-3.5-3.5z" fill="#AAB8C2"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,52 +0,0 @@
import { describe, it } from "vitest";
import "@/backend";
import { testData } from "@/__tests__/providers/testdata";
import { getProviders } from "@/backend/helpers/register";
import { runProvider } from "@/backend/helpers/run";
import { MWMediaType } from "@/backend/metadata/types/mw";
describe("providers", () => {
const providers = getProviders();
it("have at least one provider", ({ expect }) => {
expect(providers.length).toBeGreaterThan(0);
});
for (const provider of providers) {
describe(provider.displayName, () => {
it("must have at least one type", async ({ expect }) => {
expect(provider.type.length).toBeGreaterThan(0);
});
if (provider.type.includes(MWMediaType.MOVIE)) {
it("must work with movies", async ({ expect }) => {
const movie = testData.find((v) => v.meta.type === MWMediaType.MOVIE);
if (!movie) throw new Error("no movie to test with");
const results = await runProvider(provider, {
media: movie,
progress() {},
type: movie.meta.type as any,
});
expect(results).toBeTruthy();
});
}
if (provider.type.includes(MWMediaType.SERIES)) {
it("must work with series", async ({ expect }) => {
const show = testData.find((v) => v.meta.type === MWMediaType.SERIES);
if (show?.meta.type !== MWMediaType.SERIES)
throw new Error("no show to test with");
const results = await runProvider(provider, {
media: show,
progress() {},
type: show.meta.type as MWMediaType.SERIES,
episode: show.meta.seasonData.episodes[0].id,
season: show.meta.seasons[0].id,
});
expect(results).toBeTruthy();
});
}
});
}
});

View file

@ -1,45 +0,0 @@
import { DetailedMeta } from "@/backend/metadata/getmeta";
import { MWMediaType } from "@/backend/metadata/types/mw";
export const testData: DetailedMeta[] = [
{
imdbId: "tt10954562",
tmdbId: "572716",
meta: {
id: "439596",
title: "Hamilton",
type: MWMediaType.MOVIE,
year: "2020",
seasons: undefined,
},
},
{
imdbId: "tt11126994",
tmdbId: "94605",
meta: {
id: "222333",
title: "Arcane",
type: MWMediaType.SERIES,
year: "2021",
seasons: [
{
id: "230301",
number: 1,
title: "Season 1",
},
],
seasonData: {
id: "230301",
number: 1,
title: "Season 1",
episodes: [
{
id: "4243445",
number: 1,
title: "Welcome to the Playground",
},
],
},
},
},
];

View file

@ -1,152 +0,0 @@
import { describe, it } from "vitest";
import {
getMWCaptionTypeFromUrl,
isSupportedSubtitle,
parseSubtitles,
} from "@/backend/helpers/captions";
import { MWCaptionType } from "@/backend/helpers/streams";
import {
ass,
multilineSubtitlesTestVtt,
srt,
visibleSubtitlesTestVtt,
vtt,
} from "./testdata";
describe("subtitles", () => {
it("should return true if given url ends with a known subtitle type", ({
expect,
}) => {
expect(isSupportedSubtitle("https://example.com/test.srt")).toBe(true);
expect(isSupportedSubtitle("https://example.com/test.vtt")).toBe(true);
expect(isSupportedSubtitle("https://example.com/test.txt")).toBe(false);
});
it("should return corresponding MWCaptionType", ({ expect }) => {
expect(getMWCaptionTypeFromUrl("https://example.com/test.srt")).toBe(
MWCaptionType.SRT
);
expect(getMWCaptionTypeFromUrl("https://example.com/test.vtt")).toBe(
MWCaptionType.VTT
);
expect(getMWCaptionTypeFromUrl("https://example.com/test.txt")).toBe(
MWCaptionType.UNKNOWN
);
});
it("should throw when empty text is given", ({ expect }) => {
expect(() => parseSubtitles("")).toThrow("Given text is empty");
});
it("should parse srt", ({ expect }) => {
const parsed = parseSubtitles(srt);
const parsedSrt = [
{
type: "caption",
index: 1,
start: 0,
end: 0,
duration: 0,
content: "Test",
text: "Test",
},
{
type: "caption",
index: 2,
start: 0,
end: 0,
duration: 0,
content: "Test",
text: "Test",
},
];
expect(parsed).toHaveLength(2);
expect(parsed).toEqual(parsedSrt);
});
it("should parse vtt", ({ expect }) => {
const parsed = parseSubtitles(vtt);
const parsedVtt = [
{
type: "caption",
index: 1,
start: 0,
end: 4000,
duration: 4000,
content: "Where did he go?",
text: "Where did he go?",
},
{
type: "caption",
index: 2,
start: 3000,
end: 6500,
duration: 3500,
content: "I think he went down this lane.",
text: "I think he went down this lane.",
},
{
type: "caption",
index: 3,
start: 4000,
end: 6500,
duration: 2500,
content: "What are you waiting for?",
text: "What are you waiting for?",
},
];
expect(parsed).toHaveLength(3);
expect(parsed).toEqual(parsedVtt);
});
it("should parse ass", ({ expect }) => {
const parsed = parseSubtitles(ass);
expect(parsed).toHaveLength(3);
});
it("should delay subtitles when given a delay", ({ expect }) => {
const videoTime = 11;
let delayedSeconds = 0;
const parsed = parseSubtitles(visibleSubtitlesTestVtt);
const isVisible = (start: number, end: number, delay: number): boolean => {
const delayedStart = start / 1000 + delay;
const delayedEnd = end / 1000 + delay;
return (
Math.max(0, delayedStart) <= videoTime &&
Math.max(0, delayedEnd) >= videoTime
);
};
const visibleSubtitles = parsed.filter((c) =>
isVisible(c.start, c.end, delayedSeconds)
);
expect(visibleSubtitles).toHaveLength(1);
delayedSeconds = 10;
const delayedVisibleSubtitles = parsed.filter((c) =>
isVisible(c.start, c.end, delayedSeconds)
);
expect(delayedVisibleSubtitles).toHaveLength(1);
delayedSeconds = -10;
const delayedVisibleSubtitles2 = parsed.filter((c) =>
isVisible(c.start, c.end, delayedSeconds)
);
expect(delayedVisibleSubtitles2).toHaveLength(1);
delayedSeconds = -20;
const delayedVisibleSubtitles3 = parsed.filter((c) =>
isVisible(c.start, c.end, delayedSeconds)
);
expect(delayedVisibleSubtitles3).toHaveLength(1);
});
it("should parse multiline captions", ({ expect }) => {
const parsed = parseSubtitles(multilineSubtitlesTestVtt);
expect(parsed[0].text).toBe(`- Test 1\n- Test 2\n- Test 3`);
expect(parsed[1].text).toBe(`- Test 4`);
expect(parsed[2].text).toBe(`- Test 6`);
});
});

View file

@ -1,68 +0,0 @@
const srt = `
1
00:00:00,000 --> 00:00:00,000
Test
2
00:00:00,000 --> 00:00:00,000
Test
`;
const vtt = `
WEBVTT
00:00:00.000 --> 00:00:04.000 position:10%,line-left align:left size:35%
Where did he go?
00:00:03.000 --> 00:00:06.500 position:90% align:right size:35%
I think he went down this lane.
00:00:04.000 --> 00:00:06.500 position:45%,line-right align:center size:35%
What are you waiting for?
`;
const ass = `[Script Info]
; Generated by Ebby.co
Title:
Original Script:
ScriptType: v4.00+
Collisions: Normal
PlayResX: 384
PlayResY: 288
PlayDepth: 0
Timer: 100.0
WrapStyle: 0
[v4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default, Arial, 16, &H00FFFFFF, &H00000000, &H00000000, &H00000000, 0, 0, 0, 0, 100, 100, 0, 0, 1, 1, 0, 2, 15, 15, 15, 0
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:10.00,0:00:20.00,Default,,0000,0000,0000,,This is the first subtitle.
Dialogue: 0,0:00:30.00,0:00:34.00,Default,,0000,0000,0000,,This is the second.
Dialogue: 0,0:00:34.00,0:00:35.00,Default,,0000,0000,0000,,Third`;
const visibleSubtitlesTestVtt = `WEBVTT
00:00:00.000 --> 00:00:10.000 position:10%,line-left align:left size:35%
Test 1
00:00:10.000 --> 00:00:20.000 position:90% align:right size:35%
Test 2
00:00:20.000 --> 00:00:31.000 position:45%,line-right align:center size:35%
Test 3
`;
const multilineSubtitlesTestVtt = `WEBVTT
00:00:00.000 --> 00:00:10.000
- Test 1\n- Test 2\n- Test 3
00:00:10.000 --> 00:00:20.000
- Test 4
00:00:20.000 --> 00:00:31.000
- Test 6
`;
export { vtt, srt, ass, visibleSubtitlesTestVtt, multilineSubtitlesTestVtt };

View file

@ -4,7 +4,7 @@
html,
body {
@apply bg-denim-100 font-open-sans text-denim-700 overflow-x-hidden;
@apply bg-background-main font-open-sans text-type-text;
min-height: 100vh;
min-height: 100dvh;
}
@ -30,10 +30,18 @@ body[data-no-select] {
user-select: none;
}
html[data-no-scroll], html[data-no-scroll] body {
overflow: hidden;
}
.roll {
animation: roll 1s;
}
.roll-infinite {
animation: roll 2s infinite;
}
@keyframes roll {
from {
transform: rotate(0deg);
@ -60,6 +68,16 @@ body[data-no-select] {
height: 60vh;
}
.h-screen {
height: 100vh;
height: 100dvh;
}
.min-h-screen {
min-height: 100vh;
min-height: 100dvh;
}
/*generated with Input range slider CSS style generator (version 20211225)
https://toughengineer.github.io/demo/slider-styler*/
:root {
@ -185,7 +203,7 @@ input[type=range].styled-slider.slider-progress::-ms-fill-lower {
}
::-webkit-scrollbar-thumb {
background-color: theme("colors.denim-500");
background-color: theme("colors.video.context.border");
border: 5px solid transparent;
border-left: 0;
background-clip: content-box;
@ -194,4 +212,13 @@ input[type=range].styled-slider.slider-progress::-ms-fill-lower {
::-webkit-scrollbar {
/* For some reason the styles don't get applied without the width */
width: 13px;
}
}
.grecaptcha-badge {
display: none !important;
}
.tabbable:focus-visible {
outline: 2px solid theme('colors.themePreview.primary');
box-shadow: 0 0 10px theme('colors.themePreview.secondary');
}

25
src/assets/languages.ts Normal file
View file

@ -0,0 +1,25 @@
import cs from "@/assets/locales/cs.json";
import de from "@/assets/locales/de.json";
import en from "@/assets/locales/en.json";
import fr from "@/assets/locales/fr.json";
import it from "@/assets/locales/it.json";
import nl from "@/assets/locales/nl.json";
import pirate from "@/assets/locales/pirate.json";
import pl from "@/assets/locales/pl.json";
import tr from "@/assets/locales/tr.json";
import vi from "@/assets/locales/vi.json";
import zh from "@/assets/locales/zh.json";
export const locales = {
en,
cs,
de,
fr,
it,
nl,
pl,
tr,
vi,
zh,
pirate,
};

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "To je vše co máme!",
"sectionTitle": "Výsledky vyhledávání",
"noResults": "Nemohli jsme nic najít!",
"failed": "Nepodařilo se najít média, zkuste to znovu!",
"loading": "Načítání...",
"placeholder": "Co si přejete sledovat?"
},
"bookmarks": {
"sectionTitle": "Záložky"
},
"continueWatching": {
"sectionTitle": "Pokračujte ve sledování"
}
},
"media": {
"types": {
"movie": "Film",
"show": "Seriál"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"playbackError": {
"title": "Jejda, rozbilo se to!"
},
"metadata": {
"notFound": {
"badge": "Nenalezeno",
"homeButton": "Zpátky domů",
"title": "Nemohli jsme najít Vaše média.",
"text": "Nemohli jsme najít média o které jste požádali. Buďto jsme ho nemohli najít, nebo jste manipulovali s URL."
}
},
"menus": {
"captions": {
"customChoice": "Nahrát titulky",
"customizeLabel": "Upravit",
"title": "Titulky"
},
"sources": {
"title": "Zdroje"
},
"episodes": {
"button": "Epizody",
"loadingTitle": "Načítání...",
"loadingList": "Načítání..."
}
},
"back": {
"default": "Zpátky domů",
"short": "Zpět"
}
},
"notFound": {
"badge": "Nenalezeno",
"goHome": "Zpátky domů",
"title": "Tuto stránku se nepodařilo najít",
"message": "Dívali jsme se všude: pod koši, ve skříni, za proxy, ale nakonec jsme nemohli najít stránku, kterou hledáte."
},
"navigation": {
"banner": {
"offline": "Zkontrolujte své internetové připojení"
}
}
}

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "Das ist alles, was wir haben!",
"sectionTitle": "Suchergebnisse",
"noResults": "Wir haben nichts gefunden!",
"failed": "Das Medium wurde nicht gefunden, bitte versuchen Sie es erneut!",
"loading": "Wird geladen...",
"placeholder": "Was willst du gucken?"
},
"bookmarks": {
"sectionTitle": "Favoriten"
},
"continueWatching": {
"sectionTitle": "Weiter ansehen"
}
},
"media": {
"types": {
"movie": "Film",
"show": "Serie"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"playbackError": {
"title": "Hoppla, etwas ist schiefgegangen!"
},
"metadata": {
"notFound": {
"badge": "Nicht gefunden",
"homeButton": "Zurück zur Startseite",
"title": "Das Medium konnte nicht gefunden werden.",
"text": "Wir konnten die angeforderten Medien nicht finden."
}
},
"menus": {
"captions": {
"customChoice": "Untertitel hochladen",
"customizeLabel": "Bearbeiten",
"title": "Untertitel"
},
"sources": {
"title": "Quellen"
},
"episodes": {
"button": "Folgen",
"loadingTitle": "Wird geladen...",
"loadingList": "Wird geladen..."
}
},
"back": {
"default": "Zurück zur Startseite",
"short": "Rückmeldung"
}
},
"notFound": {
"badge": "Nicht gefunden",
"goHome": "Zurück zur Startseite",
"title": "Diese Seite kann nicht gefunden werden",
"message": "Wir haben überall gesucht, aber am Ende konnten wir die gesuchte Seite nicht finden."
},
"navigation": {
"banner": {
"offline": "Internetverbindung ist instabil"
}
}
}

417
src/assets/locales/en.json Normal file
View file

@ -0,0 +1,417 @@
{
"auth": {
"deviceNameLabel": "Device name",
"deviceNamePlaceholder": "Personal phone",
"hasAccount": "Already have an account? <0>Login here.</0>",
"createAccount": "Don't have an account yet? <0>Create an account.</0>",
"register": {
"information": {
"title": "Account information",
"color1": "Profile color one",
"color2": "Profile color two",
"icon": "User icon",
"header": "Enter a name for your device and pick colours and a user icon of your choosing",
"next": "Next"
}
},
"login": {
"title": "Login to your account",
"description": "Please enter your passphrase to login to your account",
"validationError": "Incorrect or incomplete passphrase",
"deviceLengthError": "Please enter a device name",
"submit": "Login",
"passphraseLabel": "12-Word passphrase",
"passphrasePlaceholder": "Passphrase"
},
"generate": {
"title": "Your passphrase",
"next": "I have saved my passphrase",
"description": "Your passphrase acts as your username and password. Make sure to keep it safe as you will need to enter it to login to your account"
},
"trust": {
"title": "Do you trust this server?",
"host": "You are connecting to <0>{{hostname}}</0> - please confirm you trust it before making an account",
"failed": {
"title": "Failed to reach server",
"text": "Did you configure it correctly?"
},
"yes": "I trust this server",
"no": "Go back"
},
"verify": {
"title": "Confirm your passphrase",
"description": "Please enter your passphrase from earlier to confirm you have saved it and to create your account",
"invalidData": "Data is not valid",
"noMatch": "Passphrase doesn't match",
"recaptchaFailed": "ReCaptcha validation failed",
"passphraseLabel": "Your 12-word passphrase",
"register": "Create account"
}
},
"errors": {
"details": "Error details",
"reloadPage": "Reload the page",
"showError": "Show error details",
"badge": "It broke",
"title": "We encountered an error!"
},
"notFound": {
"badge": "Not found",
"title": "Couldn't find that page",
"message": "We looked everywhere: under the bins, in the closet, behind the proxy but ultimately couldn't find the page you are looking for.",
"goHome": "Back to home"
},
"global": {
"name": "movie-web",
"pages": {
"pagetitle": "{{title}} - movie-web",
"dmca": "DMCA",
"settings": "Settings",
"about": "About",
"login": "Login",
"register": "Register"
}
},
"media": {
"types": {
"movie": "Movie",
"show": "Show"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"scraping": {
"notFound": {
"badge": "Not found",
"title": "We couldn't find that",
"text": "We have searched through our providers and cannot find the media you are looking for! We do not host the media and have no control over what is available. Please click 'Show details' below for more details.",
"homeButton": "Go home",
"detailsButton": "Show details"
},
"items": {
"pending": "Checking for videos...",
"notFound": "Doesn't have the video",
"failure": "Error occurred"
}
},
"casting": {
"enabled": "Casting to device..."
},
"playbackError": {
"badge": "Playback error",
"title": "Failed to play video!",
"text": "There was an error trying to play the media. Please try again.",
"homeButton": "Go home",
"errors": {
"errorAborted": "The fetching of the media was aborted by the user's request.",
"errorNetwork": "Some kind of network error occurred which prevented the media from being successfully fetched, despite having previously been available.",
"errorDecode": "Despite having previously been determined to be usable, an error occurred while trying to decode the media resource, resulting in an error.",
"errorNotSupported": "The media or media provider object is not supported.",
"errorGenericMedia": "Unknown media error occurred."
}
},
"metadata": {
"notFound": {
"badge": "Not found",
"title": "Couldn't find that media.",
"text": "We couldn't find the media you requested. Either it's been removed or you tampered with the URL.",
"homeButton": "Back to home"
},
"failed": {
"badge": "Failed",
"title": "Failed to load metadata",
"text": "Could not load the media's metadata from TMDB. Please check whether TMDB is down or blocked on your internet connection.",
"homeButton": "Go home"
}
},
"back": {
"default": "Back to home",
"short": "Back"
},
"time": {
"regular": "{{timeWatched}} / {{duration}}",
"shortRegular": "{{timeWatched}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}",
"shortRemaining": "-{{timeLeft}}"
},
"nextEpisode": {
"next": "Next episode",
"cancel": "Cancel"
},
"menus": {
"settings": {
"videoSection": "Video settings",
"experienceSection": "Viewing experience",
"enableCaptions": "Enable captions",
"captionItem": "Caption settings",
"sourceItem": "Video sources",
"playbackItem": "Playback settings",
"downloadItem": "Download",
"qualityItem": "Quality"
},
"episodes": {
"button": "Episodes",
"loadingTitle": "Loading...",
"loadingList": "Loading...",
"loadingError": "Error loading season",
"emptyState": "There are no episodes in this season, check back later!",
"episodeBadge": "E{{episode}}"
},
"sources": {
"title": "Sources",
"unknownOption": "Unknown",
"noStream": {
"title": "No stream",
"text": "This source has no streams for this movie or show."
},
"noEmbeds": {
"title": "No embeds found",
"text": "We were unable to find any embeds, please try a different source."
},
"failed": {
"title": "Failed to scrape",
"text": "There was an error while trying to find any videos, please try a different source."
}
},
"captions": {
"title": "Captions",
"customizeLabel": "Customize",
"settings": {
"fixCapitals": "Fix capitalization",
"delay": "Caption delay"
},
"customChoice": "Select caption from file",
"offChoice": "Off",
"unknownLanguage": "Unknown"
},
"downloads": {
"title": "Download",
"disclaimer": "Downloads are taken directly from the provider. movie-web does not have control over how the downloads are provided.",
"hlsExplanation": "This media is a HLS stream which cannot be downloaded on movie-web.",
"downloadVideo": "Download video",
"downloadCaption": "Download current caption",
"onPc": {
"1": "On PC, click the download button then, on the new page, right click the video and select <bold>Save video as</bold>",
"title": "Downloading on PC",
"shortTitle": "Download / PC"
},
"onAndroid": {
"1": "To download on Android, click the download button then, on the new page, <bold>tap and hold</bold> on the video, then select <bold>save</bold>.",
"title": "Downloading on Android",
"shortTitle": "Download / Android"
},
"onIos": {
"1": "To download on iOS, click the download button then, on the new page, click <bold><ios_share /></bold>, then <bold>Save to Files <ios_files /></bold>.",
"title": "Downloading on iOS",
"shortTitle": "Download / iOS"
}
},
"playback": {
"title": "Playback settings",
"speedLabel": "Playback speed"
},
"quality": {
"title": "Quality",
"automaticLabel": "Automatic quality",
"hint": "You can try <0>switching source</0> to get different quality options.",
"iosNoQuality": "Due to Apple-defined limitations, quality selection is not available on iOS for this source. You can try <0>switching to another source</0> to get different quality options."
}
}
},
"home": {
"mediaList": {
"stopEditing": "Stop editing"
},
"titles": {
"morning": {
"default": "What would you like to watch this morning?",
"extra": ["I hear Before Sunrise is good"]
},
"day": {
"default": "What would you like to watch this afternoon?",
"extra": []
},
"night": {
"default": "What would you like to watch tonight?",
"extra": ["Tired? I hear The Exorcist is good."]
}
},
"search": {
"loading": "Loading...",
"sectionTitle": "Search results",
"allResults": "That's all we have!",
"noResults": "We couldn't find anything!",
"failed": "Failed to find media, try again!",
"placeholder": "What do you want to watch?"
},
"continueWatching": {
"sectionTitle": "Continue Watching"
},
"bookmarks": {
"sectionTitle": "Bookmarks"
}
},
"overlays": {
"close": "Close"
},
"screens": {
"loadingUser": "Loading your profile",
"loadingApp": "Loading application",
"loadingUserError": {
"text": "Failed to load your profile",
"textWithReset": "Failed to load your profile from your custom server, want to reset back to the default server?",
"reset": "Reset custom server",
"logout": "Logout"
},
"migration": {
"failed": "Failed to migrate your data.",
"inProgress": "Please hold, we are migrating your data. This shouldn't take long."
},
"dmca": {
"title": "DMCA",
"text": "Welcome to movie-web's DMCA contact page! We respect intellectual property rights and want to address any copyright concerns swiftly. If you believe your copyrighted work has been improperly used on our platform, please send a detailed DMCA notice to the email below. Please include a description of the copyrighted material, your contact details, and a statement of good faith belief. We're committed to resolving these matters promptly and appreciate your cooperation in keeping movie-web a place that respects creativity and copyrights."
}
},
"navigation": {
"banner": {
"offline": "Check your internet connection"
},
"menu": {
"register": "Sync to cloud",
"settings": "Settings",
"about": "About us",
"donation": "Donate",
"support": "Support",
"logout": "Log out"
}
},
"actions": {
"copy": "Copy",
"copied": "Copied"
},
"settings": {
"unsaved": "You have unsaved changes",
"reset": "Reset",
"save": "Save",
"sidebar": {
"info": {
"title": "App information",
"hostname": "Hostname",
"backendUrl": "Backend URL",
"userId": "User ID",
"notLoggedIn": "You are not logged in",
"appVersion": "App version",
"backendVersion": "Backend version",
"unknownVersion": "Unknown",
"secure": "Secure",
"insecure": "Insecure"
}
},
"appearance": {
"title": "Appearance",
"activeTheme": "Active",
"themes": {
"default": "Default",
"blue": "Blue",
"teal": "Teal",
"red": "Red",
"gray": "Gray"
}
},
"account": {
"title": "Account",
"register": {
"title": "Sync to the cloud",
"text": "Share your watch progress between devices and keep them synced.",
"cta": "Get started"
},
"profile": {
"title": "Edit profile picture",
"firstColor": "Profile color one",
"secondColor": "Profile color two",
"userIcon": "User icon",
"finish": "Finish editing"
},
"devices": {
"title": "Devices",
"failed": "Failed to load sessions",
"deviceNameLabel": "Device name",
"removeDevice": "Remove"
},
"accountDetails": {
"editProfile": "Edit",
"deviceNameLabel": "Device name",
"deviceNamePlaceholder": "Personal phone",
"logoutButton": "Log out"
},
"actions": {
"title": "Actions",
"delete": {
"title": "Delete account",
"text": "This action is irreversible. All data will be deleted and nothing can be recovered.",
"button": "Delete account",
"confirmTitle": "Are you sure?",
"confirmDescription": "Are you sure you want to delete your account? All your data will be lost!",
"confirmButton": "Delete account"
}
}
},
"locale": {
"title": "Locale",
"language": "Application language",
"languageDescription": "Language applied to the entire application."
},
"captions": {
"title": "Captions",
"previewQuote": "I must not fear. Fear is the mind-killer.",
"backgroundLabel": "Background opacity",
"textSizeLabel": "Text size",
"colorLabel": "Color"
},
"connections": {
"title": "Connections",
"workers": {
"label": "Use custom proxy workers",
"description": "To make the application function, all traffic is routed through proxies. Enable this if you want to bring your own workers.",
"urlLabel": "Worker URLs",
"emptyState": "No workers yet, add one below",
"urlPlaceholder": "https://",
"addButton": "Add new worker"
},
"server": {
"label": "Custom server",
"description": "If you would like to connect to a custom backend to store your data, enable this and provide the URL.",
"urlLabel": "Custom server URL"
}
}
},
"about": {
"title": "About movie-web",
"description": "movie-web is a web application that searches the internet for streams. The team aims for a mostly minimalistic approach to consuming content.",
"faqTitle": "Common questions",
"q1": {
"title": "Where does the content come from?",
"body": "movie-web does not host any content. When you click on something to watch, the internet is searched for the selected media (On the loading screen and in the 'video sources' tab you can see which source you're using). Media never gets uploaded by movie-web, everything is through this searching mechanism."
},
"q2": {
"title": "Where can I request a show or movie?",
"body": "It's not possible to request a show or movie, movie-web does not manage any content. All content is viewed through sources on the internet."
},
"q3": {
"title": "The search results display the show or movie, why can't I play it?",
"body": "Our search results are powered by The Movie Database (TMDB) and display regardless of whether our sources actually have the content."
}
},
"footer": {
"tagline": "Watch your favourite shows and movies with this open source streaming app.",
"links": {
"github": "GitHub",
"dmca": "DMCA",
"discord": "Discord"
},
"legal": {
"disclaimer": "Disclaimer",
"disclaimerText": "movie-web does not host any files, it merely links to 3rd party services. Legal issues should be taken up with the file hosts and providers. movie-web is not responsible for any media files shown by the video providers."
}
}
}

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "C'est tout ce que nous avons!",
"sectionTitle": "Résultats de la recherche",
"noResults": "Nous n'avons rien trouvé!",
"failed": "Le média n'a pas été trouvé, veuillez réessayez!",
"loading": "Chargement...",
"placeholder": "Que voulez-vous voir?"
},
"bookmarks": {
"sectionTitle": "Favoris"
},
"continueWatching": {
"sectionTitle": "Continuer le visionnage"
}
},
"media": {
"types": {
"movie": "Film",
"show": "Série"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"playbackError": {
"title": "Oups, c'est coupé !"
},
"metadata": {
"notFound": {
"badge": "Introuvable",
"homeButton": "Retour à l'accueil",
"title": "Impossible de trouver ce média.",
"text": "Nous n'avons pas trouvé le média que vous avez demandé. Soit il a été supprimé, soit vous avez modifié l'URL."
}
},
"menus": {
"captions": {
"customChoice": "Télécharger des sous-titres",
"customizeLabel": "Personnaliser",
"title": "Sous-titres"
},
"sources": {
"title": "Sources"
},
"episodes": {
"button": "Épisodes",
"loadingTitle": "Chargement...",
"loadingList": "Chargement..."
}
},
"back": {
"default": "Retour à la page d'accueil",
"short": "Retour"
}
},
"notFound": {
"badge": "Introuvable",
"goHome": "Retour à l'accueil",
"title": "Impossible de trouver cette page",
"message": "Nous avons cherché partout : sous les poubelles, dans le placard, derrière le proxy, mais nous n'avons finalement pas trouvé la page que vous cherchez."
},
"navigation": {
"banner": {
"offline": "Vérifiez votre connexion internet"
}
}
}

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "Ecco tutto ciò che abbiamo!",
"sectionTitle": "Risultati della ricerca",
"noResults": "Non abbiamo trovato nulla!",
"failed": "Impossibile trovare i media, riprova!",
"loading": "Caricamento...",
"placeholder": "Cosa vuoi guardare?"
},
"bookmarks": {
"sectionTitle": "Segnalibri"
},
"continueWatching": {
"sectionTitle": "Continua a guardare"
}
},
"media": {
"types": {
"movie": "Film",
"show": "Serie"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"playbackError": {
"title": "Ops, qualcosa si è rotto!"
},
"metadata": {
"notFound": {
"badge": "Non trovato",
"homeButton": "Torna alla home",
"title": "Impossibile trovare quel media.",
"text": "Non siamo riusciti a trovare il media richiesto. È stato rimosso o hai manomesso l'URL."
}
},
"menus": {
"captions": {
"customChoice": "Carica sottotitolo",
"customizeLabel": "Personalizza",
"title": "Sottotitoli"
},
"sources": {
"title": "Fonti"
},
"episodes": {
"button": "Episodi",
"loadingTitle": "Caricamento...",
"loadingList": "Caricamento..."
}
},
"back": {
"default": "Torna alla home",
"short": "Indietro"
}
},
"notFound": {
"badge": "Non trovato",
"goHome": "Torna alla home",
"title": "Impossibile trovare quella pagina",
"message": "Abbiamo cercato ovunque: sotto i bidoni, nell'armadio, dietro il proxy, ma alla fine non siamo riusciti a trovare la pagina che stai cercando."
},
"navigation": {
"banner": {
"offline": "Controlla la tua connessione internet"
}
}
}

View file

@ -0,0 +1,76 @@
{
"auth": {
"deviceNameLabel": "Toestel naam",
"deviceNamePlaceholder": "Huistelefoon",
"hasAccount": "Heb je al een account? <0>Log hier in.</0>"
},
"global": {
"name": "movie-web"
},
"home": {
"bookmarks": {
"sectionTitle": "Opgeslagen"
},
"continueWatching": {
"sectionTitle": "Kijk verder"
},
"search": {
"allResults": "Dat is het!",
"failed": "Het is niet gelukt de media te laden, probeer het nog eens!",
"loading": "Aan het zoeken...",
"noResults": "We konden helaas niets vinden!",
"placeholder": "Wat wil je graag kijken?",
"sectionTitle": "Zoekresultaten"
}
},
"media": {
"episodeDisplay": "S{{season}} A{{episode}}",
"types": {
"movie": "Films",
"show": "Series"
}
},
"navigation": {
"banner": {
"offline": "Controleer je internetverbinding"
}
},
"notFound": {
"badge": "Pagina niet gevonden",
"goHome": "Naar de home-pagina",
"message": "We hebben echt alles geprobeerd, zelfs tijdrijzen; echter hebben we deze pagina helaas niet kunnen vinden.",
"title": "Pagina niet gevonden"
},
"player": {
"back": {
"default": "Naar de home-pagina",
"short": "Terug"
},
"menus": {
"captions": {
"customChoice": "Ondertiteling uploaden",
"customizeLabel": "Instellingen",
"title": "Ondertiteling"
},
"episodes": {
"button": "Afleveringen",
"loadingList": "Aan het zoeken...",
"loadingTitle": "Aan het zoeken..."
},
"sources": {
"title": "Bronnen"
}
},
"metadata": {
"notFound": {
"badge": "Pagina niet gevonden",
"homeButton": "Naar de home-pagina",
"text": "We konden dit stukje media niet vinden. Het is mogelijk verwijderd, of jij hebt zelf de URL aangepast.",
"title": "We konden deze media niet vinden."
}
},
"playbackError": {
"title": "Oeps, hier ging iets mis!"
}
}
}

View file

@ -0,0 +1,374 @@
{
"actions": {
"copied": "Copied",
"copy": "Copy"
},
"auth": {
"deviceNameLabel": "Ship name",
"deviceNamePlaceholder": "Muad'Dib's Pirate Ship",
"generate": {
"description": "If ye lose this, ye be a silly goose and will be posted on the wall of shame™",
"title": "Yer Passphrase"
},
"login": {
"description": "Arr, ye be askin' for the key to me top-secret lair, also known as The Fortress of Wordsmithery, accessed only by recitin' the sacred incantation of the 12-word passphrase!",
"passphraseLabel": "12-Word Passphrase",
"passphrasePlaceholder": "Passphrase",
"submit": "Hoist Anchor",
"title": "Hoist the Jolly Roger",
"validationError": "Arr, incorrect or incomplete passphrase"
},
"register": {
"information": {
"color1": "First Mate color",
"color2": "Second Mate color",
"header": "Enter a moniker for yer ship and choose a pirate icon and colors, arrr!",
"icon": "Pirate icon",
"title": "Pirate Account information"
}
},
"trust": {
"failed": {
"text": "Did ye configure it correctly?",
"title": "Failed to reach the backend"
},
"host": "Do ye trust <0>{{hostname}}</0>?",
"no": "Abandon Ship",
"title": "Do ye trust this ship?",
"yes": "Trust"
},
"verify": {
"description": "If ye already lost it, how will ye ever be able to take care of a wee buccaneer?",
"invalidData": "Data be not valid",
"noMatch": "Passphrase doesn't match",
"passphraseLabel": "Yer passphrase",
"recaptchaFailed": "ReCaptcha validation failed",
"register": "Register",
"title": "Enter yer passphrase"
}
},
"errors": {
"badge": "Shiver me timbers",
"details": "Error details",
"reloadPage": "Reload the page",
"title": "That be an error, Captain"
},
"footer": {
"legal": {
"disclaimer": "Disclaimer",
"disclaimerText": "movie-web does not host any files, it merely links to 3rd party services. Legal issues should be taken up with the file hosts and providers. movie-web be not responsible for any media files shown by the video providers."
},
"links": {
"discord": "Discord",
"dmca": "DMCA",
"github": "GitHub"
},
"tagline": "Watch yer favorite shows and movies with this open source streaming ship."
},
"global": {
"name": "movie-web",
"pages": {
"about": "About",
"dmca": "DMCA",
"login": "Login",
"pagetitle": "{{title}} - movie-web",
"register": "Register",
"settings": "Settings"
}
},
"home": {
"bookmarks": {
"sectionTitle": "Bookmarks"
},
"continueWatching": {
"sectionTitle": "Continue Watchin'"
},
"mediaList": {
"stopEditing": "Stop editin'"
},
"search": {
"allResults": "That's all we have, me heartie!",
"failed": "Failed to find media, try again!",
"loading": "Loading...",
"noResults": "We couldn't find anythin', arrr!",
"placeholder": "What do ye want to watch?",
"sectionTitle": "Searchin' results"
}
},
"media": {
"episodeDisplay": "S{{season}} E{{episode}}",
"types": {
"movie": "Film",
"show": "Show"
}
},
"navigation": {
"banner": {
"offline": "Check yer internet connection"
},
"menu": {
"about": "About us",
"logout": "Abandon ship",
"register": "Sync to the cloud",
"settings": "Settings",
"support": "Support"
}
},
"notFound": {
"badge": "Not found",
"goHome": "Back to home port",
"message": "We looked everywhere: under the bins, in the closet, behind the proxy but ultimately couldn't find the treasure map ye be lookin' for.",
"title": "Couldn't find that treasure map"
},
"overlays": {
"close": "Close"
},
"player": {
"back": {
"default": "Back to home port",
"short": "Back"
},
"menus": {
"captions": {
"customChoice": "Upload sea shanties",
"customizeLabel": "Customize",
"offChoice": "Off",
"settings": {
"delay": "Shanty delay",
"fixCapitals": "Fix capitalization"
},
"title": "Sea Shanties",
"unknownLanguage": "Unknown"
},
"downloads": {
"disclaimer": "Downloads be taken directly from the provider. movie-web does not have control over how the downloads be provided.",
"downloadCaption": "Download sea shanty",
"downloadVideo": "Download film",
"hlsExplanation": "Insert explanation for why ye can't download HLS here",
"onAndroid": {
"1": "To download on Android, <bold>tap and hold</bold> on the film, then select <bold>save</bold>.",
"shortTitle": "Download / Android",
"title": "Downloadin' on Android"
},
"onIos": {
"1": "To download on iOS, click <bold><ios_share /></bold>, then <bold>Save to Files <ios_files /></bold>. All that's left to do now be to pick a nice and cozy chest for yer film!",
"shortTitle": "Download / iOS",
"title": "Downloadin' on iOS"
},
"onPc": {
"1": "On PC, right click the film and select <bold>Save film as</bold>",
"shortTitle": "Download / PC",
"title": "Downloadin' on PC"
},
"title": "Buried Treasure"
},
"episodes": {
"button": "Episodes",
"emptyState": "There be no episodes in this season, check back later!",
"episodeBadge": "E{{episode}}",
"loadingError": "Error loadin' season",
"loadingList": "Loading...",
"loadingTitle": "Loading..."
},
"playback": {
"speedLabel": "Playback speed",
"title": "Playback settings"
},
"quality": {
"automaticLabel": "Automatic quality",
"hint": "Ye can try <0>switchin' source</0> to get different quality options.",
"iosNoQuality": "Due to Apple-defined limitations, quality selection be not available on iOS for this source. Ye can try <0>switchin' to another source</0> to get different quality options.",
"title": "Quality"
},
"settings": {
"captionItem": "Sea Shanty settings",
"downloadItem": "Buried Treasure",
"enableCaptions": "Enable Sea Shanties",
"experienceSection": "Viewing Experience",
"playbackItem": "Playback settings",
"qualityItem": "Quality",
"sourceItem": "Video sources",
"videoSection": "Video settings"
},
"sources": {
"failed": {
"text": "We were unable to find any videos for this source. Don't come bitchin' to us about it, just try another source.",
"title": "Failed to scrape"
},
"noEmbeds": {
"text": "We were unable to find any embeds for this source, please try another.",
"title": "No embeds found"
},
"noStream": {
"text": "This source has no streams for this film or show.",
"title": "No stream"
},
"title": "Sources",
"unknownOption": "Unknown"
}
},
"metadata": {
"failed": {
"badge": "Failed",
"homeButton": "Go home port",
"text": "Oh, me apologies, sweetie! The itty-bitty movie-web did its utmost bestest, but alas, no wucky videos to be spotted anywhere (´⊙ω⊙`) Please don't be angwy, wittle movie-web ish twying so hard. Can ye find it in yer heart to forgive? UwU 💖",
"title": "Failed to load meta data"
},
"notFound": {
"badge": "Not found",
"homeButton": "Back to home port",
"text": "We couldn't find the media ye requested. Either it's been removed or ye tampered with the URL.",
"title": "Couldn't find that media."
}
},
"nextEpisode": {
"cancel": "Cancel",
"next": "Next episode"
},
"playbackError": {
"badge": "Not found",
"errors": {
"errorAborted": "The fetchin' of the associated resource was aborted by the user's request.",
"errorDecode": "Despite havin' previously been determined to be usable, an error occurred while tryin' to decode the media resource, resultin' in an error.",
"errorGenericMedia": "Unknown media error occurred",
"errorNetwork": "Some kind of network error occurred which prevented the media from bein' successfully fetched, despite havin' previously been available.",
"errorNotSupported": "The associated resource or media provider object has been found to be unsuitable."
},
"homeButton": "Go home port",
"text": "Oh, me apologies, sweetie! The itty-bitty movie-web did its utmost bestest, but alas, no wucky videos to be spotted anywhere (´⊙ω⊙`) Please don't be angwy, wittle movie-web ish twying so hard. Can ye find it in yer heart to forgive? UwU 💖",
"title": "Whoops, it broke!"
},
"scraping": {
"items": {
"failure": "Error occurred",
"notFound": "Doesn't have the video",
"pending": "Checkin' for videos..."
},
"notFound": {
"badge": "Not found",
"homeButton": "Go home port",
"text": "Oh, me apologies, sweetie! The itty-bitty movie-web did its utmost bestest, but alas, no wucky videos to be spotted anywhere (´⊙ω⊙`) Please don't be angwy, wittle movie-web ish twying so hard. Can ye find it in yer heart to forgive? UwU 💖",
"title": "Goo goo gaa gaa"
}
},
"time": {
"regular": "{{timeWatched}} / {{duration}}",
"remaining": "{{timeLeft}} left • Finish at {{timeFinished, datetime}}",
"shortRegular": "{{timeWatched}}",
"shortRemaining": "-{{timeLeft}}"
}
},
"screens": {
"dmca": {
"text": "In an effort to address the copyright concerns associated with the website known as \"movie-web,\" the DMCA, or Digital Jolly Roger Copyright Act, has been initiated to safeguard the intellectual property rights of content creators by reportin' infringements on this platform, thereby adherin' to legal protocols for takedown requests, which, like, ye know, it's all about, like, maintainin' the integrity of intellectual property, and, um, makin' sure, like, creators get their fair share, but then, it's, like, this intricate dance of digital legalities, where ye have to, uh, like, navigate this labyrinth of code and bytes and, uh, send, ye know, these, like, electronic documents that, um, point out the, uh, alleged infringement, and it's, like, this whole, like, teeter-totter of legality, where ye're, like, balancin', um, the rights of the, ye know, creators and the, um, operation of this, like, online, uh, entity, and, like, the DMCA, it's, like, this, um, powerful tool, but, uh, it's also, like, this, um, complex puzzle, where, ye know, ye're, like, seekin' justice in the digital wilderness, and, uh, strivin' for harmony amidst the chaos of the internet, and, um, yeah, that's, like, the whole, like, DMCA-ing thing with movie-web, ye know?",
"title": "DMCA"
},
"loadingApp": "Loadin' application",
"loadingUser": "Loadin' yer pirate profile",
"loadingUserError": {
"reset": "Reset custom ship",
"text": "Failed to load yer pirate profile",
"textWithReset": "Failed to load yer pirate profile from yer custom ship, want to reset back to default?"
},
"migration": {
"failed": "Failed to migrate yer booty.",
"inProgress": "Please hold, we be migratin' yer booty. This shouldn't take long."
}
},
"settings": {
"account": {
"accountDetails": {
"deviceNameLabel": "Ship name",
"deviceNamePlaceholder": "Fremen tablet",
"editProfile": "Edit",
"logoutButton": "Abandon ship"
},
"actions": {
"delete": {
"button": "Abandon Account",
"confirmButton": "Abandon Account",
"confirmDescription": "Arrr ye sure ye want to abandon yer account? All yer booty will be lost!",
"confirmTitle": "Arrr ye sure?",
"text": "This action be irreversible. All booty will be deleted and nothin' can be recovered.",
"title": "Abandon Account"
},
"title": "Actions"
},
"devices": {
"deviceNameLabel": "Ship name",
"failed": "Failed to load sessions",
"removeDevice": "Abandon ship",
"title": "Shipmates"
},
"profile": {
"finish": "Finish editing",
"firstColor": "First color",
"secondColor": "Second color",
"title": "Edit Pirate Portrait",
"userIcon": "Pirate icon"
},
"register": {
"cta": "Get started",
"text": "Instantly share yer watch progress between devices and keep 'em synced.",
"title": "Sync to the Cloud"
},
"title": "Treasure Chest"
},
"appearance": {
"activeTheme": "Active",
"themes": {
"blue": "Blue",
"default": "Default",
"gray": "Gray",
"red": "Red",
"teal": "Teal"
},
"title": "Appearance"
},
"captions": {
"backgroundLabel": "Background opacity",
"colorLabel": "Color",
"previewQuote": "I must not fear. Fear be the mind-killer.",
"textSizeLabel": "Text size",
"title": "Captions"
},
"connections": {
"server": {
"description": "To make the application function, all traffic be routed through proxies. Enable this if ye want to bring yer own sailors.",
"label": "Custom ship",
"urlLabel": "Custom ship URL"
},
"title": "Connections",
"workers": {
"addButton": "Recruit new sailor",
"description": "To make the application function, all traffic be routed through proxies. Enable this if ye want to bring yer own sailors.",
"emptyState": "No sailors yet, add one below",
"label": "Use custom proxy sailors",
"urlLabel": "Sailor URLs",
"urlPlaceholder": "https://"
}
},
"locale": {
"language": "Application language",
"languageDescription": "Language applied to the entire application.",
"title": "Locale"
},
"reset": "Reset",
"save": "Save",
"sidebar": {
"info": {
"appVersion": "App version",
"backendUrl": "Backend URL",
"backendVersion": "Backend version",
"hostname": "Ship name",
"insecure": "Insecure",
"notLoggedIn": "Not logged in",
"secure": "Secure",
"title": "App information",
"unknownVersion": "Unknown",
"userId": "Pirate ID"
}
},
"unsaved": "Ye have unsaved changes"
}
}

View file

@ -0,0 +1,74 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "To wszystko co mamy!",
"sectionTitle": "Wyniki wyszukiwania",
"noResults": "Nie mogliśmy niczego znaleźć!",
"failed": "Nie udało się znaleźć mediów, Spróbuj ponownie!",
"loading": "Wczytywanie...",
"placeholder": "Co chciałbyś obejrzeć?"
},
"bookmarks": {
"sectionTitle": "Zakładki"
},
"continueWatching": {
"sectionTitle": "Kontynuuj oglądanie"
}
},
"media": {
"types": {
"movie": "Filmy",
"show": "Seriale"
},
"episodeDisplay": "S{{season}} E{{episode}}"
},
"player": {
"playbackError": {
"title": "Ups, popsuło się!"
},
"metadata": {
"notFound": {
"badge": "Nie znaleziono",
"homeButton": "Wróć na stronę główną",
"title": "Nie można znaleźć multimediów.",
"text": "Nie mogliśmy znaleźć rządanych multimediów. Albo zostały usunięte, albo grzebałeś przy adresie URL."
}
},
"menus": {
"captions": {
"customChoice": "Załącz",
"customizeLabel": "Personalizuj",
"title": "Napisy"
},
"sources": {
"title": "Źródła"
},
"episodes": {
"button": "Odcinki",
"loadingTitle": "Wczytywanie...",
"loadingList": "Wczytywanie..."
}
},
"back": {
"default": "Wróć na stronę główną",
"short": "Wróć"
}
},
"notFound": {
"badge": "Nie znaleziono",
"goHome": "Wróć na stronę główną",
"title": "Nie można znaleźć tej strony",
"message": "Szukaliśmy wszędzie: w koszu, w szafie a nawet w piwnicy, ale nie byliśmy w stanie znaleźć strony której szukasz."
},
"navigation": {
"banner": {
"offline": "Sprawdź swoje połączenie sieciowe"
}
},
"overlays": {
"close": "Zamknąć"
}
}

View file

@ -0,0 +1,74 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "Bu kadarını bulabildik!",
"sectionTitle": "Arama sonuçları",
"noResults": "Hiçbir şey bulamadık!",
"failed": "Medya bulunamadı, tekrar deneyin!",
"loading": "Yükleniyor...",
"placeholder": "Ne izlemek istersiniz?"
},
"bookmarks": {
"sectionTitle": "Yerimleri"
},
"continueWatching": {
"sectionTitle": "İzlemeye devam edin"
}
},
"media": {
"types": {
"movie": "Film",
"show": "Dizi"
},
"episodeDisplay": "S{{season}} B{{episode}}"
},
"player": {
"playbackError": {
"title": "Hay aksi, bozuldu!"
},
"metadata": {
"notFound": {
"badge": "Bulunamadı",
"homeButton": "Geri",
"title": "Medya bulunamadı.",
"text": "İstediğiniz medyayı bulamadık. URL'i yanlış girdiniz ya da medya kaldırıldı."
}
},
"menus": {
"captions": {
"customChoice": "Altyazı yükle",
"customizeLabel": "Kişiselleştirme",
"title": "Altyazılar"
},
"sources": {
"title": "Kaynaklar"
},
"episodes": {
"button": "Bölümler",
"loadingTitle": "Yükleniyor...",
"loadingList": "Yükleniyor..."
}
},
"back": {
"default": "Ana sayfaya dön",
"short": "Geri"
}
},
"notFound": {
"badge": "Bulunamadı",
"goHome": "Geri",
"title": "Sayfa bulunamadı",
"message": "Her yere baktık: bazanın altına, dolabın içine hatta ara sunucuya ama maalesef aradığınız sayfayı bulamadık."
},
"navigation": {
"banner": {
"offline": "İnternet bağlantınızı kontrol ediniz"
}
},
"overlays": {
"close": "Kapat"
}
}

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "Đó là tất cả chúng tôi có!",
"sectionTitle": "Kết quả tìm kiếm",
"noResults": "Chúng tôi không thể tìm thấy gì!",
"failed": "Không thể tìm thấy nội dung, hãy thử lại!",
"loading": "Đang tải...",
"placeholder": "Bạn muốn xem gì?"
},
"bookmarks": {
"sectionTitle": "Đánh dấu"
},
"continueWatching": {
"sectionTitle": "Tiếp tục xem"
}
},
"media": {
"types": {
"movie": "Phim",
"show": "Chương trình truyền hình"
},
"episodeDisplay": "M{{season}} T{{episode}}"
},
"player": {
"playbackError": {
"title": "Rất tiếc, đã hỏng!"
},
"metadata": {
"notFound": {
"badge": "Không tìm thấy",
"homeButton": "Quay lại trang chính",
"title": "Không thể tìm thấy nội dung.",
"text": "Chúng tôi không thể tìm thấy nội dung mà bạn yêu cầu. Hoặc là nó đã bị xóa, hoặc bạn đã xáo trộn URL."
}
},
"menus": {
"captions": {
"customChoice": "Tải phụ đề lên",
"customizeLabel": "Tùy chỉnh",
"title": "Phụ đề"
},
"sources": {
"title": "Nguồn"
},
"episodes": {
"button": "Tập",
"loadingTitle": "Đang tải...",
"loadingList": "Đang tải..."
}
},
"back": {
"default": "Quay lại trang chính",
"short": "Quay lại"
}
},
"notFound": {
"badge": "Không tìm thấy",
"goHome": "Quay lại trang chính",
"title": "Không thể tìm thấy trang",
"message": "Chúng tôi đã tìm kiếm khắp nơi: dưới thùng rác, trong tủ quần áo, đằng sau máy chủ proxy nhưng vẫn không thể tìm thấy trang bạn đang tìm kiếm."
},
"navigation": {
"banner": {
"offline": "Hãy kiểm tra kết nối Internet của bạn"
}
}
}

View file

@ -0,0 +1,71 @@
{
"global": {
"name": "movie-web"
},
"home": {
"search": {
"allResults": "以上是我们能找到的所有结果!",
"sectionTitle": "搜索结果",
"noResults": "我们找不到任何结果!",
"failed": "查找媒体失败,请重试!",
"loading": "载入中……",
"placeholder": "您想看些什么?"
},
"bookmarks": {
"sectionTitle": "书签"
},
"continueWatching": {
"sectionTitle": "继续观看"
}
},
"media": {
"types": {
"movie": "电影",
"show": "连续剧"
},
"episodeDisplay": "第{{season}}季 第{{episode}}集"
},
"player": {
"playbackError": {
"title": "哎呀,出问题了!"
},
"metadata": {
"notFound": {
"badge": "未找到",
"homeButton": "返回首页",
"title": "无法找到媒体.",
"text": "我们无法找到您请求的媒体。它可能已被删除,或您篡改了 URL."
}
},
"menus": {
"captions": {
"customChoice": "上传字幕",
"customizeLabel": "自定义",
"title": "字幕"
},
"sources": {
"title": "视频源"
},
"episodes": {
"button": "分集",
"loadingTitle": "载入中……",
"loadingList": "载入中……"
}
},
"back": {
"default": "返回首页",
"short": "返回"
}
},
"notFound": {
"badge": "未找到",
"goHome": "返回首页",
"title": "无法找到页面",
"message": "我们已经到处找过了:不管是垃圾桶下、橱柜里或是代理之后。但最终并没有发现您查找的页面。"
},
"navigation": {
"banner": {
"offline": "检查您的互联网连接"
}
}
}

View file

@ -0,0 +1,6 @@
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>movie-web</ShortName>
<Description>The place for your favorite movies &amp; shows</Description>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" template="{{ routeDomain }}/browse/?q={searchTerms}" />
</OpenSearchDescription>

View file

@ -0,0 +1,35 @@
import { ofetch } from "ofetch";
export interface SessionResponse {
id: string;
userId: string;
createdAt: string;
accessedAt: string;
device: string;
userAgent: string;
}
export interface LoginResponse {
session: SessionResponse;
token: string;
}
export function getAuthHeaders(token: string): Record<string, string> {
return {
authorization: `Bearer ${token}`,
};
}
export async function accountLogin(
url: string,
id: string,
deviceName: string
): Promise<LoginResponse> {
return ofetch<LoginResponse>("/auth/login", {
method: "POST",
body: {
id,
device: deviceName,
},
baseURL: url,
});
}

View file

@ -0,0 +1,64 @@
import { ofetch } from "ofetch";
import { getAuthHeaders } from "@/backend/accounts/auth";
import { BookmarkResponse } from "@/backend/accounts/user";
import { AccountWithToken } from "@/stores/auth";
import { BookmarkMediaItem } from "@/stores/bookmarks";
export interface BookmarkMetaInput {
title: string;
year: number;
poster?: string;
type: string;
}
export interface BookmarkInput {
tmdbId: string;
meta: BookmarkMetaInput;
}
export function bookmarkMediaToInput(
tmdbId: string,
item: BookmarkMediaItem
): BookmarkInput {
return {
meta: {
title: item.title,
type: item.type,
poster: item.poster,
year: item.year ?? 0,
},
tmdbId,
};
}
export async function addBookmark(
url: string,
account: AccountWithToken,
input: BookmarkInput
) {
return ofetch<BookmarkResponse>(
`/users/${account.userId}/bookmarks/${input.tmdbId}`,
{
method: "POST",
headers: getAuthHeaders(account.token),
baseURL: url,
body: input,
}
);
}
export async function removeBookmark(
url: string,
account: AccountWithToken,
id: string
) {
return ofetch<{ tmdbId: string }>(
`/users/${account.userId}/bookmarks/${id}`,
{
method: "DELETE",
headers: getAuthHeaders(account.token),
baseURL: url,
}
);
}

View file

@ -0,0 +1,131 @@
import { pbkdf2Async } from "@noble/hashes/pbkdf2";
import { sha256 } from "@noble/hashes/sha256";
import { generateMnemonic, validateMnemonic } from "@scure/bip39";
import { wordlist } from "@scure/bip39/wordlists/english";
import forge from "node-forge";
type Keys = {
privateKey: Uint8Array;
publicKey: Uint8Array;
seed: Uint8Array;
};
async function seedFromMnemonic(mnemonic: string) {
return pbkdf2Async(sha256, mnemonic, "mnemonic", {
c: 2048,
dkLen: 32,
});
}
export function verifyValidMnemonic(mnemonic: string) {
return validateMnemonic(mnemonic, wordlist);
}
export async function keysFromMnemonic(mnemonic: string): Promise<Keys> {
const seed = await seedFromMnemonic(mnemonic);
const { privateKey, publicKey } = forge.pki.ed25519.generateKeyPair({
seed,
});
return {
privateKey,
publicKey,
seed,
};
}
export function genMnemonic(): string {
return generateMnemonic(wordlist);
}
export async function signCode(
code: string,
privateKey: Uint8Array
): Promise<Uint8Array> {
return forge.pki.ed25519.sign({
encoding: "utf8",
message: code,
privateKey,
});
}
export function bytesToBase64(bytes: Uint8Array) {
return forge.util.encode64(String.fromCodePoint(...bytes));
}
export function bytesToBase64Url(bytes: Uint8Array): string {
return bytesToBase64(bytes)
.replace(/\//g, "_")
.replace(/\+/g, "-")
.replace(/=+$/, "");
}
export async function signChallenge(keys: Keys, challengeCode: string) {
const signature = await signCode(challengeCode, keys.privateKey);
return bytesToBase64Url(signature);
}
export function base64ToBuffer(data: string) {
return forge.util.binary.base64.decode(data);
}
export function base64ToStringBuffer(data: string) {
return forge.util.createBuffer(base64ToBuffer(data));
}
export function stringBufferToBase64(buffer: forge.util.ByteStringBuffer) {
return forge.util.encode64(buffer.getBytes());
}
export async function encryptData(data: string, secret: Uint8Array) {
if (secret.byteLength !== 32)
throw new Error("Secret must be at least 256-bit");
const iv = await new Promise<string>((resolve, reject) => {
forge.random.getBytes(16, (err, bytes) => {
if (err) reject(err);
resolve(bytes);
});
});
const cipher = forge.cipher.createCipher(
"AES-GCM",
forge.util.createBuffer(secret)
);
cipher.start({
iv,
tagLength: 128,
});
cipher.update(forge.util.createBuffer(data, "utf8"));
cipher.finish();
const encryptedData = cipher.output;
const tag = cipher.mode.tag;
return `${forge.util.encode64(iv)}.${stringBufferToBase64(
encryptedData
)}.${stringBufferToBase64(tag)}` as const;
}
export function decryptData(data: string, secret: Uint8Array) {
if (secret.byteLength !== 32) throw new Error("Secret must be 256-bit");
const [iv, encryptedData, tag] = data.split(".");
const decipher = forge.cipher.createDecipher(
"AES-GCM",
forge.util.createBuffer(secret)
);
decipher.start({
iv: base64ToStringBuffer(iv),
tag: base64ToStringBuffer(tag),
tagLength: 128,
});
decipher.update(base64ToStringBuffer(encryptedData));
const pass = decipher.finish();
if (!pass) throw new Error("Error decrypting data");
return decipher.output.toString();
}

View file

@ -0,0 +1,33 @@
import { ofetch } from "ofetch";
import { getAuthHeaders } from "@/backend/accounts/auth";
import { AccountWithToken } from "@/stores/auth";
import { BookmarkInput } from "./bookmarks";
import { ProgressInput } from "./progress";
export function importProgress(
url: string,
account: AccountWithToken,
progressItems: ProgressInput[]
) {
return ofetch<void>(`/users/${account.userId}/progress/import`, {
method: "PUT",
body: progressItems,
baseURL: url,
headers: getAuthHeaders(account.token),
});
}
export function importBookmarks(
url: string,
account: AccountWithToken,
bookmarks: BookmarkInput[]
) {
return ofetch<void>(`/users/${account.userId}/bookmarks`, {
method: "PUT",
body: bookmarks,
baseURL: url,
headers: getAuthHeaders(account.token),
});
}

View file

@ -0,0 +1,48 @@
import { ofetch } from "ofetch";
import { SessionResponse } from "@/backend/accounts/auth";
export interface ChallengeTokenResponse {
challenge: string;
}
export async function getLoginChallengeToken(
url: string,
publicKey: string
): Promise<ChallengeTokenResponse> {
return ofetch<ChallengeTokenResponse>("/auth/login/start", {
method: "POST",
body: {
publicKey,
},
baseURL: url,
});
}
export interface LoginResponse {
session: SessionResponse;
token: string;
}
export interface LoginInput {
publicKey: string;
challenge: {
code: string;
signature: string;
};
device: string;
}
export async function loginAccount(
url: string,
data: LoginInput
): Promise<LoginResponse> {
return ofetch<LoginResponse>("/auth/login/complete", {
method: "POST",
body: {
namespace: "movie-web",
...data,
},
baseURL: url,
});
}

View file

@ -0,0 +1,15 @@
import { ofetch } from "ofetch";
export interface MetaResponse {
version: string;
name: string;
description?: string;
hasCaptcha: boolean;
captchaClientKey?: string;
}
export async function getBackendMeta(url: string): Promise<MetaResponse> {
return ofetch<MetaResponse>("/meta", {
baseURL: url,
});
}

View file

@ -0,0 +1,115 @@
import { ofetch } from "ofetch";
import { getAuthHeaders } from "@/backend/accounts/auth";
import { ProgressResponse } from "@/backend/accounts/user";
import { AccountWithToken } from "@/stores/auth";
import { ProgressMediaItem, ProgressUpdateItem } from "@/stores/progress";
export interface ProgressInput {
meta?: {
title: string;
year: number;
poster?: string;
type: string;
};
tmdbId: string;
watched: number;
duration: number;
seasonId?: string;
episodeId?: string;
seasonNumber?: number;
episodeNumber?: number;
updatedAt?: string;
}
export function progressUpdateItemToInput(
item: ProgressUpdateItem
): ProgressInput {
return {
duration: item.progress?.duration ?? 0,
watched: item.progress?.watched ?? 0,
tmdbId: item.tmdbId,
meta: {
title: item.title ?? "",
type: item.type ?? "",
year: item.year ?? NaN,
poster: item.poster,
},
episodeId: item.episodeId,
seasonId: item.seasonId,
episodeNumber: item.episodeNumber,
seasonNumber: item.seasonNumber,
};
}
export function progressMediaItemToInputs(
tmdbId: string,
item: ProgressMediaItem
): ProgressInput[] {
if (item.type === "show") {
return Object.entries(item.episodes).flatMap(([_, episode]) => ({
duration: item.progress?.duration ?? episode.progress.duration,
watched: item.progress?.watched ?? episode.progress.watched,
tmdbId,
meta: {
title: item.title ?? "",
type: item.type ?? "",
year: item.year ?? NaN,
poster: item.poster,
},
episodeId: episode.id,
seasonId: episode.seasonId,
episodeNumber: episode.number,
seasonNumber: item.seasons[episode.seasonId].number,
updatedAt: new Date(episode.updatedAt).toISOString(),
}));
}
return [
{
duration: item.progress?.duration ?? 0,
watched: item.progress?.watched ?? 0,
tmdbId,
updatedAt: new Date(item.updatedAt).toISOString(),
meta: {
title: item.title ?? "",
type: item.type ?? "",
year: item.year ?? NaN,
poster: item.poster,
},
},
];
}
export async function setProgress(
url: string,
account: AccountWithToken,
input: ProgressInput
) {
return ofetch<ProgressResponse>(
`/users/${account.userId}/progress/${input.tmdbId}`,
{
method: "PUT",
headers: getAuthHeaders(account.token),
baseURL: url,
body: input,
}
);
}
export async function removeProgress(
url: string,
account: AccountWithToken,
id: string,
episodeId?: string,
seasonId?: string
) {
await ofetch(`/users/${account.userId}/progress/${id}`, {
method: "DELETE",
headers: getAuthHeaders(account.token),
baseURL: url,
body: {
episodeId,
seasonId,
},
});
}

View file

@ -0,0 +1,55 @@
import { ofetch } from "ofetch";
import { SessionResponse } from "@/backend/accounts/auth";
import { UserResponse } from "@/backend/accounts/user";
export interface ChallengeTokenResponse {
challenge: string;
}
export async function getRegisterChallengeToken(
url: string,
captchaToken?: string
): Promise<ChallengeTokenResponse> {
return ofetch<ChallengeTokenResponse>("/auth/register/start", {
method: "POST",
body: {
captchaToken,
},
baseURL: url,
});
}
export interface RegisterResponse {
user: UserResponse;
session: SessionResponse;
token: string;
}
export interface RegisterInput {
publicKey: string;
challenge: {
code: string;
signature: string;
};
device: string;
profile: {
colorA: string;
colorB: string;
icon: string;
};
}
export async function registerAccount(
url: string,
data: RegisterInput
): Promise<RegisterResponse> {
return ofetch<RegisterResponse>("/auth/register/complete", {
method: "POST",
body: {
namespace: "movie-web",
...data,
},
baseURL: url,
});
}

View file

@ -0,0 +1,49 @@
import { ofetch } from "ofetch";
import { getAuthHeaders } from "@/backend/accounts/auth";
import { AccountWithToken } from "@/stores/auth";
export interface SessionResponse {
id: string;
userId: string;
createdAt: string;
accessedAt: string;
device: string;
userAgent: string;
}
export interface SessionUpdate {
deviceName: string;
}
export async function getSessions(url: string, account: AccountWithToken) {
return ofetch<SessionResponse[]>(`/users/${account.userId}/sessions`, {
headers: getAuthHeaders(account.token),
baseURL: url,
});
}
export async function updateSession(
url: string,
account: AccountWithToken,
update: SessionUpdate
) {
return ofetch<SessionResponse[]>(`/sessions/${account.sessionId}`, {
method: "PATCH",
headers: getAuthHeaders(account.token),
body: update,
baseURL: url,
});
}
export async function removeSession(
url: string,
token: string,
sessionId: string
) {
return ofetch<SessionResponse[]>(`/sessions/${sessionId}`, {
method: "DELETE",
headers: getAuthHeaders(token),
baseURL: url,
});
}

View file

@ -0,0 +1,37 @@
import { ofetch } from "ofetch";
import { getAuthHeaders } from "@/backend/accounts/auth";
import { AccountWithToken } from "@/stores/auth";
export interface SettingsInput {
applicationLanguage?: string;
applicationTheme?: string | null;
defaultSubtitleLanguage?: string;
}
export interface SettingsResponse {
applicationTheme?: string | null;
applicationLanguage?: string | null;
defaultSubtitleLanguage?: string | null;
}
export function updateSettings(
url: string,
account: AccountWithToken,
settings: SettingsInput
) {
return ofetch<SettingsResponse>(`/users/${account.userId}/settings`, {
method: "PUT",
body: settings,
baseURL: url,
headers: getAuthHeaders(account.token),
});
}
export function getSettings(url: string, account: AccountWithToken) {
return ofetch<SettingsResponse>(`/users/${account.userId}/settings`, {
method: "GET",
baseURL: url,
headers: getAuthHeaders(account.token),
});
}

View file

@ -0,0 +1,171 @@
import { ofetch } from "ofetch";
import { SessionResponse, getAuthHeaders } from "@/backend/accounts/auth";
import { AccountWithToken } from "@/stores/auth";
import { BookmarkMediaItem } from "@/stores/bookmarks";
import { ProgressMediaItem } from "@/stores/progress";
export interface UserResponse {
id: string;
namespace: string;
name: string;
roles: string[];
createdAt: string;
profile: {
colorA: string;
colorB: string;
icon: string;
};
}
export interface UserEdit {
profile?: {
colorA: string;
colorB: string;
icon: string;
};
}
export interface BookmarkResponse {
tmdbId: string;
meta: {
title: string;
year: number;
poster?: string;
type: "show" | "movie";
};
updatedAt: string;
}
export interface ProgressResponse {
tmdbId: string;
season: {
id?: string;
number?: number;
};
episode: {
id?: string;
number?: number;
};
meta: {
title: string;
year: number;
poster?: string;
type: "show" | "movie";
};
duration: string;
watched: string;
updatedAt: string;
}
export function bookmarkResponsesToEntries(responses: BookmarkResponse[]) {
const entries = responses.map((bookmark) => {
const item: BookmarkMediaItem = {
...bookmark.meta,
updatedAt: new Date(bookmark.updatedAt).getTime(),
};
return [bookmark.tmdbId, item] as const;
});
return Object.fromEntries(entries);
}
export function progressResponsesToEntries(responses: ProgressResponse[]) {
const items: Record<string, ProgressMediaItem> = {};
responses.forEach((v) => {
if (!items[v.tmdbId]) {
items[v.tmdbId] = {
title: v.meta.title,
poster: v.meta.poster,
type: v.meta.type,
updatedAt: new Date(v.updatedAt).getTime(),
episodes: {},
seasons: {},
year: v.meta.year,
};
}
const item = items[v.tmdbId];
if (item.type === "movie") {
item.progress = {
duration: Number(v.duration),
watched: Number(v.watched),
};
}
if (item.type === "show" && v.season.id && v.episode.id) {
item.seasons[v.season.id] = {
id: v.season.id,
number: v.season.number ?? 0,
title: "",
};
item.episodes[v.episode.id] = {
id: v.episode.id,
number: v.episode.number ?? 0,
title: "",
progress: {
duration: Number(v.duration),
watched: Number(v.watched),
},
seasonId: v.season.id,
updatedAt: new Date(v.updatedAt).getTime(),
};
}
});
return items;
}
export async function getUser(
url: string,
token: string
): Promise<{ user: UserResponse; session: SessionResponse }> {
return ofetch<{ user: UserResponse; session: SessionResponse }>(
"/users/@me",
{
headers: getAuthHeaders(token),
baseURL: url,
}
);
}
export async function editUser(
url: string,
account: AccountWithToken,
object: UserEdit
): Promise<{ user: UserResponse; session: SessionResponse }> {
return ofetch<{ user: UserResponse; session: SessionResponse }>(
`/users/${account.userId}`,
{
method: "PATCH",
headers: getAuthHeaders(account.token),
body: object,
baseURL: url,
}
);
}
export async function deleteUser(
url: string,
account: AccountWithToken
): Promise<UserResponse> {
return ofetch<UserResponse>(`/users/${account.userId}`, {
headers: getAuthHeaders(account.token),
baseURL: url,
});
}
export async function getBookmarks(url: string, account: AccountWithToken) {
return ofetch<BookmarkResponse[]>(`/users/${account.userId}/bookmarks`, {
headers: getAuthHeaders(account.token),
baseURL: url,
});
}
export async function getProgress(url: string, account: AccountWithToken) {
return ofetch<ProgressResponse[]>(`/users/${account.userId}/progress`, {
headers: getAuthHeaders(account.token),
baseURL: url,
});
}

View file

@ -1 +0,0 @@
embed scrapers go here

View file

@ -1,32 +0,0 @@
import { MWEmbedType } from "@/backend/helpers/embed";
import { registerEmbedScraper } from "@/backend/helpers/register";
import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams";
import { proxiedFetch } from "../helpers/fetch";
registerEmbedScraper({
id: "mp4upload",
displayName: "mp4upload",
for: MWEmbedType.MP4UPLOAD,
rank: 170,
async getStream({ url }) {
const embed = await proxiedFetch<any>(url);
const playerSrcRegex =
/(?<=player\.src\()\s*{\s*type:\s*"[^"]+",\s*src:\s*"([^"]+)"\s*}\s*(?=\);)/s;
const playerSrc = embed.match(playerSrcRegex);
const streamUrl = playerSrc[1];
if (!streamUrl) throw new Error("Stream url not found");
return {
embedId: MWEmbedType.MP4UPLOAD,
streamUrl,
quality: MWStreamQuality.Q1080P,
captions: [],
type: MWStreamType.MP4,
};
},
});

View file

@ -1,20 +0,0 @@
import { MWEmbedType } from "@/backend/helpers/embed";
import { registerEmbedScraper } from "@/backend/helpers/register";
import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams";
registerEmbedScraper({
id: "playm4u",
displayName: "playm4u",
for: MWEmbedType.PLAYM4U,
rank: 0,
async getStream() {
// throw new Error("Oh well 2")
return {
embedId: "",
streamUrl: "",
quality: MWStreamQuality.Q1080P,
captions: [],
type: MWStreamType.MP4,
};
},
});

View file

@ -1,66 +0,0 @@
import { MWEmbedType } from "@/backend/helpers/embed";
import { proxiedFetch } from "@/backend/helpers/fetch";
import { registerEmbedScraper } from "@/backend/helpers/register";
import {
MWEmbedStream,
MWStreamQuality,
MWStreamType,
} from "@/backend/helpers/streams";
const HOST = "streamm4u.club";
const URL_BASE = `https://${HOST}`;
const URL_API = `${URL_BASE}/api`;
const URL_API_SOURCE = `${URL_API}/source`;
async function scrape(embed: string) {
const sources: MWEmbedStream[] = [];
const embedID = embed.split("/").pop();
console.log(`${URL_API_SOURCE}/${embedID}`);
const json = await proxiedFetch<any>(`${URL_API_SOURCE}/${embedID}`, {
method: "POST",
body: `r=&d=${HOST}`,
});
if (json.success) {
const streams = json.data;
for (const stream of streams) {
sources.push({
embedId: "",
streamUrl: stream.file as string,
quality: stream.label as MWStreamQuality,
type: stream.type as MWStreamType,
captions: [],
});
}
}
return sources;
}
// TODO check out 403 / 404 on successfully returned video stream URLs
registerEmbedScraper({
id: "streamm4u",
displayName: "streamm4u",
for: MWEmbedType.STREAMM4U,
rank: 100,
async getStream({ progress, url }) {
// const scrapingThreads = [];
// const streams = [];
const sources = (await scrape(url)).sort(
(a, b) =>
Number(b.quality.replace("p", "")) - Number(a.quality.replace("p", ""))
);
// const preferredSourceIndex = 0;
const preferredSource = sources[0];
if (!preferredSource) throw new Error("No source found");
progress(100);
return preferredSource;
},
});

View file

@ -1,211 +0,0 @@
import Base64 from "crypto-js/enc-base64";
import Utf8 from "crypto-js/enc-utf8";
import { MWEmbedType } from "@/backend/helpers/embed";
import { proxiedFetch } from "@/backend/helpers/fetch";
import { registerEmbedScraper } from "@/backend/helpers/register";
import {
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "@/backend/helpers/streams";
const qualityOrder = [
MWStreamQuality.Q1080P,
MWStreamQuality.Q720P,
MWStreamQuality.Q480P,
MWStreamQuality.Q360P,
];
async function fetchCaptchaToken(domain: string, recaptchaKey: string) {
const domainHash = Base64.stringify(Utf8.parse(domain)).replace(/=/g, ".");
const recaptchaRender = await proxiedFetch<any>(
`https://www.google.com/recaptcha/api.js?render=${recaptchaKey}`
);
const vToken = recaptchaRender.substring(
recaptchaRender.indexOf("/releases/") + 10,
recaptchaRender.indexOf("/recaptcha__en.js")
);
const recaptchaAnchor = await proxiedFetch<any>(
`https://www.google.com/recaptcha/api2/anchor?ar=1&hl=en&size=invisible&cb=flicklax&k=${recaptchaKey}&co=${domainHash}&v=${vToken}`
);
const cToken = new DOMParser()
.parseFromString(recaptchaAnchor, "text/html")
.getElementById("recaptcha-token")
?.getAttribute("value");
if (!cToken) throw new Error("Unable to find cToken");
const payload = {
v: vToken,
reason: "q",
k: recaptchaKey,
c: cToken,
sa: "",
co: domain,
};
const tokenData = await proxiedFetch<string>(
`https://www.google.com/recaptcha/api2/reload?${new URLSearchParams(
payload
).toString()}`,
{
headers: { referer: "https://www.google.com/recaptcha/api2/" },
method: "POST",
}
);
const token = tokenData.match('rresp","(.+?)"');
return token ? token[1] : null;
}
registerEmbedScraper({
id: "streamsb",
displayName: "StreamSB",
for: MWEmbedType.STREAMSB,
rank: 150,
async getStream({ url, progress }) {
/* Url variations
- domain.com/{id}?.html
- domain.com/{id}
- domain.com/embed-{id}
- domain.com/d/{id}
- domain.com/e/{id}
- domain.com/e/{id}-embed
*/
const streamsbUrl = url
.replace(".html", "")
.replace("embed-", "")
.replace("e/", "")
.replace("d/", "");
const parsedUrl = new URL(streamsbUrl);
const base = await proxiedFetch<any>(
`${parsedUrl.origin}/d${parsedUrl.pathname}`
);
progress(20);
// Parse captions from url
const captionUrl = parsedUrl.searchParams.get("caption_1");
const captionLang = parsedUrl.searchParams.get("sub_1");
const basePage = new DOMParser().parseFromString(base, "text/html");
const downloadVideoFunctions = basePage.querySelectorAll(
"[onclick^=download_video]"
);
let dlDetails = [];
for (const func of downloadVideoFunctions) {
const funcContents = func.getAttribute("onclick");
const regExpFunc = /download_video\('(.+?)','(.+?)','(.+?)'\)/;
const matchesFunc = regExpFunc.exec(funcContents ?? "");
if (matchesFunc !== null) {
const quality = func.querySelector("span")?.textContent;
const regExpQuality = /(.+?) \((.+?)\)/;
const matchesQuality = regExpQuality.exec(quality ?? "");
if (matchesQuality !== null) {
dlDetails.push({
parameters: [matchesFunc[1], matchesFunc[2], matchesFunc[3]],
quality: {
label: matchesQuality[1].trim(),
size: matchesQuality[2],
},
});
}
}
}
dlDetails = dlDetails.sort((a, b) => {
const aQuality = qualityOrder.indexOf(a.quality.label as MWStreamQuality);
const bQuality = qualityOrder.indexOf(b.quality.label as MWStreamQuality);
return aQuality - bQuality;
});
progress(40);
let dls = await Promise.all(
dlDetails.map(async (dl) => {
const getDownload = await proxiedFetch<any>(
`/dl?op=download_orig&id=${dl.parameters[0]}&mode=${dl.parameters[1]}&hash=${dl.parameters[2]}`,
{
baseURL: parsedUrl.origin,
}
);
const downloadPage = new DOMParser().parseFromString(
getDownload,
"text/html"
);
const recaptchaKey = downloadPage
.querySelector(".g-recaptcha")
?.getAttribute("data-sitekey");
if (!recaptchaKey) throw new Error("Unable to get captcha key");
const captchaToken = await fetchCaptchaToken(
parsedUrl.origin,
recaptchaKey
);
if (!captchaToken) throw new Error("Unable to get captcha token");
const dlForm = new FormData();
dlForm.append("op", "download_orig");
dlForm.append("id", dl.parameters[0]);
dlForm.append("mode", dl.parameters[1]);
dlForm.append("hash", dl.parameters[2]);
dlForm.append("g-recaptcha-response", captchaToken);
const download = await proxiedFetch<any>(
`/dl?op=download_orig&id=${dl.parameters[0]}&mode=${dl.parameters[1]}&hash=${dl.parameters[2]}`,
{
baseURL: parsedUrl.origin,
method: "POST",
body: dlForm,
}
);
const dlLink = new DOMParser()
.parseFromString(download, "text/html")
.querySelector(".btn.btn-light.btn-lg")
?.getAttribute("href");
return {
quality: dl.quality.label as MWStreamQuality,
url: dlLink,
size: dl.quality.size,
captions:
captionUrl && captionLang
? [
{
url: captionUrl,
langIso: captionLang,
type: MWCaptionType.VTT,
},
]
: [],
};
})
);
dls = dls.filter((d) => !!d.url);
progress(60);
// TODO: Quality selection for embed scrapers
const dl = dls[0];
if (!dl.url) throw new Error("No stream url found");
return {
embedId: MWEmbedType.STREAMSB,
streamUrl: dl.url,
quality: dl.quality,
captions: dl.captions,
type: MWStreamType.MP4,
};
},
});

View file

@ -1,135 +0,0 @@
import { AES, enc } from "crypto-js";
import { MWEmbedType } from "@/backend/helpers/embed";
import { registerEmbedScraper } from "@/backend/helpers/register";
import {
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "@/backend/helpers/streams";
import { proxiedFetch } from "../helpers/fetch";
interface StreamRes {
server: number;
sources: string;
tracks: {
file: string;
kind: "captions" | "thumbnails";
label: string;
}[];
}
function isJSON(json: string) {
try {
JSON.parse(json);
return true;
} catch {
return false;
}
}
function extractKey(script: string): [number, number][] | null {
const startOfSwitch = script.lastIndexOf("switch");
const endOfCases = script.indexOf("partKeyStartPosition");
const switchBody = script.slice(startOfSwitch, endOfCases);
const nums: [number, number][] = [];
const matches = switchBody.matchAll(
/:[a-zA-Z0-9]+=([a-zA-Z0-9]+),[a-zA-Z0-9]+=([a-zA-Z0-9]+);/g
);
for (const match of matches) {
const innerNumbers: number[] = [];
for (const varMatch of [match[1], match[2]]) {
const regex = new RegExp(`${varMatch}=0x([a-zA-Z0-9]+)`, "g");
const varMatches = [...script.matchAll(regex)];
const lastMatch = varMatches[varMatches.length - 1];
if (!lastMatch) return null;
const number = parseInt(lastMatch[1], 16);
innerNumbers.push(number);
}
nums.push([innerNumbers[0], innerNumbers[1]]);
}
return nums;
}
registerEmbedScraper({
id: "upcloud",
displayName: "UpCloud",
for: MWEmbedType.UPCLOUD,
rank: 200,
async getStream({ url }) {
// Example url: https://dokicloud.one/embed-4/{id}?z=
const parsedUrl = new URL(url.replace("embed-5", "embed-4"));
const dataPath = parsedUrl.pathname.split("/");
const dataId = dataPath[dataPath.length - 1];
const streamRes = await proxiedFetch<StreamRes>(
`${parsedUrl.origin}/ajax/embed-4/getSources?id=${dataId}`,
{
headers: {
Referer: parsedUrl.origin,
"X-Requested-With": "XMLHttpRequest",
},
}
);
let sources: { file: string; type: string } | null = null;
if (!isJSON(streamRes.sources)) {
const scriptJs = await proxiedFetch<string>(
`https://rabbitstream.net/js/player/prod/e4-player.min.js`,
{
responseType: "text" as any,
}
);
const decryptionKey = extractKey(scriptJs);
if (!decryptionKey) throw new Error("Key extraction failed");
let extractedKey = "";
let strippedSources = streamRes.sources;
let totalledOffset = 0;
decryptionKey.forEach(([a, b]) => {
const start = a + totalledOffset;
const end = start + b;
extractedKey += streamRes.sources.slice(start, end);
strippedSources = strippedSources.replace(
streamRes.sources.substring(start, end),
""
);
totalledOffset += b;
});
const decryptedStream = AES.decrypt(
strippedSources,
extractedKey
).toString(enc.Utf8);
const parsedStream = JSON.parse(decryptedStream)[0];
if (!parsedStream) throw new Error("No stream found");
sources = parsedStream;
}
if (!sources) throw new Error("upcloud source not found");
return {
embedId: MWEmbedType.UPCLOUD,
streamUrl: sources.file,
quality: MWStreamQuality.Q1080P,
type: MWStreamType.HLS,
captions: streamRes.tracks
.filter((sub) => sub.kind === "captions")
.map((sub) => {
return {
langIso: sub.label,
url: sub.file,
type: sub.file.endsWith("vtt")
? MWCaptionType.VTT
: MWCaptionType.UNKNOWN,
};
}),
};
},
});

View file

@ -1,62 +0,0 @@
import DOMPurify from "dompurify";
import { convert, detect, list, parse } from "subsrt-ts";
import { ContentCaption } from "subsrt-ts/dist/types/handler";
import { mwFetch, proxiedFetch } from "@/backend/helpers/fetch";
import { MWCaption, MWCaptionType } from "@/backend/helpers/streams";
export const customCaption = "external-custom";
export function makeCaptionId(caption: MWCaption, isLinked: boolean): string {
return isLinked ? `linked-${caption.langIso}` : `external-${caption.langIso}`;
}
export const subtitleTypeList = list().map((type) => `.${type}`);
export function isSupportedSubtitle(url: string): boolean {
return subtitleTypeList.some((type) => url.endsWith(type));
}
export function getMWCaptionTypeFromUrl(url: string): MWCaptionType {
if (!isSupportedSubtitle(url)) return MWCaptionType.UNKNOWN;
const type = subtitleTypeList.find((t) => url.endsWith(t));
if (!type) return MWCaptionType.UNKNOWN;
return type.slice(1) as MWCaptionType;
}
export const sanitize = DOMPurify.sanitize;
export async function getCaptionUrl(caption: MWCaption): Promise<string> {
let captionBlob: Blob;
if (caption.url.startsWith("blob:")) {
// custom subtitle
captionBlob = await (await fetch(caption.url)).blob();
} else if (caption.needsProxy) {
captionBlob = await proxiedFetch<Blob>(caption.url, {
responseType: "blob" as any,
});
} else {
captionBlob = await mwFetch<Blob>(caption.url, {
responseType: "blob" as any,
});
}
// convert to vtt for track element source which will be used in PiP mode
const text = await captionBlob.text();
const vtt = convert(text, "vtt");
return URL.createObjectURL(new Blob([vtt], { type: "text/vtt" }));
}
export function revokeCaptionBlob(url: string | undefined) {
if (url && url.startsWith("blob:")) {
URL.revokeObjectURL(url);
}
}
export function parseSubtitles(text: string): ContentCaption[] {
const textTrimmed = text.trim();
if (textTrimmed === "") {
throw new Error("Given text is empty");
}
if (detect(textTrimmed) === "") {
throw new Error("Invalid subtitle format");
}
return parse(textTrimmed).filter(
(cue) => cue.type === "caption"
) as ContentCaption[];
}

View file

@ -1,30 +0,0 @@
import { MWEmbedStream } from "./streams";
export enum MWEmbedType {
M4UFREE = "m4ufree",
STREAMM4U = "streamm4u",
PLAYM4U = "playm4u",
UPCLOUD = "upcloud",
STREAMSB = "streamsb",
MP4UPLOAD = "mp4upload",
}
export type MWEmbed = {
type: MWEmbedType;
url: string;
};
export type MWEmbedContext = {
progress(percentage: number): void;
url: string;
};
export type MWEmbedScraper = {
id: string;
displayName: string;
for: MWEmbedType;
rank: number;
disabled?: boolean;
getStream(ctx: MWEmbedContext): Promise<MWEmbedStream>;
};

View file

@ -1,18 +1,9 @@
import { FetchOptions, FetchResponse, ofetch } from "ofetch";
import { conf } from "@/setup/config";
import { getLoadbalancedProxyUrl } from "@/utils/providers";
let proxyUrlIndex = Math.floor(Math.random() * conf().PROXY_URLS.length);
// round robins all proxy urls
function getProxyUrl(): string {
const url = conf().PROXY_URLS[proxyUrlIndex];
proxyUrlIndex = (proxyUrlIndex + 1) % conf().PROXY_URLS.length;
return url;
}
type P<T> = Parameters<typeof ofetch<T>>;
type R<T> = ReturnType<typeof ofetch<T>>;
type P<T> = Parameters<typeof ofetch<T, any>>;
type R<T> = ReturnType<typeof ofetch<T, any>>;
const baseFetch = ofetch.create({
retry: 0,
@ -50,13 +41,17 @@ export function proxiedFetch<T>(url: string, ops: P<T>[1] = {}): R<T> {
Object.entries(ops?.params ?? {}).forEach(([k, v]) => {
parsedUrl.searchParams.set(k, v);
});
Object.entries(ops?.query ?? {}).forEach(([k, v]) => {
parsedUrl.searchParams.set(k, v);
});
return baseFetch<T>(getProxyUrl(), {
return baseFetch<T>(getLoadbalancedProxyUrl(), {
...ops,
baseURL: undefined,
params: {
destination: parsedUrl.toString(),
},
query: {},
});
}
@ -84,7 +79,7 @@ export function rawProxiedFetch<T>(
parsedUrl.searchParams.set(k, v);
});
return baseFetch.raw(getProxyUrl(), {
return baseFetch.raw(getLoadbalancedProxyUrl(), {
...ops,
baseURL: undefined,
params: {

View file

@ -1,36 +0,0 @@
import { MWEmbed } from "./embed";
import { MWStream } from "./streams";
import { DetailedMeta } from "../metadata/getmeta";
import { MWMediaType } from "../metadata/types/mw";
export type MWProviderScrapeResult = {
stream?: MWStream;
embeds: MWEmbed[];
};
type MWProviderBase = {
progress(percentage: number): void;
media: DetailedMeta;
};
type MWProviderTypeSpecific =
| {
type: MWMediaType.MOVIE | MWMediaType.ANIME;
episode?: undefined;
season?: undefined;
}
| {
type: MWMediaType.SERIES;
episode: string;
season: string;
};
export type MWProviderContext = MWProviderTypeSpecific & MWProviderBase;
export type MWProvider = {
id: string;
displayName: string;
rank: number;
disabled?: boolean;
type: MWMediaType[];
scrape(ctx: MWProviderContext): Promise<MWProviderScrapeResult>;
};

View file

@ -1,72 +0,0 @@
import { MWEmbedScraper, MWEmbedType } from "./embed";
import { MWProvider } from "./provider";
let providers: MWProvider[] = [];
let embeds: MWEmbedScraper[] = [];
export function registerProvider(provider: MWProvider) {
if (provider.disabled) return;
providers.push(provider);
}
export function registerEmbedScraper(embed: MWEmbedScraper) {
if (embed.disabled) return;
embeds.push(embed);
}
export function initializeScraperStore() {
// sort by ranking
providers = providers.sort((a, b) => b.rank - a.rank);
embeds = embeds.sort((a, b) => b.rank - a.rank);
// check for invalid ranks
let lastRank: null | number = null;
providers.forEach((v) => {
if (lastRank === null) {
lastRank = v.rank;
return;
}
if (lastRank === v.rank)
throw new Error(`Duplicate rank number for provider ${v.id}`);
lastRank = v.rank;
});
lastRank = null;
providers.forEach((v) => {
if (lastRank === null) {
lastRank = v.rank;
return;
}
if (lastRank === v.rank)
throw new Error(`Duplicate rank number for embed scraper ${v.id}`);
lastRank = v.rank;
});
// check for duplicate ids
const providerIds = providers.map((v) => v.id);
if (
providerIds.length > 0 &&
new Set(providerIds).size !== providerIds.length
)
throw new Error("Duplicate IDS in providers");
const embedIds = embeds.map((v) => v.id);
if (embedIds.length > 0 && new Set(embedIds).size !== embedIds.length)
throw new Error("Duplicate IDS in embed scrapers");
// check for duplicate embed types
const embedTypes = embeds.map((v) => v.for);
if (embedTypes.length > 0 && new Set(embedTypes).size !== embedTypes.length)
throw new Error("Duplicate types in embed scrapers");
}
export function getProviders(): MWProvider[] {
return providers;
}
export function getEmbeds(): MWEmbedScraper[] {
return embeds;
}
export function getEmbedScraperByType(
type: MWEmbedType
): MWEmbedScraper | null {
return getEmbeds().find((v) => v.for === type) ?? null;
}

View file

@ -0,0 +1,140 @@
import { ScrapeMedia } from "@movie-web/providers";
import { ofetch } from "ofetch";
import { useCallback } from "react";
import { ScrapingItems, ScrapingSegment } from "@/hooks/useProviderScrape";
import { PlayerMeta } from "@/stores/player/slices/source";
// for anybody who cares - these are anonymous metrics.
// They are just used for figuring out if providers are broken or not
const metricsEndpoint = "https://backend.movie-web.app/metrics/providers";
export type ProviderMetric = {
tmdbId: string;
type: string;
title: string;
seasonId?: string;
episodeId?: string;
status: "failed" | "notfound" | "success";
providerId: string;
embedId?: string;
errorMessage?: string;
fullError?: string;
};
function getStackTrace(error: Error, lines: number) {
const topMessage = error.toString();
const stackTraceLines = (error.stack ?? "").split("\n", lines + 1);
stackTraceLines.pop();
return `${topMessage}\n\n${stackTraceLines.join("\n")}`;
}
export async function reportProviders(items: ProviderMetric[]): Promise<void> {
return ofetch(metricsEndpoint, {
method: "POST",
body: {
items,
},
});
}
const segmentStatusMap: Record<
ScrapingSegment["status"],
ProviderMetric["status"] | null
> = {
success: "success",
notfound: "notfound",
failure: "failed",
pending: null,
waiting: null,
};
export function scrapeSourceOutputToProviderMetric(
media: PlayerMeta,
providerId: string,
embedId: string | null,
status: ProviderMetric["status"],
err: unknown | null
): ProviderMetric {
const episodeId = media.episode?.tmdbId;
const seasonId = media.season?.tmdbId;
let error: undefined | Error;
if (err instanceof Error) error = err;
return {
status,
providerId,
title: media.title,
tmdbId: media.tmdbId,
type: media.type,
embedId: embedId ?? undefined,
episodeId,
seasonId,
errorMessage: error?.message,
fullError: error ? getStackTrace(error, 5) : undefined,
};
}
export function scrapeSegmentToProviderMetric(
media: ScrapeMedia,
providerId: string,
segment: ScrapingSegment
): ProviderMetric | null {
const status = segmentStatusMap[segment.status];
if (!status) return null;
let episodeId: string | undefined;
let seasonId: string | undefined;
if (media.type === "show") {
episodeId = media.episode.tmdbId;
seasonId = media.season.tmdbId;
}
let error: undefined | Error;
if (segment.error instanceof Error) error = segment.error;
return {
status,
providerId,
title: media.title,
tmdbId: media.tmdbId,
type: media.type,
embedId: segment.embedId,
episodeId,
seasonId,
errorMessage: segment.reason ?? error?.message,
fullError: error ? getStackTrace(error, 5) : undefined,
};
}
export function scrapePartsToProviderMetric(
media: ScrapeMedia,
order: ScrapingItems[],
sources: Record<string, ScrapingSegment>
): ProviderMetric[] {
const output: ProviderMetric[] = [];
order.forEach((orderItem) => {
const source = sources[orderItem.id];
orderItem.children.forEach((embedId) => {
const embed = sources[embedId];
if (!embed.embedId) return;
const metric = scrapeSegmentToProviderMetric(media, source.id, embed);
if (!metric) return;
output.push(metric);
});
const metric = scrapeSegmentToProviderMetric(media, source.id, source);
if (!metric) return;
output.push(metric);
});
return output;
}
export function useReportProviders() {
const report = useCallback((items: ProviderMetric[]) => {
if (items.length === 0) return;
reportProviders(items);
}, []);
return { report };
}

View file

@ -1,52 +0,0 @@
import { MWEmbed, MWEmbedContext, MWEmbedScraper } from "./embed";
import {
MWProvider,
MWProviderContext,
MWProviderScrapeResult,
} from "./provider";
import { getEmbedScraperByType } from "./register";
import { MWStream } from "./streams";
function sortProviderResult(
ctx: MWProviderScrapeResult
): MWProviderScrapeResult {
ctx.embeds = ctx.embeds
.map<[MWEmbed, MWEmbedScraper | null]>((v) => [
v,
v.type ? getEmbedScraperByType(v.type) : null,
])
.sort(([, a], [, b]) => (b?.rank ?? 0) - (a?.rank ?? 0))
.map((v) => v[0]);
return ctx;
}
export async function runProvider(
provider: MWProvider,
ctx: MWProviderContext
): Promise<MWProviderScrapeResult> {
try {
const data = await provider.scrape(ctx);
return sortProviderResult(data);
} catch (err) {
console.error("Failed to run provider", err, {
id: provider.id,
ctx: { ...ctx },
});
throw err;
}
}
export async function runEmbedScraper(
scraper: MWEmbedScraper,
ctx: MWEmbedContext
): Promise<MWStream> {
try {
return await scraper.getStream(ctx);
} catch (err) {
console.error("Failed to run embed scraper", {
id: scraper.id,
ctx: { ...ctx },
});
throw err;
}
}

View file

@ -1,173 +0,0 @@
import { MWProviderContext, MWProviderScrapeResult } from "./provider";
import { getEmbedScraperByType, getProviders } from "./register";
import { runEmbedScraper, runProvider } from "./run";
import { MWStream } from "./streams";
import { DetailedMeta } from "../metadata/getmeta";
import { MWMediaType } from "../metadata/types/mw";
interface MWProgressData {
type: "embed" | "provider";
id: string;
eventId: string;
percentage: number;
errored: boolean;
}
interface MWNextData {
id: string;
eventId: string;
type: "embed" | "provider";
}
type MWProviderRunContextBase = {
media: DetailedMeta;
onProgress?: (data: MWProgressData) => void;
onNext?: (data: MWNextData) => void;
};
type MWProviderRunContextTypeSpecific =
| {
type: MWMediaType.MOVIE | MWMediaType.ANIME;
episode: undefined;
season: undefined;
}
| {
type: MWMediaType.SERIES;
episode: string;
season: string;
};
export type MWProviderRunContext = MWProviderRunContextBase &
MWProviderRunContextTypeSpecific;
async function findBestEmbedStream(
result: MWProviderScrapeResult,
providerId: string,
ctx: MWProviderRunContext
): Promise<MWStream | null> {
if (result.stream) {
return {
...result.stream,
providerId,
embedId: providerId,
};
}
let embedNum = 0;
for (const embed of result.embeds) {
embedNum += 1;
if (!embed.type) continue;
const scraper = getEmbedScraperByType(embed.type);
if (!scraper) throw new Error(`Type for embed not found: ${embed.type}`);
const eventId = [providerId, scraper.id, embedNum].join("|");
ctx.onNext?.({ id: scraper.id, type: "embed", eventId });
let stream: MWStream;
try {
stream = await runEmbedScraper(scraper, {
url: embed.url,
progress(num) {
ctx.onProgress?.({
errored: false,
eventId,
id: scraper.id,
percentage: num,
type: "embed",
});
},
});
} catch {
ctx.onProgress?.({
errored: true,
eventId,
id: scraper.id,
percentage: 100,
type: "embed",
});
continue;
}
ctx.onProgress?.({
errored: false,
eventId,
id: scraper.id,
percentage: 100,
type: "embed",
});
stream.providerId = providerId;
return stream;
}
return null;
}
export async function findBestStream(
ctx: MWProviderRunContext
): Promise<MWStream | null> {
const providers = getProviders();
for (const provider of providers) {
const eventId = provider.id;
ctx.onNext?.({ id: provider.id, type: "provider", eventId });
let result: MWProviderScrapeResult;
try {
let context: MWProviderContext;
if (ctx.type === MWMediaType.SERIES) {
context = {
media: ctx.media,
type: ctx.type,
episode: ctx.episode,
season: ctx.season,
progress(num) {
ctx.onProgress?.({
percentage: num,
eventId,
errored: false,
id: provider.id,
type: "provider",
});
},
};
} else {
context = {
media: ctx.media,
type: ctx.type,
progress(num) {
ctx.onProgress?.({
percentage: num,
eventId,
errored: false,
id: provider.id,
type: "provider",
});
},
};
}
result = await runProvider(provider, context);
} catch (err) {
ctx.onProgress?.({
percentage: 100,
errored: true,
eventId,
id: provider.id,
type: "provider",
});
continue;
}
ctx.onProgress?.({
errored: false,
id: provider.id,
eventId,
percentage: 100,
type: "provider",
});
const stream = await findBestEmbedStream(result, provider.id, ctx);
if (!stream) continue;
return stream;
}
return null;
}

View file

@ -1,46 +0,0 @@
export enum MWStreamType {
MP4 = "mp4",
HLS = "hls",
}
// subsrt-ts supported types
export enum MWCaptionType {
VTT = "vtt",
SRT = "srt",
LRC = "lrc",
SBV = "sbv",
SUB = "sub",
SSA = "ssa",
ASS = "ass",
JSON = "json",
UNKNOWN = "unknown",
}
export enum MWStreamQuality {
Q360P = "360p",
Q540P = "540p",
Q480P = "480p",
Q720P = "720p",
Q1080P = "1080p",
QUNKNOWN = "unknown",
}
export type MWCaption = {
needsProxy?: boolean;
url: string;
type: MWCaptionType;
langIso: string;
};
export type MWStream = {
streamUrl: string;
type: MWStreamType;
quality: MWStreamQuality;
providerId?: string;
embedId?: string;
captions: MWCaption[];
};
export type MWEmbedStream = MWStream & {
embedId: string;
};

View file

@ -0,0 +1,33 @@
import { list } from "subsrt-ts";
import { proxiedFetch } from "@/backend/helpers/fetch";
import { convertSubtitlesToSrt } from "@/components/player/utils/captions";
import { CaptionListItem } from "@/stores/player/slices/source";
import { SimpleCache } from "@/utils/cache";
export const subtitleTypeList = list().map((type) => `.${type}`);
const downloadCache = new SimpleCache<string, string>();
downloadCache.setCompare((a, b) => a === b);
const expirySeconds = 24 * 60 * 60;
/**
* Always returns SRT
*/
export async function downloadCaption(
caption: CaptionListItem
): Promise<string> {
const cached = downloadCache.get(caption.url);
if (cached) return cached;
let data: string | undefined;
if (caption.needsProxy) {
data = await proxiedFetch<string>(caption.url, { responseType: "text" });
} else {
data = await fetch(caption.url).then((v) => v.text());
}
if (!data) throw new Error("failed to get caption data");
const output = convertSubtitlesToSrt(data);
downloadCache.set(caption.url, output, expirySeconds);
return output;
}

View file

@ -1,24 +0,0 @@
import { initializeScraperStore } from "./helpers/register";
// providers
// import "./providers/gdriveplayer";
import "./providers/flixhq";
import "./providers/superstream";
import "./providers/netfilm";
import "./providers/m4ufree";
import "./providers/hdwatched";
import "./providers/2embed";
import "./providers/sflix";
import "./providers/gomovies";
import "./providers/kissasian";
import "./providers/streamflix";
import "./providers/remotestream";
// embeds
import "./embeds/streamm4u";
import "./embeds/playm4u";
import "./embeds/upcloud";
import "./embeds/streamsb";
import "./embeds/mp4upload";
initializeScraperStore();

View file

@ -2,22 +2,23 @@ import { FetchError } from "ofetch";
import { formatJWMeta, mediaTypeToJW } from "./justwatch";
import {
TMDBIdToUrlId,
TMDBMediaToMediaType,
formatTMDBMeta,
getEpisodes,
getExternalIds,
getMediaDetails,
getMediaPoster,
getMovieFromExternalId,
mediaTypeToTMDB,
} from "./tmdb";
import {
JWMediaResult,
JWDetailedMeta,
JWSeasonMetaResult,
JW_API_BASE,
} from "./types/justwatch";
import { MWMediaMeta, MWMediaType } from "./types/mw";
import {
TMDBContentTypes,
TMDBMediaResult,
TMDBMovieData,
TMDBSeasonMetaResult,
@ -25,23 +26,6 @@ import {
} from "./types/tmdb";
import { makeUrl, proxiedFetch } from "../helpers/fetch";
type JWExternalIdType =
| "eidr"
| "imdb_latest"
| "imdb"
| "tmdb_latest"
| "tmdb"
| "tms";
interface JWExternalId {
provider: JWExternalIdType;
external_id: string;
}
interface JWDetailedMeta extends JWMediaResult {
external_ids: JWExternalId[];
}
export interface DetailedMeta {
meta: MWMediaMeta;
imdbId?: string;
@ -90,8 +74,7 @@ export async function getMetaFromId(
if (!details) return null;
const externalIds = await getExternalIds(id, mediaTypeToTMDB(type));
const imdbId = externalIds.imdb_id ?? undefined;
const imdbId = details.external_ids.imdb_id ?? undefined;
let seasonData: TMDBSeasonMetaResult | undefined;
@ -180,29 +163,14 @@ export async function getLegacyMetaFromId(
};
}
export function TMDBMediaToId(media: MWMediaMeta): string {
return ["tmdb", mediaTypeToTMDB(media.type), media.id].join("-");
}
export function decodeTMDBId(
paramId: string
): { id: string; type: MWMediaType } | null {
const [prefix, type, id] = paramId.split("-", 3);
if (prefix !== "tmdb") return null;
let mediaType;
try {
mediaType = TMDBMediaToMediaType(type);
} catch {
return null;
}
return {
type: mediaType,
id,
};
}
export function isLegacyUrl(url: string): boolean {
if (url.startsWith("/media/JW")) return true;
if (url.startsWith("/media/JW") || url.startsWith("/media/tmdb-show"))
return true;
return false;
}
export function isLegacyMediaType(url: string): boolean {
if (url.startsWith("/media/tmdb-show")) return true;
return false;
}
@ -213,8 +181,21 @@ export async function convertLegacyUrl(
const urlParts = url.split("/").slice(2);
const [, type, id] = urlParts[0].split("-", 3);
const suffix = urlParts
.slice(1)
.map((v) => `/${v}`)
.join("");
const mediaType = TMDBMediaToMediaType(type);
if (isLegacyMediaType(url)) {
const details = await getMediaDetails(id, TMDBContentTypes.TV);
return `/media/${TMDBIdToUrlId(
MWMediaType.SERIES,
details.id.toString(),
details.name
)}${suffix}`;
}
const mediaType = TMDBMediaToMediaType(type as TMDBContentTypes);
const meta = await getLegacyMetaFromId(mediaType, id);
if (!meta) return undefined;
@ -224,10 +205,12 @@ export async function convertLegacyUrl(
// movies always have an imdb id on tmdb
if (imdbId && mediaType === MWMediaType.MOVIE) {
const movieId = await getMovieFromExternalId(imdbId);
if (movieId) return `/media/tmdb-movie-${movieId}`;
}
if (movieId) {
return `/media/${TMDBIdToUrlId(mediaType, movieId, meta.meta.title)}`;
}
if (tmdbId) {
return `/media/tmdb-${type}-${tmdbId}`;
if (tmdbId) {
return `/media/${TMDBIdToUrlId(mediaType, tmdbId, meta.meta.title)}`;
}
}
}

View file

@ -1,27 +1,27 @@
import { SimpleCache } from "@/utils/cache";
import { MediaItem } from "@/utils/mediaTypes";
import {
formatTMDBMeta,
formatTMDBMetaToMediaItem,
formatTMDBSearchResult,
mediaTypeToTMDB,
searchMedia,
multiSearch,
} from "./tmdb";
import { MWMediaMeta, MWQuery } from "./types/mw";
import { MWQuery } from "./types/mw";
const cache = new SimpleCache<MWQuery, MWMediaMeta[]>();
const cache = new SimpleCache<MWQuery, MediaItem[]>();
cache.setCompare((a, b) => {
return a.type === b.type && a.searchQuery.trim() === b.searchQuery.trim();
return a.searchQuery.trim() === b.searchQuery.trim();
});
cache.initialize();
export async function searchForMedia(query: MWQuery): Promise<MWMediaMeta[]> {
if (cache.has(query)) return cache.get(query) as MWMediaMeta[];
const { searchQuery, type } = query;
export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> {
if (cache.has(query)) return cache.get(query) as MediaItem[];
const { searchQuery } = query;
const data = await searchMedia(searchQuery, mediaTypeToTMDB(type));
const results = data.results.map((v) => {
const formattedResult = formatTMDBSearchResult(v, mediaTypeToTMDB(type));
return formatTMDBMeta(formattedResult);
const data = await multiSearch(searchQuery);
const results = data.map((v) => {
const formattedResult = formatTMDBSearchResult(v, v.media_type);
return formatTMDBMetaToMediaItem(formattedResult);
});
cache.set(query, results, 3600); // cache results for 1 hour

View file

@ -1,37 +1,50 @@
import slugify from "slugify";
import { conf } from "@/setup/config";
import { MediaItem } from "@/utils/mediaTypes";
import { MWMediaMeta, MWMediaType, MWSeasonMeta } from "./types/mw";
import {
ExternalIdMovieSearchResult,
TMDBContentTypes,
TMDBEpisodeShort,
TMDBExternalIds,
TMDBMediaResult,
TMDBMovieData,
TMDBMovieExternalIds,
TMDBMovieResponse,
TMDBMovieResult,
TMDBMovieSearchResult,
TMDBSearchResult,
TMDBSeason,
TMDBSeasonMetaResult,
TMDBShowData,
TMDBShowExternalIds,
TMDBShowResponse,
TMDBShowResult,
TMDBShowSearchResult,
} from "./types/tmdb";
import { mwFetch } from "../helpers/fetch";
export function mediaTypeToTMDB(type: MWMediaType): TMDBContentTypes {
if (type === MWMediaType.MOVIE) return "movie";
if (type === MWMediaType.SERIES) return "show";
if (type === MWMediaType.MOVIE) return TMDBContentTypes.MOVIE;
if (type === MWMediaType.SERIES) return TMDBContentTypes.TV;
throw new Error("unsupported type");
}
export function TMDBMediaToMediaType(type: string): MWMediaType {
export function mediaItemTypeToMediaType(type: MediaItem["type"]): MWMediaType {
if (type === "movie") return MWMediaType.MOVIE;
if (type === "show") return MWMediaType.SERIES;
throw new Error("unsupported type");
}
export function TMDBMediaToMediaType(type: TMDBContentTypes): MWMediaType {
if (type === TMDBContentTypes.MOVIE) return MWMediaType.MOVIE;
if (type === TMDBContentTypes.TV) return MWMediaType.SERIES;
throw new Error("unsupported type");
}
export function TMDBMediaToMediaItemType(
type: TMDBContentTypes
): MediaItem["type"] {
if (type === TMDBContentTypes.MOVIE) return "movie";
if (type === TMDBContentTypes.TV) return "show";
throw new Error("unsupported type");
}
export function formatTMDBMeta(
media: TMDBMediaResult,
season?: TMDBSeasonMetaResult
@ -74,8 +87,41 @@ export function formatTMDBMeta(
};
}
export function formatTMDBMetaToMediaItem(media: TMDBMediaResult): MediaItem {
const type = TMDBMediaToMediaItemType(media.object_type);
return {
title: media.title,
id: media.id.toString(),
year: media.original_release_year ?? 0,
poster: media.poster,
type,
};
}
export function TMDBIdToUrlId(
type: MWMediaType,
tmdbId: string,
title: string
) {
return [
"tmdb",
mediaTypeToTMDB(type),
tmdbId,
slugify(title, { lower: true, strict: true }),
].join("-");
}
export function TMDBMediaToId(media: MWMediaMeta): string {
return ["tmdb", mediaTypeToTMDB(media.type), media.id].join("-");
return TMDBIdToUrlId(media.type, media.id, media.title);
}
export function mediaItemToId(media: MediaItem): string {
return TMDBIdToUrlId(
mediaItemTypeToMediaType(media.type),
media.id,
media.title
);
}
export function decodeTMDBId(
@ -85,7 +131,7 @@ export function decodeTMDBId(
if (prefix !== "tmdb") return null;
let mediaType;
try {
mediaType = TMDBMediaToMediaType(type);
mediaType = TMDBMediaToMediaType(type as TMDBContentTypes);
} catch {
return null;
}
@ -113,52 +159,57 @@ async function get<T>(url: string, params?: object): Promise<T> {
return res;
}
export async function searchMedia(
query: string,
type: TMDBContentTypes
): Promise<TMDBMovieResponse | TMDBShowResponse> {
let data;
export async function multiSearch(
query: string
): Promise<(TMDBMovieSearchResult | TMDBShowSearchResult)[]> {
const data = await get<TMDBSearchResult>("search/multi", {
query,
include_adult: false,
language: "en-US",
page: 1,
});
// filter out results that aren't movies or shows
const results = data.results.filter(
(r) =>
r.media_type === TMDBContentTypes.MOVIE ||
r.media_type === TMDBContentTypes.TV
);
return results;
}
switch (type) {
case "movie":
data = await get<TMDBMovieResponse>("search/movie", {
query,
include_adult: false,
language: "en-US",
page: 1,
});
break;
case "show":
data = await get<TMDBShowResponse>("search/tv", {
query,
include_adult: false,
language: "en-US",
page: 1,
});
break;
default:
throw new Error("Invalid media type");
}
export async function generateQuickSearchMediaUrl(
query: string
): Promise<string | undefined> {
const data = await multiSearch(query);
if (data.length === 0) return undefined;
const result = data[0];
const title =
result.media_type === TMDBContentTypes.MOVIE ? result.title : result.name;
return data;
return `/media/${TMDBIdToUrlId(
TMDBMediaToMediaType(result.media_type),
result.id.toString(),
title
)}`;
}
// Conditional type which for inferring the return type based on the content type
type MediaDetailReturn<T extends TMDBContentTypes> = T extends "movie"
? TMDBMovieData
: T extends "show"
? TMDBShowData
: never;
type MediaDetailReturn<T extends TMDBContentTypes> =
T extends TMDBContentTypes.MOVIE
? TMDBMovieData
: T extends TMDBContentTypes.TV
? TMDBShowData
: never;
export function getMediaDetails<
T extends TMDBContentTypes,
TReturn = MediaDetailReturn<T>
>(id: string, type: T): Promise<TReturn> {
if (type === "movie") {
return get<TReturn>(`/movie/${id}`);
if (type === TMDBContentTypes.MOVIE) {
return get<TReturn>(`/movie/${id}`, { append_to_response: "external_ids" });
}
if (type === "show") {
return get<TReturn>(`/tv/${id}`);
if (type === TMDBContentTypes.TV) {
return get<TReturn>(`/tv/${id}`, { append_to_response: "external_ids" });
}
throw new Error("Invalid media type");
}
@ -179,26 +230,6 @@ export async function getEpisodes(
}));
}
export async function getExternalIds(
id: string,
type: TMDBContentTypes
): Promise<TMDBExternalIds> {
let data;
switch (type) {
case "movie":
data = await get<TMDBMovieExternalIds>(`/movie/${id}/external_ids`);
break;
case "show":
data = await get<TMDBShowExternalIds>(`/tv/${id}/external_ids`);
break;
default:
throw new Error("Invalid media type");
}
return data;
}
export async function getMovieFromExternalId(
imdbId: string
): Promise<string | undefined> {
@ -213,12 +244,12 @@ export async function getMovieFromExternalId(
}
export function formatTMDBSearchResult(
result: TMDBShowResult | TMDBMovieResult,
result: TMDBMovieSearchResult | TMDBShowSearchResult,
mediatype: TMDBContentTypes
): TMDBMediaResult {
const type = TMDBMediaToMediaType(mediatype);
if (type === MWMediaType.SERIES) {
const show = result as TMDBShowResult;
const show = result as TMDBShowSearchResult;
return {
title: show.name,
poster: getMediaPoster(show.poster_path),
@ -227,7 +258,8 @@ export function formatTMDBSearchResult(
object_type: mediatype,
};
}
const movie = result as TMDBMovieResult;
const movie = result as TMDBMovieSearchResult;
return {
title: movie.title,

View file

@ -46,3 +46,20 @@ export type JWSeasonMetaResult = {
season_number: number;
episodes: JWEpisodeShort[];
};
export type JWExternalIdType =
| "eidr"
| "imdb_latest"
| "imdb"
| "tmdb_latest"
| "tmdb"
| "tms";
export interface JWExternalId {
provider: JWExternalIdType;
external_id: string;
}
export interface JWDetailedMeta extends JWMediaResult {
external_ids: JWExternalId[];
}

View file

@ -43,7 +43,6 @@ export type MWMediaMeta = MWMediaMetaBase & MWMediaMetaSpecific;
export interface MWQuery {
searchQuery: string;
type: MWMediaType;
}
export interface DetailedMeta {

View file

@ -1,4 +1,7 @@
export type TMDBContentTypes = "movie" | "show";
export enum TMDBContentTypes {
MOVIE = "movie",
TV = "tv",
}
export type TMDBSeasonShort = {
title: string;
@ -121,6 +124,9 @@ export interface TMDBShowData {
type: string;
vote_average: number;
vote_count: number;
external_ids: {
imdb_id: string | null;
};
}
export interface TMDBMovieData {
@ -169,6 +175,9 @@ export interface TMDBMovieData {
video: boolean;
vote_average: number;
vote_count: number;
external_ids: {
imdb_id: string | null;
};
}
export interface TMDBEpisodeResult {
@ -183,54 +192,6 @@ export interface TMDBEpisodeResult {
};
}
export interface TMDBShowResult {
adult: boolean;
backdrop_path: string | null;
genre_ids: number[];
id: number;
origin_country: string[];
original_language: string;
original_name: string;
overview: string;
popularity: number;
poster_path: string | null;
first_air_date: string;
name: string;
vote_average: number;
vote_count: number;
}
export interface TMDBShowResponse {
page: number;
results: TMDBShowResult[];
total_pages: number;
total_results: number;
}
export interface TMDBMovieResult {
adult: boolean;
backdrop_path: string | null;
genre_ids: number[];
id: number;
original_language: string;
original_title: string;
overview: string;
popularity: number;
poster_path: string | null;
release_date: string;
title: string;
video: boolean;
vote_average: number;
vote_count: number;
}
export interface TMDBMovieResponse {
page: number;
results: TMDBMovieResult[];
total_pages: number;
total_results: number;
}
export interface TMDBEpisode {
air_date: string;
episode_number: number;
@ -259,30 +220,6 @@ export interface TMDBSeason {
season_number: number;
}
export interface TMDBShowExternalIds {
id: number;
imdb_id: null | string;
freebase_mid: null | string;
freebase_id: null | string;
tvdb_id: number;
tvrage_id: null | string;
wikidata_id: null | string;
facebook_id: null | string;
instagram_id: null | string;
twitter_id: null | string;
}
export interface TMDBMovieExternalIds {
id: number;
imdb_id: null | string;
wikidata_id: null | string;
facebook_id: null | string;
instagram_id: null | string;
twitter_id: null | string;
}
export type TMDBExternalIds = TMDBShowExternalIds | TMDBMovieExternalIds;
export interface ExternalIdMovieSearchResult {
movie_results: {
adult: boolean;
@ -306,3 +243,46 @@ export interface ExternalIdMovieSearchResult {
tv_episode_results: any[];
tv_season_results: any[];
}
export interface TMDBMovieSearchResult {
adult: boolean;
backdrop_path: string;
id: number;
title: string;
original_language: string;
original_title: string;
overview: string;
poster_path: string;
media_type: TMDBContentTypes.MOVIE;
genre_ids: number[];
popularity: number;
release_date: string;
video: boolean;
vote_average: number;
vote_count: number;
}
export interface TMDBShowSearchResult {
adult: boolean;
backdrop_path: string;
id: number;
name: string;
original_language: string;
original_name: string;
overview: string;
poster_path: string;
media_type: TMDBContentTypes.TV;
genre_ids: number[];
popularity: number;
first_air_date: string;
vote_average: number;
vote_count: number;
origin_country: string[];
}
export interface TMDBSearchResult {
page: number;
results: (TMDBMovieSearchResult | TMDBShowSearchResult)[];
total_pages: number;
total_results: number;
}

View file

@ -1,252 +0,0 @@
import Base64 from "crypto-js/enc-base64";
import Utf8 from "crypto-js/enc-utf8";
import { proxiedFetch, rawProxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import {
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "../helpers/streams";
import { MWMediaType } from "../metadata/types/mw";
const twoEmbedBase = "https://www.2embed.to";
async function fetchCaptchaToken(recaptchaKey: string) {
const domainHash = Base64.stringify(Utf8.parse(twoEmbedBase)).replace(
/=/g,
"."
);
const recaptchaRender = await proxiedFetch<any>(
`https://www.google.com/recaptcha/api.js?render=${recaptchaKey}`
);
const vToken = recaptchaRender.substring(
recaptchaRender.indexOf("/releases/") + 10,
recaptchaRender.indexOf("/recaptcha__en.js")
);
const recaptchaAnchor = await proxiedFetch<any>(
`https://www.google.com/recaptcha/api2/anchor?ar=1&hl=en&size=invisible&cb=flicklax&k=${recaptchaKey}&co=${domainHash}&v=${vToken}`
);
const cToken = new DOMParser()
.parseFromString(recaptchaAnchor, "text/html")
.getElementById("recaptcha-token")
?.getAttribute("value");
if (!cToken) throw new Error("Unable to find cToken");
const payload = {
v: vToken,
reason: "q",
k: recaptchaKey,
c: cToken,
sa: "",
co: twoEmbedBase,
};
const tokenData = await proxiedFetch<string>(
`https://www.google.com/recaptcha/api2/reload?${new URLSearchParams(
payload
).toString()}`,
{
headers: { referer: "https://www.google.com/recaptcha/api2/" },
method: "POST",
}
);
const token = tokenData.match('rresp","(.+?)"');
return token ? token[1] : null;
}
interface IEmbedRes {
link: string;
sources: [];
tracks: [];
type: string;
}
interface IStreamData {
status: string;
message: string;
type: string;
token: string;
result:
| {
Original: {
label: string;
file: string;
url: string;
};
}
| {
label: string;
size: number;
url: string;
}[];
}
interface ISubtitles {
url: string;
lang: string;
}
async function fetchStream(sourceId: string, captchaToken: string) {
const embedRes = await proxiedFetch<IEmbedRes>(
`${twoEmbedBase}/ajax/embed/play?id=${sourceId}&_token=${captchaToken}`,
{
headers: {
Referer: twoEmbedBase,
},
}
);
// Link format: https://rabbitstream.net/embed-4/{data-id}?z=
const rabbitStreamUrl = new URL(embedRes.link);
const dataPath = rabbitStreamUrl.pathname.split("/");
const dataId = dataPath[dataPath.length - 1];
// https://rabbitstream.net/embed/m-download/{data-id}
const download = await proxiedFetch<any>(
`${rabbitStreamUrl.origin}/embed/m-download/${dataId}`,
{
headers: {
referer: twoEmbedBase,
},
}
);
const downloadPage = new DOMParser().parseFromString(download, "text/html");
const streamlareEl = Array.from(
downloadPage.querySelectorAll(".dls-brand")
).find((el) => el.textContent?.trim() === "Streamlare");
if (!streamlareEl) throw new Error("Unable to find streamlare element");
const streamlareUrl =
streamlareEl.nextElementSibling?.querySelector("a")?.href;
if (!streamlareUrl) throw new Error("Unable to parse streamlare url");
const subtitles: ISubtitles[] = [];
const subtitlesDropdown = downloadPage.querySelectorAll(
"#user_menu .dropdown-item"
);
subtitlesDropdown.forEach((item) => {
const url = item.getAttribute("href");
const lang = item.textContent?.trim().replace("Download", "").trim();
if (url && lang) subtitles.push({ url, lang });
});
const streamlare = await proxiedFetch<any>(streamlareUrl);
const streamlarePage = new DOMParser().parseFromString(
streamlare,
"text/html"
);
const csrfToken = streamlarePage
.querySelector("head > meta:nth-child(3)")
?.getAttribute("content");
if (!csrfToken) throw new Error("Unable to find CSRF token");
const videoId = streamlareUrl.match("/[ve]/([^?#&/]+)")?.[1];
if (!videoId) throw new Error("Unable to get streamlare video id");
const streamRes = await proxiedFetch<IStreamData>(
`${new URL(streamlareUrl).origin}/api/video/download/get`,
{
method: "POST",
body: JSON.stringify({
id: videoId,
}),
headers: {
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-Token": csrfToken,
},
}
);
if (streamRes.message !== "OK") throw new Error("Unable to fetch stream");
const streamData = Array.isArray(streamRes.result)
? streamRes.result[0]
: streamRes.result.Original;
if (!streamData) throw new Error("Unable to get stream data");
const followStream = await rawProxiedFetch(streamData.url, {
method: "HEAD",
referrer: new URL(streamlareUrl).origin,
});
const finalStreamUrl = followStream.headers.get("X-Final-Destination");
return { url: finalStreamUrl, subtitles };
}
registerProvider({
id: "2embed",
displayName: "2Embed",
rank: 125,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
disabled: true, // Disabled, not working
async scrape({ media, episode, progress }) {
let embedUrl = `${twoEmbedBase}/embed/tmdb/movie?id=${media.tmdbId}`;
if (media.meta.type === MWMediaType.SERIES) {
const seasonNumber = media.meta.seasonData.number;
const episodeNumber = media.meta.seasonData.episodes.find(
(e) => e.id === episode
)?.number;
embedUrl = `${twoEmbedBase}/embed/tmdb/tv?id=${media.tmdbId}&s=${seasonNumber}&e=${episodeNumber}`;
}
const embed = await proxiedFetch<any>(embedUrl);
progress(20);
const embedPage = new DOMParser().parseFromString(embed, "text/html");
const pageServerItems = Array.from(
embedPage.querySelectorAll(".item-server")
);
const pageStreamItem = pageServerItems.find((item) =>
item.textContent?.includes("Vidcloud")
);
const sourceId = pageStreamItem
? pageStreamItem.getAttribute("data-id")
: null;
if (!sourceId) throw new Error("Unable to get source id");
const siteKey = embedPage
.querySelector("body")
?.getAttribute("data-recaptcha-key");
if (!siteKey) throw new Error("Unable to get site key");
const captchaToken = await fetchCaptchaToken(siteKey);
if (!captchaToken) throw new Error("Unable to fetch captcha token");
progress(35);
const stream = await fetchStream(sourceId, captchaToken);
if (!stream.url) throw new Error("Unable to find stream url");
return {
embeds: [],
stream: {
streamUrl: stream.url,
quality: MWStreamQuality.QUNKNOWN,
type: MWStreamType.MP4,
captions: stream.subtitles.map((sub) => {
return {
langIso: sub.lang,
url: `https://cc.2cdns.com${new URL(sub.url).pathname}`,
type: MWCaptionType.VTT,
};
}),
},
};
},
});

View file

@ -1 +0,0 @@
export const flixHqBase = "https://flixhq.to";

View file

@ -1,36 +0,0 @@
import { MWEmbedType } from "@/backend/helpers/embed";
import { registerProvider } from "@/backend/helpers/register";
import { MWMediaType } from "@/backend/metadata/types/mw";
import {
getFlixhqSourceDetails,
getFlixhqSources,
} from "@/backend/providers/flixhq/scrape";
import { getFlixhqId } from "@/backend/providers/flixhq/search";
registerProvider({
id: "flixhq",
displayName: "FlixHQ",
rank: 100,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media }) {
const id = await getFlixhqId(media.meta);
if (!id) throw new Error("flixhq no matching item found");
// TODO tv shows not supported. just need to scrape the specific episode sources
const sources = await getFlixhqSources(id);
const upcloudStream = sources.find(
(v) => v.embed.toLowerCase() === "upcloud"
);
if (!upcloudStream) throw new Error("upcloud stream not found for flixhq");
return {
embeds: [
{
type: MWEmbedType.UPCLOUD,
url: await getFlixhqSourceDetails(upcloudStream.episodeId),
},
],
};
},
});

View file

@ -1,41 +0,0 @@
import { proxiedFetch } from "@/backend/helpers/fetch";
import { flixHqBase } from "@/backend/providers/flixhq/common";
export async function getFlixhqSources(id: string) {
const type = id.split("/")[0];
const episodeParts = id.split("-");
const episodeId = episodeParts[episodeParts.length - 1];
const data = await proxiedFetch<string>(
`/ajax/${type}/episodes/${episodeId}`,
{
baseURL: flixHqBase,
}
);
const doc = new DOMParser().parseFromString(data, "text/html");
const sourceLinks = [...doc.querySelectorAll(".nav-item > a")].map((el) => {
const embedTitle = el.getAttribute("title");
const linkId = el.getAttribute("data-linkid");
if (!embedTitle || !linkId) throw new Error("invalid sources");
return {
embed: embedTitle,
episodeId: linkId,
};
});
return sourceLinks;
}
export async function getFlixhqSourceDetails(
sourceId: string
): Promise<string> {
const jsonData = await proxiedFetch<Record<string, any>>(
`/ajax/sources/${sourceId}`,
{
baseURL: flixHqBase,
}
);
return jsonData.link;
}

View file

@ -1,43 +0,0 @@
import { proxiedFetch } from "@/backend/helpers/fetch";
import { MWMediaMeta } from "@/backend/metadata/types/mw";
import { flixHqBase } from "@/backend/providers/flixhq/common";
import { compareTitle } from "@/utils/titleMatch";
export async function getFlixhqId(meta: MWMediaMeta): Promise<string | null> {
const searchResults = await proxiedFetch<string>(
`/search/${meta.title.replaceAll(/[^a-z0-9A-Z]/g, "-")}`,
{
baseURL: flixHqBase,
}
);
const doc = new DOMParser().parseFromString(searchResults, "text/html");
const items = [...doc.querySelectorAll(".film_list-wrap > div.flw-item")].map(
(el) => {
const id = el
.querySelector("div.film-poster > a")
?.getAttribute("href")
?.slice(1);
const title = el
.querySelector("div.film-detail > h2 > a")
?.getAttribute("title");
const year = el.querySelector(
"div.film-detail > div.fd-infor > span:nth-child(1)"
)?.textContent;
if (!id || !title || !year) return null;
return {
id,
title,
year,
};
}
);
const matchingItem = items.find(
(v) => v && compareTitle(meta.title, v.title) && meta.year === v.year
);
if (!matchingItem) return null;
return matchingItem.id;
}

View file

@ -1,107 +0,0 @@
import CryptoJS from "crypto-js";
import { unpack } from "unpacker";
import { registerProvider } from "@/backend/helpers/register";
import { MWStreamQuality } from "@/backend/helpers/streams";
import { MWMediaType } from "@/backend/metadata/types/mw";
import { proxiedFetch } from "../helpers/fetch";
const format = {
stringify: (cipher: any) => {
const ct = cipher.ciphertext.toString(CryptoJS.enc.Base64);
const iv = cipher.iv.toString() || "";
const salt = cipher.salt.toString() || "";
return JSON.stringify({
ct,
iv,
salt,
});
},
parse: (jsonStr: string) => {
const json = JSON.parse(jsonStr);
const ciphertext = CryptoJS.enc.Base64.parse(json.ct);
const iv = CryptoJS.enc.Hex.parse(json.iv) || "";
const salt = CryptoJS.enc.Hex.parse(json.s) || "";
const cipher = CryptoJS.lib.CipherParams.create({
ciphertext,
iv,
salt,
});
return cipher;
},
};
registerProvider({
id: "gdriveplayer",
displayName: "gdriveplayer",
disabled: true,
rank: 69,
type: [MWMediaType.MOVIE],
async scrape({ progress, media: { imdbId } }) {
if (!imdbId) throw new Error("not enough info");
progress(10);
const streamRes = await proxiedFetch<string>(
"https://database.gdriveplayer.us/player.php",
{
params: {
imdb: imdbId,
},
}
);
progress(90);
const page = new DOMParser().parseFromString(streamRes, "text/html");
const script: HTMLElement | undefined = Array.from(
page.querySelectorAll("script")
).find((e) => e.textContent?.includes("eval"));
if (!script || !script.textContent) {
throw new Error("Could not find stream");
}
/// NOTE: this code requires re-write, it's not safe
const data = unpack(script.textContent)
.split("var data=\\'")[1]
.split("\\'")[0]
.replace(/\\/g, "");
const decryptedData = unpack(
CryptoJS.AES.decrypt(
data,
"alsfheafsjklNIWORNiolNIOWNKLNXakjsfwnBdwjbwfkjbJjkopfjweopjASoiwnrflakefneiofrt",
{ format }
).toString(CryptoJS.enc.Utf8)
);
// eslint-disable-next-line
const sources = JSON.parse(
JSON.stringify(
eval(
decryptedData
.split("sources:")[1]
.split(",image")[0]
.replace(/\\/g, "")
.replace(/document\.referrer/g, '""')
)
)
);
const source = sources[sources.length - 1];
/// END
let quality;
if (source.label === "720p") quality = MWStreamQuality.Q720P;
else quality = MWStreamQuality.QUNKNOWN;
return {
stream: {
streamUrl: `https:${source.file}`,
type: source.type,
quality,
captions: [],
},
embeds: [],
};
},
});

View file

@ -1,162 +0,0 @@
import { MWEmbedType } from "../helpers/embed";
import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import { MWMediaType } from "../metadata/types/mw";
const gomoviesBase = "https://gomovies.sx";
registerProvider({
id: "gomovies",
displayName: "GOmovies",
rank: 200,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode }) {
const search = await proxiedFetch<any>("/ajax/search", {
baseURL: gomoviesBase,
method: "POST",
body: JSON.stringify({
keyword: media.meta.title,
}),
headers: {
"X-Requested-With": "XMLHttpRequest",
},
});
const searchPage = new DOMParser().parseFromString(search, "text/html");
const mediaElements = searchPage.querySelectorAll("a.nav-item");
const mediaData = Array.from(mediaElements).map((movieEl) => {
const name = movieEl?.querySelector("h3.film-name")?.textContent;
const year = movieEl?.querySelector(
"div.film-infor span:first-of-type"
)?.textContent;
const path = movieEl.getAttribute("href");
return { name, year, path };
});
const targetMedia = mediaData.find(
(m) =>
m.name === media.meta.title &&
(media.meta.type === MWMediaType.MOVIE
? m.year === media.meta.year
: true)
);
if (!targetMedia?.path) throw new Error("Media not found");
// Example movie path: /movie/watch-{slug}-{id}
// Example series path: /tv/watch-{slug}-{id}
let mediaId = targetMedia.path.split("-").pop()?.replace("/", "");
let sources = null;
if (media.meta.type === MWMediaType.SERIES) {
const seasons = await proxiedFetch<any>(
`/ajax/v2/tv/seasons/${mediaId}`,
{
baseURL: gomoviesBase,
headers: {
"X-Requested-With": "XMLHttpRequest",
},
}
);
const seasonsEl = new DOMParser()
.parseFromString(seasons, "text/html")
.querySelectorAll(".ss-item");
const seasonsData = [...seasonsEl].map((season) => ({
number: season.innerHTML.replace("Season ", ""),
dataId: season.getAttribute("data-id"),
}));
const seasonNumber = media.meta.seasonData.number;
const targetSeason = seasonsData.find(
(season) => +season.number === seasonNumber
);
if (!targetSeason) throw new Error("Season not found");
const episodes = await proxiedFetch<any>(
`/ajax/v2/season/episodes/${targetSeason.dataId}`,
{
baseURL: gomoviesBase,
headers: {
"X-Requested-With": "XMLHttpRequest",
},
}
);
const episodesEl = new DOMParser()
.parseFromString(episodes, "text/html")
.querySelectorAll(".eps-item");
const episodesData = Array.from(episodesEl).map((ep) => ({
dataId: ep.getAttribute("data-id"),
number: ep
.querySelector("strong")
?.textContent?.replace("Eps", "")
.replace(":", "")
.trim(),
}));
const episodeNumber = media.meta.seasonData.episodes.find(
(e) => e.id === episode
)?.number;
const targetEpisode = episodesData.find((ep) =>
ep.number ? +ep.number === episodeNumber : false
);
if (!targetEpisode?.dataId) throw new Error("Episode not found");
mediaId = targetEpisode.dataId;
sources = await proxiedFetch<any>(`/ajax/v2/episode/servers/${mediaId}`, {
baseURL: gomoviesBase,
headers: {
"X-Requested-With": "XMLHttpRequest",
},
});
} else {
sources = await proxiedFetch<any>(`/ajax/movie/episodes/${mediaId}`, {
baseURL: gomoviesBase,
headers: {
"X-Requested-With": "XMLHttpRequest",
},
});
}
const upcloud = new DOMParser()
.parseFromString(sources, "text/html")
.querySelector('a[title*="upcloud" i]');
const upcloudDataId =
upcloud?.getAttribute("data-id") ?? upcloud?.getAttribute("data-linkid");
if (!upcloudDataId) throw new Error("Upcloud source not available");
const upcloudSource = await proxiedFetch<{
type: "iframe" | string;
link: string;
sources: [];
title: string;
tracks: [];
}>(`/ajax/sources/${upcloudDataId}`, {
baseURL: gomoviesBase,
headers: {
"X-Requested-With": "XMLHttpRequest",
},
});
if (!upcloudSource.link || upcloudSource.type !== "iframe")
throw new Error("No upcloud stream found");
return {
embeds: [
{
type: MWEmbedType.UPCLOUD,
url: upcloudSource.link,
},
],
};
},
});

View file

@ -1,198 +0,0 @@
import { proxiedFetch } from "../helpers/fetch";
import { MWProviderContext } from "../helpers/provider";
import { registerProvider } from "../helpers/register";
import { MWStreamQuality, MWStreamType } from "../helpers/streams";
import { MWMediaType } from "../metadata/types/mw";
const hdwatchedBase = "https://www.hdwatched.xyz";
const qualityMap: Record<number, MWStreamQuality> = {
360: MWStreamQuality.Q360P,
540: MWStreamQuality.Q540P,
480: MWStreamQuality.Q480P,
720: MWStreamQuality.Q720P,
1080: MWStreamQuality.Q1080P,
};
interface SearchRes {
title: string;
year?: number;
href: string;
id: string;
}
function getStreamFromEmbed(stream: string) {
const embedPage = new DOMParser().parseFromString(stream, "text/html");
const source = embedPage.querySelector("#vjsplayer > source");
if (!source) {
throw new Error("Unable to fetch stream");
}
const streamSrc = source.getAttribute("src");
const streamRes = source.getAttribute("res");
if (!streamSrc || !streamRes) throw new Error("Unable to find stream");
return {
streamUrl: streamSrc,
quality:
streamRes && typeof +streamRes === "number"
? qualityMap[+streamRes]
: MWStreamQuality.QUNKNOWN,
};
}
async function fetchMovie(targetSource: SearchRes) {
const stream = await proxiedFetch<any>(`/embed/${targetSource.id}`, {
baseURL: hdwatchedBase,
});
const embedPage = new DOMParser().parseFromString(stream, "text/html");
const source = embedPage.querySelector("#vjsplayer > source");
if (!source) {
throw new Error("Unable to fetch movie stream");
}
return getStreamFromEmbed(stream);
}
async function fetchSeries(
targetSource: SearchRes,
{ media, episode, progress }: MWProviderContext
) {
if (media.meta.type !== MWMediaType.SERIES)
throw new Error("Media type mismatch");
const seasonNumber = media.meta.seasonData.number;
const episodeNumber = media.meta.seasonData.episodes.find(
(e) => e.id === episode
)?.number;
if (!seasonNumber || !episodeNumber)
throw new Error("Unable to get season or episode number");
const seriesPage = await proxiedFetch<any>(
`${targetSource.href}?season=${media.meta.seasonData.number}`,
{
baseURL: hdwatchedBase,
}
);
const seasonPage = new DOMParser().parseFromString(seriesPage, "text/html");
const pageElements = seasonPage.querySelectorAll("div.i-container");
const seriesList: SearchRes[] = [];
pageElements.forEach((pageElement) => {
const href = pageElement.querySelector("a")?.getAttribute("href") || "";
const title =
pageElement?.querySelector("span.content-title")?.textContent || "";
seriesList.push({
title,
href,
id: href.split("/")[2], // Format: /free/{id}/{series-slug}-season-{season-number}-episode-{episode-number}
});
});
const targetEpisode = seriesList.find(
(episodeEl) =>
episodeEl.title.trim().toLowerCase() === `episode ${episodeNumber}`
);
if (!targetEpisode) throw new Error("Unable to find episode");
progress(70);
const stream = await proxiedFetch<any>(`/embed/${targetEpisode.id}`, {
baseURL: hdwatchedBase,
});
const embedPage = new DOMParser().parseFromString(stream, "text/html");
const source = embedPage.querySelector("#vjsplayer > source");
if (!source) {
throw new Error("Unable to fetch movie stream");
}
return getStreamFromEmbed(stream);
}
registerProvider({
id: "hdwatched",
displayName: "HDwatched",
rank: 150,
disabled: true, // very slow, haven't seen it work for a while
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape(options) {
const { media, progress } = options;
if (!media.imdbId) throw new Error("not enough info");
if (!this.type.includes(media.meta.type)) {
throw new Error("Unsupported type");
}
const search = await proxiedFetch<any>(`/search/${media.imdbId}`, {
baseURL: hdwatchedBase,
});
const searchPage = new DOMParser().parseFromString(search, "text/html");
const pageElements = searchPage.querySelectorAll("div.i-container");
const searchList: SearchRes[] = [];
pageElements.forEach((pageElement) => {
const href = pageElement.querySelector("a")?.getAttribute("href") || "";
const title =
pageElement?.querySelector("span.content-title")?.textContent || "";
const year =
parseInt(
pageElement
?.querySelector("div.duration")
?.textContent?.trim()
?.split(" ")
?.pop() || "",
10
) || 0;
searchList.push({
title,
year,
href,
id: href.split("/")[2], // Format: /free/{id}/{movie-slug} or /series/{id}/{series-slug}
});
});
progress(20);
const targetSource = searchList.find(
(source) => source.year === (media.meta.year ? +media.meta.year : 0) // Compare year to make the search more robust
);
if (!targetSource) {
throw new Error("Could not find stream");
}
progress(40);
if (media.meta.type === MWMediaType.SERIES) {
const series = await fetchSeries(targetSource, options);
return {
embeds: [],
stream: {
streamUrl: series.streamUrl,
quality: series.quality,
type: MWStreamType.MP4,
captions: [],
},
};
}
const movie = await fetchMovie(targetSource);
return {
embeds: [],
stream: {
streamUrl: movie.streamUrl,
quality: movie.quality,
type: MWStreamType.MP4,
captions: [],
},
};
},
});

View file

@ -1,119 +0,0 @@
import { MWEmbedType } from "../helpers/embed";
import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import { MWMediaType } from "../metadata/types/mw";
const kissasianBase = "https://kissasian.li";
const embedProviders = [
{
type: MWEmbedType.MP4UPLOAD,
id: "mp",
},
{
type: MWEmbedType.STREAMSB,
id: "sb",
},
];
registerProvider({
id: "kissasian",
displayName: "KissAsian",
rank: 130,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) {
let seasonNumber = "";
let episodeNumber = "";
if (media.meta.type === MWMediaType.SERIES) {
seasonNumber =
media.meta.seasonData.number === 1
? ""
: `${media.meta.seasonData.number}`;
episodeNumber = `${
media.meta.seasonData.episodes.find((e) => e.id === episode)?.number ??
""
}`;
}
const searchForm = new FormData();
searchForm.append("keyword", `${media.meta.title} ${seasonNumber}`.trim());
searchForm.append("type", "Drama");
const search = await proxiedFetch<any>("/Search/SearchSuggest", {
baseURL: kissasianBase,
method: "POST",
body: searchForm,
});
const searchPage = new DOMParser().parseFromString(search, "text/html");
const dramas = Array.from(searchPage.querySelectorAll("a")).map((drama) => {
return {
name: drama.textContent,
url: drama.href,
};
});
const targetDrama =
dramas.find(
(d) => d.name?.toLowerCase() === media.meta.title.toLowerCase()
) ?? dramas[0];
if (!targetDrama) throw new Error("Drama not found");
progress(30);
const drama = await proxiedFetch<any>(targetDrama.url);
const dramaPage = new DOMParser().parseFromString(drama, "text/html");
const episodesEl = dramaPage.querySelectorAll("tbody tr:not(:first-child)");
const episodes = Array.from(episodesEl)
.map((ep) => {
const number = ep
?.querySelector("td.episodeSub a")
?.textContent?.split("Episode")[1]
?.trim();
const url = ep?.querySelector("td.episodeSub a")?.getAttribute("href");
return { number, url };
})
.filter((e) => !!e.url);
const targetEpisode =
media.meta.type === MWMediaType.MOVIE
? episodes[0]
: episodes.find((e) => e.number === `${episodeNumber}`);
if (!targetEpisode?.url) throw new Error("Episode not found");
progress(70);
let embeds = await Promise.all(
embedProviders.map(async (provider) => {
const watch = await proxiedFetch<any>(
`${targetEpisode.url}&s=${provider.id}`,
{
baseURL: kissasianBase,
}
);
const watchPage = new DOMParser().parseFromString(watch, "text/html");
const embedUrl = watchPage
.querySelector("iframe[id=my_video_1]")
?.getAttribute("src");
return {
type: provider.type,
url: embedUrl ?? "",
};
})
);
embeds = embeds.filter((e) => e.url !== "");
return {
embeds,
};
},
});

View file

@ -1,236 +0,0 @@
import { MWEmbed, MWEmbedType } from "@/backend/helpers/embed";
import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import { MWMediaType } from "../metadata/types/mw";
const HOST = "m4ufree.com";
const URL_BASE = `https://${HOST}`;
const URL_SEARCH = `${URL_BASE}/search`;
const URL_AJAX = `${URL_BASE}/ajax`;
const URL_AJAX_TV = `${URL_BASE}/ajaxtv`;
// * Years can be in one of 4 formats:
// * - "startyear" (for movies, EX: 2022)
// * - "startyear-" (for TV series which has not ended, EX: 2022-)
// * - "startyear-endyear" (for TV series which has ended, EX: 2022-2023)
// * - "startyearendyear" (for TV series which has ended, EX: 20222023)
const REGEX_TITLE_AND_YEAR = /(.*) \(?(\d*|\d*-|\d*-\d*)\)?$/;
const REGEX_TYPE = /.*-(movie|tvshow)-online-free-m4ufree\.html/;
const REGEX_COOKIES = /XSRF-TOKEN=(.*?);.*laravel_session=(.*?);/;
const REGEX_SEASON_EPISODE = /S(\d*)-E(\d*)/;
function toDom(html: string) {
return new DOMParser().parseFromString(html, "text/html");
}
registerProvider({
id: "m4ufree",
displayName: "m4ufree",
rank: -1,
disabled: true, // Disables because the redirector URLs it returns will throw 404 / 403 depending on if you view it in the browser or fetch it respectively. It just does not work.
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, type, episode: episodeId, season: seasonId }) {
const season =
media.meta.seasons?.find((s) => s.id === seasonId)?.number || 1;
const episode =
media.meta.type === MWMediaType.SERIES
? media.meta.seasonData.episodes.find((ep) => ep.id === episodeId)
?.number || 1
: undefined;
const embeds: MWEmbed[] = [];
/*
, {
responseType: "text" as any,
}
*/
const responseText = await proxiedFetch<string>(
`${URL_SEARCH}/${encodeURIComponent(media.meta.title)}.html`
);
let dom = toDom(responseText);
const searchResults = [...dom.querySelectorAll(".item")]
.map((element) => {
const tooltipText = element.querySelector(".tiptitle p")?.innerHTML;
if (!tooltipText) return;
let regexResult = REGEX_TITLE_AND_YEAR.exec(tooltipText);
if (!regexResult || !regexResult[1] || !regexResult[2]) {
return;
}
const title = regexResult[1];
const year = Number(regexResult[2].slice(0, 4)); // * Some media stores the start AND end year. Only need start year
const a = element.querySelector("a");
if (!a) return;
const href = a.href;
regexResult = REGEX_TYPE.exec(href);
if (!regexResult || !regexResult[1]) {
return;
}
let scraperDeterminedType = regexResult[1];
scraperDeterminedType =
scraperDeterminedType === "tvshow" ? "show" : "movie"; // * Map to Trakt type
return { type: scraperDeterminedType, title, year, href };
})
.filter((item) => item);
const mediaInResults = searchResults.find(
(item) =>
item &&
item.title === media.meta.title &&
item.year.toString() === media.meta.year
);
if (!mediaInResults) {
// * Nothing found
return {
embeds,
};
}
let cookies: string | null = "";
const responseTextFromMedia = await proxiedFetch<string>(
mediaInResults.href,
{
onResponse(context) {
cookies = context.response.headers.get("X-Set-Cookie");
},
}
);
dom = toDom(responseTextFromMedia);
let regexResult = REGEX_COOKIES.exec(cookies);
if (!regexResult || !regexResult[1] || !regexResult[2]) {
// * DO SOMETHING?
throw new Error("No regexResults, yikesssssss kinda gross idk");
}
const cookieHeader = `XSRF-TOKEN=${regexResult[1]}; laravel_session=${regexResult[2]}`;
const token = dom
.querySelector('meta[name="csrf-token"]')
?.getAttribute("content");
if (!token) return { embeds };
if (type === MWMediaType.SERIES) {
// * Get the season/episode data
const episodes = [...dom.querySelectorAll(".episode")]
.map((element) => {
regexResult = REGEX_SEASON_EPISODE.exec(element.innerHTML);
if (!regexResult || !regexResult[1] || !regexResult[2]) {
return;
}
const newEpisode = Number(regexResult[1]);
const newSeason = Number(regexResult[2]);
return {
id: element.getAttribute("idepisode"),
episode: newEpisode,
season: newSeason,
};
})
.filter((item) => item);
const ep = episodes.find(
(newEp) => newEp && newEp.episode === episode && newEp.season === season
);
if (!ep) return { embeds };
const form = `idepisode=${ep.id}&_token=${token}`;
const response = await proxiedFetch<string>(URL_AJAX_TV, {
method: "POST",
headers: {
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Sec-CH-UA":
'"Not?A_Brand";v="8", "Chromium";v="108", "Microsoft Edge";v="108"',
"Sec-CH-UA-Mobile": "?0",
"Sec-CH-UA-Platform": '"Linux"',
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"X-Cookie": cookieHeader,
"X-Origin": URL_BASE,
"X-Referer": mediaInResults.href,
},
body: form,
});
dom = toDom(response);
}
const servers = [...dom.querySelectorAll(".singlemv")].map((element) =>
element.getAttribute("data")
);
for (const server of servers) {
const form = `m4u=${server}&_token=${token}`;
const response = await proxiedFetch<string>(URL_AJAX, {
method: "POST",
headers: {
Accept: "*/*",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
"X-Requested-With": "XMLHttpRequest",
"Sec-CH-UA":
'"Not?A_Brand";v="8", "Chromium";v="108", "Microsoft Edge";v="108"',
"Sec-CH-UA-Mobile": "?0",
"Sec-CH-UA-Platform": '"Linux"',
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "cors",
"Sec-Fetch-Dest": "empty",
"X-Cookie": cookieHeader,
"X-Origin": URL_BASE,
"X-Referer": mediaInResults.href,
},
body: form,
});
const serverDom = toDom(response);
const link = serverDom.querySelector("iframe")?.src;
const getEmbedType = (url: string) => {
if (url.startsWith("https://streamm4u.club"))
return MWEmbedType.STREAMM4U;
if (url.startsWith("https://play.playm4u.xyz"))
return MWEmbedType.PLAYM4U;
return null;
};
if (!link) continue;
const embedType = getEmbedType(link);
if (embedType) {
embeds.push({
url: link,
type: embedType,
});
}
}
console.log(embeds);
return {
embeds,
};
},
});

View file

@ -1,154 +0,0 @@
import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import {
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "../helpers/streams";
import { MWMediaType } from "../metadata/types/mw";
const netfilmBase = "https://net-film.vercel.app";
const qualityMap: Record<number, MWStreamQuality> = {
360: MWStreamQuality.Q360P,
540: MWStreamQuality.Q540P,
480: MWStreamQuality.Q480P,
720: MWStreamQuality.Q720P,
1080: MWStreamQuality.Q1080P,
};
registerProvider({
id: "netfilm",
displayName: "NetFilm",
rank: 15,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
disabled: true, // The creator has asked us (very nicely) to leave him alone. Until (if) we self-host, netfilm should remain disabled
async scrape({ media, episode, progress }) {
if (!this.type.includes(media.meta.type)) {
throw new Error("Unsupported type");
}
// search for relevant item
const searchResponse = await proxiedFetch<any>(
`/api/search?keyword=${encodeURIComponent(media.meta.title)}`,
{
baseURL: netfilmBase,
}
);
const searchResults = searchResponse.data.results;
progress(25);
if (media.meta.type === MWMediaType.MOVIE) {
const foundItem = searchResults.find((v: any) => {
return v.name === media.meta.title && v.releaseTime === media.meta.year;
});
if (!foundItem) throw new Error("No watchable item found");
const netfilmId = foundItem.id;
// get stream info from media
progress(75);
const watchInfo = await proxiedFetch<any>(
`/api/episode?id=${netfilmId}`,
{
baseURL: netfilmBase,
}
);
const data = watchInfo.data;
// get best quality source
const source: { url: string; quality: number } = data.qualities.reduce(
(p: any, c: any) => (c.quality > p.quality ? c : p)
);
const mappedCaptions = data.subtitles.map((sub: Record<string, any>) => ({
needsProxy: false,
url: sub.url.replace("https://convert-srt-to-vtt.vercel.app/?url=", ""),
type: MWCaptionType.SRT,
langIso: sub.language,
}));
return {
embeds: [],
stream: {
streamUrl: source.url
.replace("akm-cdn", "aws-cdn")
.replace("gg-cdn", "aws-cdn"),
quality: qualityMap[source.quality],
type: MWStreamType.HLS,
captions: mappedCaptions,
},
};
}
if (media.meta.type !== MWMediaType.SERIES)
throw new Error("Unsupported type");
const desiredSeason = media.meta.seasonData.number;
const searchItems = searchResults
.filter((v: any) => {
return v.name.includes(media.meta.title);
})
.map((v: any) => {
return {
...v,
season: parseInt(v.name.split(" ").at(-1), 10) || 1,
};
});
const foundItem = searchItems.find((v: any) => {
return v.season === desiredSeason;
});
progress(50);
const seasonDetail = await proxiedFetch<any>(
`/api/detail?id=${foundItem.id}&category=${foundItem.categoryTag[0].id}`,
{
baseURL: netfilmBase,
}
);
const episodeNo = media.meta.seasonData.episodes.find(
(v: any) => v.id === episode
)?.number;
const episodeData = seasonDetail.data.episodeVo.find(
(v: any) => v.seriesNo === episodeNo
);
progress(75);
const episodeStream = await proxiedFetch<any>(
`/api/episode?id=${foundItem.id}&category=1&episode=${episodeData.id}`,
{
baseURL: netfilmBase,
}
);
const data = episodeStream.data;
// get best quality source
const source: { url: string; quality: number } = data.qualities.reduce(
(p: any, c: any) => (c.quality > p.quality ? c : p)
);
const mappedCaptions = data.subtitles.map((sub: Record<string, any>) => ({
needsProxy: false,
url: sub.url.replace("https://convert-srt-to-vtt.vercel.app/?url=", ""),
type: MWCaptionType.SRT,
langIso: sub.language,
}));
return {
embeds: [],
stream: {
streamUrl: source.url
.replace("akm-cdn", "aws-cdn")
.replace("gg-cdn", "aws-cdn"),
quality: qualityMap[source.quality],
type: MWStreamType.HLS,
captions: mappedCaptions,
},
};
},
});

View file

@ -1,49 +0,0 @@
import { mwFetch } from "@/backend/helpers/fetch";
import { registerProvider } from "@/backend/helpers/register";
import { MWStreamQuality, MWStreamType } from "@/backend/helpers/streams";
import { MWMediaType } from "@/backend/metadata/types/mw";
const remotestreamBase = `https://fsa.remotestre.am`;
registerProvider({
id: "remotestream",
displayName: "Remote Stream",
disabled: false,
rank: 55,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) {
if (!this.type.includes(media.meta.type)) {
throw new Error("Unsupported type");
}
progress(30);
const type = media.meta.type === MWMediaType.MOVIE ? "Movies" : "Shows";
let playlistLink = `${remotestreamBase}/${type}/${media.tmdbId}`;
if (media.meta.type === MWMediaType.SERIES) {
const seasonNumber = media.meta.seasonData.number;
const episodeNumber = media.meta.seasonData.episodes.find(
(e) => e.id === episode
)?.number;
playlistLink += `/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`;
} else {
playlistLink += `/${media.tmdbId}.m3u8`;
}
const streamRes = await mwFetch<Blob>(playlistLink);
if (streamRes.type !== "application/x-mpegurl")
throw new Error("No watchable item found");
progress(90);
return {
embeds: [],
stream: {
streamUrl: playlistLink,
quality: MWStreamQuality.QUNKNOWN,
type: MWStreamType.HLS,
captions: [],
},
};
},
});

View file

@ -1,100 +0,0 @@
import { proxiedFetch } from "../helpers/fetch";
import { registerProvider } from "../helpers/register";
import { MWStreamQuality, MWStreamType } from "../helpers/streams";
import { MWMediaType } from "../metadata/types/mw";
const sflixBase = "https://sflix.video";
registerProvider({
id: "sflix",
displayName: "Sflix",
rank: 50,
disabled: true, // domain dead
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) {
let searchQuery = `${media.meta.title} `;
if (media.meta.type === MWMediaType.MOVIE)
searchQuery += media.meta.year ?? "";
if (media.meta.type === MWMediaType.SERIES)
searchQuery += `S${String(media.meta.seasonData.number).padStart(
2,
"0"
)}`;
const search = await proxiedFetch<any>(
`/?s=${encodeURIComponent(searchQuery)}`,
{
baseURL: sflixBase,
}
);
const searchPage = new DOMParser().parseFromString(search, "text/html");
const moviePageUrl = searchPage
.querySelector(".movies-list .ml-item:first-child a")
?.getAttribute("href");
if (!moviePageUrl) throw new Error("Movie does not exist");
progress(25);
const movie = await proxiedFetch<any>(moviePageUrl);
const moviePage = new DOMParser().parseFromString(movie, "text/html");
progress(45);
let outerEmbedSrc = null;
if (media.meta.type === MWMediaType.MOVIE) {
outerEmbedSrc = moviePage
.querySelector("iframe")
?.getAttribute("data-lazy-src");
} else if (media.meta.type === MWMediaType.SERIES) {
const series = Array.from(moviePage.querySelectorAll(".desc p a")).map(
(a) => ({
title: a.getAttribute("title"),
link: a.getAttribute("href"),
})
);
const episodeNumber = media.meta.seasonData.episodes.find(
(e) => e.id === episode
)?.number;
const targetSeries = series.find((s) =>
s.title?.endsWith(String(episodeNumber).padStart(2, "0"))
);
if (!targetSeries) throw new Error("Episode does not exist");
outerEmbedSrc = targetSeries.link;
}
if (!outerEmbedSrc) throw new Error("Outer embed source not found");
progress(65);
const outerEmbed = await proxiedFetch<any>(outerEmbedSrc);
const outerEmbedPage = new DOMParser().parseFromString(
outerEmbed,
"text/html"
);
const embedSrc = outerEmbedPage
.querySelector("iframe")
?.getAttribute("src");
if (!embedSrc) throw new Error("Embed source not found");
const embed = await proxiedFetch<string>(embedSrc);
const streamUrl = embed.match(/file\s*:\s*"([^"]+\.mp4)"/)?.[1];
if (!streamUrl) throw new Error("Unable to get stream");
return {
embeds: [],
stream: {
streamUrl,
quality: MWStreamQuality.Q1080P,
type: MWStreamType.MP4,
captions: [],
},
};
},
});

View file

@ -1,70 +0,0 @@
import { proxiedFetch } from "@/backend/helpers/fetch";
import { registerProvider } from "@/backend/helpers/register";
import {
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "@/backend/helpers/streams";
import { MWMediaType } from "@/backend/metadata/types/mw";
const streamflixBase = "https://us-west2-compute-proxied.streamflix.one";
const qualityMap: Record<number, MWStreamQuality> = {
360: MWStreamQuality.Q360P,
540: MWStreamQuality.Q540P,
480: MWStreamQuality.Q480P,
720: MWStreamQuality.Q720P,
1080: MWStreamQuality.Q1080P,
};
registerProvider({
id: "streamflix",
displayName: "StreamFlix",
disabled: false,
rank: 69,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) {
if (!this.type.includes(media.meta.type)) {
throw new Error("Unsupported type");
}
progress(30);
const type = media.meta.type === MWMediaType.MOVIE ? "movies" : "tv";
let seasonNumber: number | undefined;
let episodeNumber: number | undefined;
if (media.meta.type === MWMediaType.SERIES) {
// can't do type === "tv" here :(
seasonNumber = media.meta.seasonData.number;
episodeNumber = media.meta.seasonData.episodes.find(
(e: any) => e.id === episode
)?.number;
}
const streamRes = await proxiedFetch<any>(`/api/player/${type}`, {
baseURL: streamflixBase,
params: {
id: media.tmdbId,
s: seasonNumber,
e: episodeNumber,
},
});
if (!streamRes.headers.Referer) throw new Error("No watchable item found");
progress(90);
return {
embeds: [],
stream: {
streamUrl: streamRes.sources[0].url,
quality: qualityMap[streamRes.sources[0].quality],
type: MWStreamType.HLS,
captions: streamRes.subtitles.map((s: Record<string, any>) => ({
needsProxy: true,
url: s.url,
type: MWCaptionType.VTT,
langIso: s.lang,
})),
},
};
},
});

View file

@ -1,680 +0,0 @@
Credit goes to @ImZaw and @Blatzar from https://github.com/recloudstream/cloudstream
All files in the current directory (src/providers/list/superstream) are derived from https://github.com/recloudstream/cloudstream-extensions/blob/master/SuperStream/src/main/kotlin/com/lagradost/SuperStream.kt
Below is the license associated with the source of the derived work.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View file

@ -1,275 +0,0 @@
import CryptoJS from "crypto-js";
import { customAlphabet } from "nanoid";
import {
getMWCaptionTypeFromUrl,
isSupportedSubtitle,
} from "@/backend/helpers/captions";
import { proxiedFetch } from "@/backend/helpers/fetch";
import { registerProvider } from "@/backend/helpers/register";
import {
MWCaption,
MWCaptionType,
MWStreamQuality,
MWStreamType,
} from "@/backend/helpers/streams";
import { MWMediaType } from "@/backend/metadata/types/mw";
import { compareTitle } from "@/utils/titleMatch";
const nanoid = customAlphabet("0123456789abcdef", 32);
const qualityMap = {
"360p": MWStreamQuality.Q360P,
"480p": MWStreamQuality.Q480P,
"720p": MWStreamQuality.Q720P,
"1080p": MWStreamQuality.Q1080P,
};
type QualityInMap = keyof typeof qualityMap;
// CONSTANTS, read below (taken from og)
// We do not want content scanners to notice this scraping going on so we've hidden all constants
// The source has its origins in China so I added some extra security with banned words
// Mayhaps a tiny bit unethical, but this source is just too good :)
// If you are copying this code please use precautions so they do not change their api.
const iv = atob("d0VpcGhUbiE=");
const key = atob("MTIzZDZjZWRmNjI2ZHk1NDIzM2FhMXc2");
const apiUrls = [
atob("aHR0cHM6Ly9zaG93Ym94LnNoZWd1Lm5ldC9hcGkvYXBpX2NsaWVudC9pbmRleC8="),
atob("aHR0cHM6Ly9tYnBhcGkuc2hlZ3UubmV0L2FwaS9hcGlfY2xpZW50L2luZGV4Lw=="),
];
const appKey = atob("bW92aWVib3g=");
const appId = atob("Y29tLnRkby5zaG93Ym94");
const captionsDomains = [
atob("bWJwaW1hZ2VzLmNodWF4aW4uY29t"),
atob("aW1hZ2VzLnNoZWd1Lm5ldA=="),
];
// cryptography stuff
const crypto = {
encrypt(str: string) {
return CryptoJS.TripleDES.encrypt(str, CryptoJS.enc.Utf8.parse(key), {
iv: CryptoJS.enc.Utf8.parse(iv),
}).toString();
},
getVerify(str: string, str2: string, str3: string) {
if (str) {
return CryptoJS.MD5(
CryptoJS.MD5(str2).toString() + str3 + str
).toString();
}
return null;
},
};
// get expire time
const expiry = () => Math.floor(Date.now() / 1000 + 60 * 60 * 12);
// sending requests
const get = (data: object, altApi = false) => {
const defaultData = {
childmode: "0",
app_version: "11.5",
appid: appId,
lang: "en",
expired_date: `${expiry()}`,
platform: "android",
channel: "Website",
};
const encryptedData = crypto.encrypt(
JSON.stringify({
...defaultData,
...data,
})
);
const appKeyHash = CryptoJS.MD5(appKey).toString();
const verify = crypto.getVerify(encryptedData, appKey, key);
const body = JSON.stringify({
app_key: appKeyHash,
verify,
encrypt_data: encryptedData,
});
const b64Body = btoa(body);
const formatted = new URLSearchParams();
formatted.append("data", b64Body);
formatted.append("appid", "27");
formatted.append("platform", "android");
formatted.append("version", "129");
formatted.append("medium", "Website");
const requestUrl = altApi ? apiUrls[1] : apiUrls[0];
return proxiedFetch<any>(requestUrl, {
method: "POST",
parseResponse: JSON.parse,
headers: {
Platform: "android",
"Content-Type": "application/x-www-form-urlencoded",
},
body: `${formatted.toString()}&token${nanoid()}`,
});
};
// Find best resolution
const getBestQuality = (list: any[]) => {
return (
list.find((quality: any) => quality.quality === "1080p" && quality.path) ??
list.find((quality: any) => quality.quality === "720p" && quality.path) ??
list.find((quality: any) => quality.quality === "480p" && quality.path) ??
list.find((quality: any) => quality.quality === "360p" && quality.path)
);
};
const convertSubtitles = (subtitleGroup: any): MWCaption | null => {
let subtitles = subtitleGroup.subtitles;
subtitles = subtitles
.map((subFile: any) => {
const filePath = subFile.file_path
.replace(captionsDomains[0], captionsDomains[1])
.replace(/\s/g, "+")
.replace(/[()]/g, (c: string) => {
return `%${c.charCodeAt(0).toString(16)}`;
});
const supported = isSupportedSubtitle(filePath);
if (!supported) return null;
const type = getMWCaptionTypeFromUrl(filePath);
return {
...subFile,
file_path: filePath,
type: type as MWCaptionType,
};
})
.filter(Boolean);
if (subtitles.length === 0) return null;
const subFile = subtitles[0];
return {
needsProxy: true,
langIso: subtitleGroup.language,
url: subFile.file_path,
type: subFile.type,
};
};
registerProvider({
id: "superstream",
displayName: "Superstream",
rank: 300,
type: [MWMediaType.MOVIE, MWMediaType.SERIES],
async scrape({ media, episode, progress }) {
// Find Superstream ID for show
const searchQuery = {
module: "Search4",
page: "1",
type: "all",
keyword: media.meta.title,
pagelimit: "20",
};
const searchRes = (await get(searchQuery, true)).data.list;
progress(33);
const superstreamEntry = searchRes.find(
(res: any) =>
compareTitle(res.title, media.meta.title) &&
res.year === Number(media.meta.year)
);
if (!superstreamEntry) throw new Error("No entry found on SuperStream");
const superstreamId = superstreamEntry.id;
// Movie logic
if (media.meta.type === MWMediaType.MOVIE) {
const apiQuery = {
uid: "",
module: "Movie_downloadurl_v3",
mid: superstreamId,
oss: "1",
group: "",
};
const mediaRes = (await get(apiQuery)).data;
progress(50);
const hdQuality = getBestQuality(mediaRes.list);
if (!hdQuality) throw new Error("No quality could be found.");
const subtitleApiQuery = {
fid: hdQuality.fid,
uid: "",
module: "Movie_srt_list_v2",
mid: superstreamId,
};
const subtitleRes = (await get(subtitleApiQuery)).data;
const mappedCaptions = subtitleRes.list
.map(convertSubtitles)
.filter(Boolean);
return {
embeds: [],
stream: {
streamUrl: hdQuality.path,
quality: qualityMap[hdQuality.quality as QualityInMap],
type: MWStreamType.MP4,
captions: mappedCaptions,
},
};
}
if (media.meta.type !== MWMediaType.SERIES)
throw new Error("Unsupported type");
// Fetch requested episode
const apiQuery = {
uid: "",
module: "TV_downloadurl_v3",
tid: superstreamId,
season: media.meta.seasonData.number.toString(),
episode: (
media.meta.seasonData.episodes.find(
(episodeInfo) => episodeInfo.id === episode
)?.number ?? 1
).toString(),
oss: "1",
group: "",
};
const mediaRes = (await get(apiQuery)).data;
progress(66);
const hdQuality = getBestQuality(mediaRes.list);
if (!hdQuality) throw new Error("No quality could be found.");
const subtitleApiQuery = {
fid: hdQuality.fid,
uid: "",
module: "TV_srt_list_v2",
episode:
media.meta.seasonData.episodes.find(
(episodeInfo) => episodeInfo.id === episode
)?.number ?? 1,
tid: superstreamId,
season: media.meta.seasonData.number.toString(),
};
const subtitleRes = (await get(subtitleApiQuery)).data;
const mappedCaptions = subtitleRes.list
.map(convertSubtitles)
.filter(Boolean);
return {
embeds: [],
stream: {
quality: qualityMap[
hdQuality.quality as QualityInMap
] as MWStreamQuality,
streamUrl: hdQuality.path,
type: MWStreamType.MP4,
captions: mappedCaptions,
},
};
},
});

90
src/components/Avatar.tsx Normal file
View file

@ -0,0 +1,90 @@
import classNames from "classnames";
import { useMemo } from "react";
import { base64ToBuffer, decryptData } from "@/backend/accounts/crypto";
import { Icon, Icons } from "@/components/Icon";
import { UserIcon } from "@/components/UserIcon";
import { AccountProfile } from "@/pages/parts/auth/AccountCreatePart";
import { useAuthStore } from "@/stores/auth";
export interface AvatarProps {
profile: AccountProfile["profile"];
sizeClass?: string;
iconClass?: string;
bottom?: React.ReactNode;
}
export function Avatar(props: AvatarProps) {
return (
<div className="relative inline-block">
<div
className={classNames(
props.sizeClass,
"rounded-full overflow-hidden flex items-center justify-center text-white"
)}
style={{
background: `linear-gradient(to bottom right, ${props.profile.colorA}, ${props.profile.colorB})`,
}}
>
<UserIcon
className={props.iconClass}
icon={props.profile.icon as any}
/>
</div>
{props.bottom ? (
<div className="absolute bottom-0 left-1/2 transform translate-y-1/2 -translate-x-1/2">
{props.bottom}
</div>
) : null}
</div>
);
}
export function UserAvatar(props: {
sizeClass?: string;
iconClass?: string;
bottom?: React.ReactNode;
withName?: boolean;
}) {
const auth = useAuthStore();
const bufferSeed = useMemo(
() =>
auth.account && auth.account.seed
? base64ToBuffer(auth.account.seed)
: null,
[auth]
);
if (!auth.account || auth.account === null) return null;
const deviceName = bufferSeed
? decryptData(auth.account.deviceName, bufferSeed)
: "...";
return (
<>
<Avatar
profile={auth.account.profile}
sizeClass={props.sizeClass ?? "w-[2rem] h-[2rem]"}
iconClass={props.iconClass}
bottom={props.bottom}
/>
{props.withName && bufferSeed ? (
<span className="hidden md:inline-block">
{deviceName.length >= 20
? `${deviceName.slice(0, 20 - 1)}`
: deviceName}
</span>
) : null}
</>
);
}
export function NoUserAvatar(props: { iconClass?: string }) {
return (
<div className="relative inline-block p-1 text-type-dimmed">
<Icon className={props.iconClass ?? "text-xl"} icon={Icons.MENU} />
</div>
);
}

View file

@ -1,28 +0,0 @@
import { Icon, Icons } from "@/components/Icon";
import { useBanner } from "@/hooks/useBanner";
export function Banner(props: { children: React.ReactNode; type: "error" }) {
const [ref] = useBanner<HTMLDivElement>("internet");
const styles = {
error: "bg-[#C93957] text-white",
};
const icons = {
error: Icons.CIRCLE_EXCLAMATION,
};
return (
<div ref={ref}>
<div
className={[
styles[props.type],
"flex items-center justify-center p-1",
].join(" ")}
>
<div className="flex items-center space-x-3">
<Icon icon={icons[props.type]} />
<div>{props.children}</div>
</div>
</div>
</div>
);
}

View file

@ -1,26 +0,0 @@
import { ReactNode } from "react";
import { Icon, Icons } from "@/components/Icon";
interface Props {
icon?: Icons;
onClick?: () => void;
children?: ReactNode;
}
export function Button(props: Props) {
return (
<button
type="button"
onClick={props.onClick}
className="inline-flex items-center justify-center rounded-lg bg-white px-8 py-3 font-bold text-black transition-[transform,background-color] duration-100 hover:bg-gray-200 active:scale-105 md:px-16"
>
{props.icon ? (
<span className="mr-3 hidden md:inline-block">
<Icon icon={props.icon} />
</span>
) : null}
{props.children}
</button>
);
}

View file

@ -1,30 +0,0 @@
import { useSettings } from "@/state/settings";
import { Icon, Icons } from "./Icon";
export const colors = ["#ffffff", "#00ffff", "#ffff00"];
export default function CaptionColorSelector({ color }: { color: string }) {
const { captionSettings, setCaptionColor } = useSettings();
return (
<div
className={`flex h-8 w-8 items-center justify-center rounded transition-[background-color,transform] duration-100 hover:bg-[#1c161b79] active:scale-110 ${
color === captionSettings.style.color ? "bg-[#1C161B]" : ""
}`}
onClick={() => setCaptionColor(color)}
>
<div
className="h-4 w-4 cursor-pointer appearance-none rounded-full"
style={{
backgroundColor: color,
}}
/>
<Icon
className={[
"absolute text-xs text-[#1C161B]",
color === captionSettings.style.color ? "" : "hidden",
].join(" ")}
icon={Icons.CHECKMARK}
/>
</div>
);
}

View file

@ -0,0 +1,46 @@
import classNames from "classnames";
import "flag-icons/css/flag-icons.min.css";
export interface FlagIconProps {
countryCode?: string;
}
// Country code overrides
const countryOverrides: Record<string, string> = {
en: "gb",
cs: "cz",
el: "gr",
fa: "ir",
ko: "kr",
he: "il",
ze: "cn",
ar: "sa",
ja: "jp",
bs: "ba",
vi: "vn",
zh: "cn",
sl: "si",
};
export function FlagIcon(props: FlagIconProps) {
let countryCode =
(props.countryCode || "")?.split("-").pop()?.toLowerCase() || "";
if (countryOverrides[countryCode])
countryCode = countryOverrides[countryCode];
if (countryCode === "pirate")
return (
<div className="w-8 h-6 rounded bg-[#2E3439] flex justify-center items-center">
<img src="/skull.svg" className="w-4 h-4" />
</div>
);
return (
<span
className={classNames(
"!w-8 h-6 rounded overflow-hidden bg-video-context-flagBg bg-cover bg-center block fi",
props.countryCode ? `fi-${countryCode}` : undefined
)}
/>
);
}

View file

@ -9,6 +9,7 @@ export enum Icons {
ARROW_LEFT = "arrowLeft",
ARROW_RIGHT = "arrowRight",
CHEVRON_DOWN = "chevronDown",
CHEVRON_UP = "chevronUp",
CHEVRON_RIGHT = "chevronRight",
CHEVRON_LEFT = "chevronLeft",
CLAPPER_BOARD = "clapperBoard",
@ -41,6 +42,25 @@ export enum Icons {
PICTURE_IN_PICTURE = "pictureInPicture",
CHECKMARK = "checkmark",
TACHOMETER = "tachometer",
MAIL = "mail",
CIRCLE_CHECK = "circle_check",
SKIP_EPISODE = "skip_episode",
MORE_VERTICAL = "more_vertical",
IOS_SHARE = "ios_share",
IOS_FILES = "ios_files",
WAND = "wand",
COPY = "copy",
USER = "user",
UP_DOWN_ARROW = "up_down_arrow",
RISING_STAR = "rising_star",
SETTINGS = "settings",
COINS = "coins",
LOGOUT = "logout",
MENU = "menu",
LOCK = "lock",
UNLOCK = "unlock",
DONATION = "donation",
CIRCLE_QUESTION = "circle_question",
}
export interface IconProps {
@ -55,8 +75,9 @@ const iconList: Record<Icons, string> = {
eyeSlash: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M150.7 92.77C195 58.27 251.8 32 320 32C400.8 32 465.5 68.84 512.6 112.6C559.4 156 590.7 207.1 605.5 243.7C608.8 251.6 608.8 260.4 605.5 268.3C592.1 300.6 565.2 346.1 525.6 386.7L630.8 469.1C641.2 477.3 643.1 492.4 634.9 502.8C626.7 513.2 611.6 515.1 601.2 506.9L9.196 42.89C-1.236 34.71-3.065 19.63 5.112 9.196C13.29-1.236 28.37-3.065 38.81 5.112L150.7 92.77zM223.1 149.5L313.4 220.3C317.6 211.8 320 202.2 320 191.1C320 180.5 316.1 169.7 311.6 160.4C314.4 160.1 317.2 159.1 320 159.1C373 159.1 416 202.1 416 255.1C416 269.7 413.1 282.7 407.1 294.5L446.6 324.7C457.7 304.3 464 280.9 464 255.1C464 176.5 399.5 111.1 320 111.1C282.7 111.1 248.6 126.2 223.1 149.5zM320 480C239.2 480 174.5 443.2 127.4 399.4C80.62 355.1 49.34 304 34.46 268.3C31.18 260.4 31.18 251.6 34.46 243.7C44 220.8 60.29 191.2 83.09 161.5L177.4 235.8C176.5 242.4 176 249.1 176 255.1C176 335.5 240.5 400 320 400C338.7 400 356.6 396.4 373 389.9L446.2 447.5C409.9 467.1 367.8 480 320 480H320z"/></svg>`,
arrowLeft: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>`,
chevronDown: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>`,
chevronUp: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-up"><polyline points="18 15 12 9 6 15"></polyline></svg>`,
chevronRight: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right"><polyline points="9 18 15 12 9 6"></polyline></svg>`,
chevronLeft: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left"><polyline points="15 18 9 12 15 6"></polyline></svg>`,
chevronLeft: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-left"><polyline points="15 18 9 12 15 6"></polyline></svg>`,
clapperBoard: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M326.1 160l127.4-127.4C451.7 32.39 449.9 32 448 32h-86.06l-128 128H326.1zM166.1 160l128-128H201.9l-128 128H166.1zM497.7 56.19L393.9 160H512V96C512 80.87 506.5 67.15 497.7 56.19zM134.1 32H64C28.65 32 0 60.65 0 96v64h6.062L134.1 32zM0 416c0 35.35 28.65 64 64 64h384c35.35 0 64-28.65 64-64V192H0V416z"/></svg>`,
film: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M463.1 32h-416C21.49 32-.0001 53.49-.0001 80v352c0 26.51 21.49 48 47.1 48h416c26.51 0 48-21.49 48-48v-352C511.1 53.49 490.5 32 463.1 32zM111.1 408c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8L111.1 408zM111.1 280c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V280zM111.1 152c0 4.418-3.582 8-8 8H55.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8L111.1 152zM351.1 400c0 8.836-7.164 16-16 16H175.1c-8.836 0-16-7.164-16-16v-96c0-8.838 7.164-16 16-16h160c8.836 0 16 7.162 16 16V400zM351.1 208c0 8.836-7.164 16-16 16H175.1c-8.836 0-16-7.164-16-16v-96c0-8.838 7.164-16 16-16h160c8.836 0 16 7.162 16 16V208zM463.1 408c0 4.418-3.582 8-8 8h-47.1c-4.418 0-7.1-3.582-7.1-8l0-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V408zM463.1 280c0 4.418-3.582 8-8 8h-47.1c-4.418 0-8-3.582-8-8v-48c0-4.418 3.582-8 8-8h47.1c4.418 0 8 3.582 8 8V280zM463.1 152c0 4.418-3.582 8-8 8h-47.1c-4.418 0-8-3.582-8-8l0-48c0-4.418 3.582-8 7.1-8h47.1c4.418 0 8 3.582 8 8V152z"/></svg>`,
dragon: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="currentColor" d="M18.43 255.8L192 224L100.8 292.6C90.67 302.8 97.8 320 112 320h222.7c-9.499-26.5-14.75-54.5-14.75-83.38V194.2L200.3 106.8C176.5 90.88 145 92.75 123.3 111.2l-117.5 116.4C-6.562 238 2.436 258 18.43 255.8zM575.2 289.9l-100.7-50.25c-16.25-8.125-26.5-24.75-26.5-43V160h63.99l28.12 22.62C546.1 188.6 554.2 192 562.7 192h30.1c11.1 0 23.12-6.875 28.5-17.75l14.37-28.62c5.374-10.87 4.25-23.75-2.999-33.5l-74.49-99.37C552.1 4.75 543.5 0 533.5 0H296C288.9 0 285.4 8.625 290.4 13.62L351.1 64L292.4 88.75c-5.874 3-5.874 11.37 0 14.37L351.1 128l-.0011 108.6c0 72 35.99 139.4 95.99 179.4c-195.6 6.75-344.4 41-434.1 60.88c-8.124 1.75-13.87 9-13.87 17.38C.0463 504 8.045 512 17.79 512h499.1c63.24 0 119.6-47.5 122.1-110.8C642.3 354 617.1 310.9 575.2 289.9zM489.1 66.25l45.74 11.38c-2.75 11-12.5 18.88-24.12 18.25C497.7 95.25 484.8 83.38 489.1 66.25z"/></svg>`,
@ -89,6 +110,25 @@ const iconList: Record<Icons, string> = {
pictureInPicture: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" fill="currentColor" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98V5c0-1.1-.9-2-2-2zm0 16.01H3V4.98h18v14.03z"/></svg>`,
checkmark: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" fill="currentColor" viewBox="0 0 24 24"><path d="M9 22l-10-10.598 2.798-2.859 7.149 7.473 13.144-14.016 2.909 2.806z" /></svg>`,
tachometer: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" fill="currentColor" viewBox="0 0 576 512"><!-- Font Awesome Pro 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M128 288c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32zm154.65-97.08l16.24-48.71c1.16-3.45 3.18-6.35 4.92-9.43-4.73-2.76-9.94-4.78-15.81-4.78-17.67 0-32 14.33-32 32 0 15.78 11.63 28.29 26.65 30.92zM176 176c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32zM288 32C128.94 32 0 160.94 0 320c0 52.8 14.25 102.26 39.06 144.8 5.61 9.62 16.3 15.2 27.44 15.2h443c11.14 0 21.83-5.58 27.44-15.2C561.75 422.26 576 372.8 576 320c0-159.06-128.94-288-288-288zm212.27 400H75.73C57.56 397.63 48 359.12 48 320 48 187.66 155.66 80 288 80s240 107.66 240 240c0 39.12-9.56 77.63-27.73 112zM416 320c0 17.67 14.33 32 32 32s32-14.33 32-32-14.33-32-32-32-32 14.33-32 32zm-56.41-182.77c-12.72-4.23-26.16 2.62-30.38 15.17l-45.34 136.01C250.49 290.58 224 318.06 224 352c0 11.72 3.38 22.55 8.88 32h110.25c5.5-9.45 8.88-20.28 8.88-32 0-19.45-8.86-36.66-22.55-48.4l45.34-136.01c4.17-12.57-2.64-26.17-15.21-30.36zM432 208c0-15.8-11.66-28.33-26.72-30.93-.07.21-.07.43-.14.65l-19.5 58.49c4.37 2.24 9.11 3.8 14.36 3.8 17.67-.01 32-14.34 32-32.01z"/></svg>`,
mail: `<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19.25 4.125H2.75C2.56766 4.125 2.3928 4.19743 2.26386 4.32636C2.13493 4.4553 2.0625 4.63016 2.0625 4.8125V16.5C2.0625 16.8647 2.20737 17.2144 2.46523 17.4723C2.72309 17.7301 3.07283 17.875 3.4375 17.875H18.5625C18.9272 17.875 19.2769 17.7301 19.5348 17.4723C19.7926 17.2144 19.9375 16.8647 19.9375 16.5V4.8125C19.9375 4.63016 19.8651 4.4553 19.7361 4.32636C19.6072 4.19743 19.4323 4.125 19.25 4.125ZM8.48289 11L3.4375 15.6243V6.3757L8.48289 11ZM9.50039 11.9324L10.5316 12.882C10.6585 12.9985 10.8244 13.0631 10.9966 13.0631C11.1687 13.0631 11.3346 12.9985 11.4615 12.882L12.4927 11.9324L17.4771 16.5H4.51773L9.50039 11.9324ZM13.5171 11L18.5625 6.37484V15.6252L13.5171 11Z" fill="currentColor" /></svg>`,
circle_check: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>`,
skip_episode: `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.625 2.8125V15.1875C14.625 15.3367 14.5657 15.4798 14.4602 15.5852C14.3548 15.6907 14.2117 15.75 14.0625 15.75C13.9133 15.75 13.7702 15.6907 13.6648 15.5852C13.5593 15.4798 13.5 15.3367 13.5 15.1875V10.3198L5.09273 15.5777C4.92342 15.684 4.72878 15.7431 4.52895 15.7489C4.32913 15.7547 4.13139 15.707 3.95621 15.6107C3.78102 15.5144 3.63477 15.373 3.53258 15.2012C3.43039 15.0294 3.37599 14.8333 3.375 14.6334V3.36656C3.37599 3.16666 3.43039 2.97065 3.53258 2.79883C3.63477 2.62702 3.78102 2.48564 3.95621 2.38933C4.13139 2.29303 4.32913 2.2453 4.52895 2.25109C4.72878 2.25688 4.92342 2.31598 5.09273 2.42227L13.5 7.68023V2.8125C13.5 2.66332 13.5593 2.52024 13.6648 2.41475C13.7702 2.30926 13.9133 2.25 14.0625 2.25C14.2117 2.25 14.3548 2.30926 14.4602 2.41475C14.5657 2.52024 14.625 2.66332 14.625 2.8125Z" fill="currentColor"/></svg>`,
more_vertical: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-more-vertical"><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg>`,
ios_share: `<svg width="1em" height="1em" viewBox="0 0 20 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 15.3857C10.4409 15.3857 10.8101 15.0166 10.8101 14.5859V4.05518L10.7485 2.51709L11.4355 3.24512L12.9941 4.90625C13.1377 5.07031 13.353 5.15234 13.5479 5.15234C13.9683 5.15234 14.2964 4.84473 14.2964 4.42432C14.2964 4.20898 14.2041 4.04492 14.0503 3.89111L10.5845 0.54834C10.3794 0.343262 10.2051 0.271484 10 0.271484C9.78467 0.271484 9.61035 0.343262 9.40527 0.54834L5.93945 3.89111C5.78564 4.04492 5.69336 4.20898 5.69336 4.42432C5.69336 4.84473 6.00098 5.15234 6.43164 5.15234C6.62646 5.15234 6.85205 5.07031 6.99561 4.90625L8.5542 3.24512L9.24121 2.51709L9.17969 4.05518V14.5859C9.17969 15.0166 9.55908 15.3857 10 15.3857ZM4.11426 23.4146H15.8755C18.0186 23.4146 19.0952 22.3481 19.0952 20.2358V10.0024C19.0952 7.89014 18.0186 6.82373 15.8755 6.82373H13.0146V8.47461H15.8447C16.8599 8.47461 17.4443 9.02832 17.4443 10.0947V20.1436C17.4443 21.21 16.8599 21.7637 15.8447 21.7637H4.13477C3.10938 21.7637 2.54541 21.21 2.54541 20.1436V10.0947C2.54541 9.02832 3.10938 8.47461 4.13477 8.47461H6.9751V6.82373H4.11426C1.97119 6.82373 0.894531 7.89014 0.894531 10.0024V20.2358C0.894531 22.3481 1.97119 23.4146 4.11426 23.4146Z" fill="currentColor"/></svg>`,
ios_files: `<svg width="1em" height="1em" viewBox="0 0 24 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.22405 20H21.024C22.9178 20 24 18.8772 24 16.7018V5.33333C24 3.1462 22.9065 2.03509 20.776 2.03509H10.5063C9.72851 2.03509 9.30014 1.85965 8.74777 1.36842L8.12776 0.818713C7.41757 0.187135 6.91029 0 5.85063 0H2.81822C1.01456 0 0 1.04094 0 3.1462V16.7018C0 18.8889 1.0822 20 3.22405 20ZM1.47675 3.22807C1.47675 2.08187 2.04039 1.50877 3.11132 1.50877H5.47863C6.23391 1.50877 6.65101 1.68421 7.21466 2.19883L7.84594 2.74854C8.52231 3.35673 9.06341 3.55556 10.1343 3.55556H20.7534C21.8807 3.55556 22.5233 4.18713 22.5233 5.4152V6.17544H1.47675V3.22807ZM3.24659 18.4795C2.09676 18.4795 1.47675 17.848 1.47675 16.6199V7.61403H22.5233V16.6316C22.5233 17.848 21.8807 18.4795 20.7534 18.4795H3.24659Z" fill="white"/></svg>`,
wand: `<svg width="1em" height="1em" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.33437 4.33438L8.15625 4.775C8.0625 4.80937 8 4.9 8 5C8 5.1 8.0625 5.19062 8.15625 5.225L9.33437 5.66563L9.775 6.84375C9.80938 6.9375 9.9 7 10 7C10.1 7 10.1906 6.9375 10.225 6.84375L10.6656 5.66563L11.8438 5.225C11.9375 5.19062 12 5.1 12 5C12 4.9 11.9375 4.80937 11.8438 4.775L10.6656 4.33438L10.225 3.15625C10.1906 3.0625 10.1 3 10 3C9.9 3 9.80938 3.0625 9.775 3.15625L9.33437 4.33438ZM3.44062 15.3562C2.85625 15.9406 2.85625 16.8906 3.44062 17.4781L4.52187 18.5594C5.10625 19.1437 6.05625 19.1437 6.64375 18.5594L18.5594 6.64062C19.1438 6.05625 19.1438 5.10625 18.5594 4.51875L17.4781 3.44063C16.8937 2.85625 15.9437 2.85625 15.3562 3.44063L3.44062 15.3562ZM17.1438 5.58125L13.8625 8.8625L13.1344 8.13438L16.4156 4.85312L17.1438 5.58125ZM2.23438 6.6625C2.09375 6.71562 2 6.85 2 7C2 7.15 2.09375 7.28438 2.23438 7.3375L4 8L4.6625 9.76562C4.71562 9.90625 4.85 10 5 10C5.15 10 5.28438 9.90625 5.3375 9.76562L6 8L7.76562 7.3375C7.90625 7.28438 8 7.15 8 7C8 6.85 7.90625 6.71562 7.76562 6.6625L6 6L5.3375 4.23438C5.28438 4.09375 5.15 4 5 4C4.85 4 4.71562 4.09375 4.6625 4.23438L4 6L2.23438 6.6625ZM13.2344 14.6625C13.0938 14.7156 13 14.85 13 15C13 15.15 13.0938 15.2844 13.2344 15.3375L15 16L15.6625 17.7656C15.7156 17.9062 15.85 18 16 18C16.15 18 16.2844 17.9062 16.3375 17.7656L17 16L18.7656 15.3375C18.9062 15.2844 19 15.15 19 15C19 14.85 18.9062 14.7156 18.7656 14.6625L17 14L16.3375 12.2344C16.2844 12.0938 16.15 12 16 12C15.85 12 15.7156 12.0938 15.6625 12.2344L15 14L13.2344 14.6625Z" fill="currentColor"/></svg>`,
copy: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-copy"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg>`,
user: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>`,
up_down_arrow: `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.53803 5.19018C4.50013 5.09883 4.49018 4.99829 4.50942 4.90128C4.52867 4.80427 4.57625 4.71514 4.64616 4.64518L7.64616 1.64518C7.69259 1.59869 7.74774 1.56181 7.80844 1.53665C7.86913 1.51149 7.9342 1.49854 7.99991 1.49854C8.06561 1.49854 8.13068 1.51149 8.19138 1.53665C8.25207 1.56181 8.30722 1.59869 8.35366 1.64518L11.3537 4.64518C11.4237 4.71511 11.4713 4.80423 11.4907 4.90128C11.51 4.99832 11.5001 5.09891 11.4622 5.19032C11.4243 5.28174 11.3602 5.35985 11.2779 5.41479C11.1956 5.46972 11.0989 5.49901 10.9999 5.49893H4.99991C4.90102 5.49891 4.80435 5.46956 4.72214 5.41461C4.63993 5.35965 4.57586 5.28155 4.53803 5.19018ZM10.9999 10.4989H4.99991C4.90096 10.4988 4.80421 10.5281 4.72191 10.5831C4.63962 10.638 4.57547 10.7161 4.53759 10.8075C4.49972 10.8989 4.48982 10.9995 4.50914 11.0966C4.52847 11.1936 4.57615 11.2828 4.64616 11.3527L7.64616 14.3527C7.69259 14.3992 7.74774 14.436 7.80844 14.4612C7.86913 14.4864 7.9342 14.4993 7.99991 14.4993C8.06561 14.4993 8.13068 14.4864 8.19138 14.4612C8.25207 14.436 8.30722 14.3992 8.35366 14.3527L11.3537 11.3527C11.4237 11.2828 11.4713 11.1936 11.4907 11.0966C11.51 10.9995 11.5001 10.8989 11.4622 10.8075C11.4243 10.7161 11.3602 10.638 11.2779 10.5831C11.1956 10.5281 11.0989 10.4988 10.9999 10.4989Z" fill="currentColor"/></svg>`,
rising_star: `<svg width="1em" height="1em" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.5509 6.91102L15.5716 8.59852L16.1643 11.1108C16.2061 11.2869 16.195 11.4714 16.1325 11.6412C16.0699 11.811 15.9587 11.9587 15.8127 12.0656C15.6651 12.174 15.4888 12.2365 15.3058 12.2453C15.1229 12.254 14.9414 12.2087 14.7841 12.1148L12.5341 10.7789L10.2841 12.1148C10.1268 12.2087 9.94528 12.254 9.76231 12.2453C9.57935 12.2365 9.40303 12.174 9.2554 12.0656C9.10948 11.9586 8.99833 11.811 8.9358 11.6412C8.87328 11.4713 8.86216 11.2869 8.90384 11.1108L9.49657 8.59852L7.51657 6.91102C7.37802 6.79275 7.27755 6.63613 7.22781 6.46088C7.17808 6.28563 7.1813 6.09959 7.23708 5.92617C7.29286 5.75275 7.39869 5.59971 7.54126 5.48631C7.68383 5.37291 7.85677 5.30423 8.03829 5.28891L10.656 5.06742L11.677 2.68734C11.749 2.52049 11.8683 2.37837 12.0202 2.27853C12.1721 2.17869 12.3499 2.12549 12.5316 2.12549C12.7134 2.12549 12.8911 2.17869 13.043 2.27853C13.1949 2.37837 13.3142 2.52049 13.3863 2.68734L14.4072 5.06883L17.0242 5.28891C17.2062 5.30319 17.3798 5.37111 17.5231 5.48409C17.6665 5.59707 17.7731 5.75002 17.8294 5.9236C17.8858 6.09718 17.8894 6.28358 17.8399 6.45922C17.7903 6.63486 17.6897 6.79185 17.5509 6.91031V6.91102ZM7.02298 9.03938C6.97074 8.98708 6.9087 8.94559 6.84041 8.91728C6.77213 8.88897 6.69893 8.8744 6.62501 8.8744C6.55109 8.8744 6.47789 8.88897 6.4096 8.91728C6.34132 8.94559 6.27928 8.98708 6.22704 9.03938L2.28954 12.9769C2.18399 13.0824 2.12469 13.2256 2.12469 13.3748C2.12469 13.5241 2.18399 13.6673 2.28954 13.7728C2.39509 13.8784 2.53824 13.9377 2.68751 13.9377C2.83677 13.9377 2.97993 13.8784 3.08548 13.7728L7.02298 9.83531C7.07528 9.78307 7.11677 9.72104 7.14507 9.65275C7.17338 9.58446 7.18795 9.51127 7.18795 9.43735C7.18795 9.36342 7.17338 9.29023 7.14507 9.22194C7.11677 9.15365 7.07528 9.09162 7.02298 9.03938ZM8.14798 12.9769C8.09574 12.9246 8.0337 12.8831 7.96541 12.8548C7.89713 12.8265 7.82393 12.8119 7.75001 12.8119C7.67609 12.8119 7.60289 12.8265 7.5346 12.8548C7.46632 12.8831 7.40428 12.9246 7.35204 12.9769L3.41454 16.9144C3.36228 16.9666 3.32082 17.0287 3.29254 17.097C3.26425 17.1652 3.24969 17.2384 3.24969 17.3123C3.24969 17.3863 3.26425 17.4594 3.29254 17.5277C3.32082 17.596 3.36228 17.6581 3.41454 17.7103C3.52009 17.8159 3.66324 17.8752 3.81251 17.8752C3.88642 17.8752 3.9596 17.8606 4.02789 17.8323C4.09617 17.804 4.15821 17.7626 4.21048 17.7103L8.14798 13.7728C8.20028 13.7206 8.24177 13.6585 8.27007 13.5902C8.29838 13.522 8.31295 13.4488 8.31295 13.3748C8.31295 13.3009 8.29838 13.2277 8.27007 13.1594C8.24177 13.0912 8.20028 13.0291 8.14798 12.9769ZM12.4152 12.9769L8.47774 16.9144C8.37219 17.0199 8.3129 17.1631 8.3129 17.3123C8.3129 17.4616 8.37219 17.6048 8.47774 17.7103C8.58329 17.8159 8.72644 17.8752 8.87571 17.8752C9.02498 17.8752 9.16813 17.8159 9.27368 17.7103L13.2112 13.7728C13.3167 13.6674 13.3761 13.5243 13.3761 13.3751C13.3762 13.2259 13.317 13.0828 13.2115 12.9772C13.1061 12.8717 12.963 12.8123 12.8138 12.8123C12.6646 12.8122 12.5215 12.8714 12.4159 12.9769H12.4152Z" fill="currentColor"/></svg>`,
settings: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>`,
coins: `<svg width="1em" height="1em" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.8125 7.69742V7.21875C15.8125 5.06344 12.5615 3.4375 8.25 3.4375C3.93852 3.4375 0.6875 5.06344 0.6875 7.21875V10.6562C0.6875 12.4515 2.94336 13.878 6.1875 14.3052V14.7812C6.1875 16.9366 9.43852 18.5625 13.75 18.5625C18.0615 18.5625 21.3125 16.9366 21.3125 14.7812V11.3438C21.3125 9.56484 19.128 8.13656 15.8125 7.69742ZM4.8125 12.6216C3.12898 12.1516 2.0625 11.3773 2.0625 10.6562V9.44711C2.76375 9.94383 3.70305 10.3443 4.8125 10.6133V12.6216ZM11.6875 10.6133C12.797 10.3443 13.7362 9.94383 14.4375 9.44711V10.6562C14.4375 11.3773 13.371 12.1516 11.6875 12.6216V10.6133ZM10.3125 16.7466C8.62898 16.2766 7.5625 15.5023 7.5625 14.7812V14.4229C7.78852 14.4315 8.01711 14.4375 8.25 14.4375C8.58344 14.4375 8.90914 14.4263 9.22883 14.4074C9.58397 14.5346 9.94572 14.6424 10.3125 14.7305V16.7466ZM10.3125 12.9121C9.62964 13.013 8.94027 13.0633 8.25 13.0625C7.55973 13.0633 6.87036 13.013 6.1875 12.9121V10.8677C6.87137 10.9568 7.56035 11.001 8.25 11C8.93965 11.001 9.62863 10.9568 10.3125 10.8677V12.9121ZM15.8125 17.0371C14.4448 17.2376 13.0552 17.2376 11.6875 17.0371V14.9875C12.3712 15.0794 13.0602 15.1253 13.75 15.125C14.4397 15.126 15.1286 15.0818 15.8125 14.9927V17.0371ZM19.9375 14.7812C19.9375 15.5023 18.871 16.2766 17.1875 16.7466V14.7383C18.297 14.4693 19.2362 14.0688 19.9375 13.5721V14.7812Z" fill="currentColor"/></svg>`,
logout: `<svg style="transform: scaleX(-1);" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>`,
menu: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>`,
lock: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-lock"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>`,
unlock: `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-unlock"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 9.9-1"></path></svg>`,
donation: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path opacity="1" fill="currentColor" d="M163.9 136.9c-29.4-29.8-29.4-78.2 0-108s77-29.8 106.4 0l17.7 18 17.7-18c29.4-29.8 77-29.8 106.4 0s29.4 78.2 0 108L310.5 240.1c-6.2 6.3-14.3 9.4-22.5 9.4s-16.3-3.1-22.5-9.4L163.9 136.9zM568.2 336.3c13.1 17.8 9.3 42.8-8.5 55.9L433.1 485.5c-23.4 17.2-51.6 26.5-80.7 26.5H192 32c-17.7 0-32-14.3-32-32V416c0-17.7 14.3-32 32-32H68.8l44.9-36c22.7-18.2 50.9-28 80-28H272h16 64c17.7 0 32 14.3 32 32s-14.3 32-32 32H288 272c-8.8 0-16 7.2-16 16s7.2 16 16 16H392.6l119.7-88.2c17.8-13.1 42.8-9.3 55.9 8.5zM193.6 384l0 0-.9 0c.3 0 .6 0 .9 0z"/></svg>`,
circle_question: `<svg xmlns="http://www.w3.org/2000/svg" height="1em" width="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2023 Fonticons, Inc.--><path opacity="1" fill="currentColor" d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm169.8-90.7c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>`,
};
function ChromeCastButton() {

Some files were not shown because too many files have changed in this diff Show more