GUI-STUDIO commited on
Commit ·
7fd8202
1
Parent(s): 8eeb0e6
env changes
Browse files- src/index.ts +6 -3
- src/sub-router/111movies.ts +7 -6
- src/sub-router/vidcore.ts +7 -6
- src/sub-router/videasy.ts +7 -6
- src/sub-router/vidlinkpro.ts +7 -6
- src/sub-router/vidnest.ts +7 -6
- src/sub-router/vidsrc.ts +6 -5
- src/sub-router/vidup.ts +7 -6
- src/sub-router/vidvault.ts +6 -8
- src/sub-router/xpass.ts +7 -6
src/index.ts
CHANGED
|
@@ -18,10 +18,13 @@ await NS_runtime.set_env_var_db();
|
|
| 18 |
|
| 19 |
const PORT = process.env.PORT;
|
| 20 |
|
| 21 |
-
const APP_ENV = process.env.APP_ENV || NS_runtime.ENV_VAR_DB?.X_OFFLINE;
|
| 22 |
const X_OFFLINE = process.env.X_OFFLINE || NS_runtime.ENV_VAR_DB?.X_OFFLINE;
|
| 23 |
-
|
| 24 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
const app = new Hono({ strict: true });
|
| 27 |
|
|
|
|
| 18 |
|
| 19 |
const PORT = process.env.PORT;
|
| 20 |
|
|
|
|
| 21 |
const X_OFFLINE = process.env.X_OFFLINE || NS_runtime.ENV_VAR_DB?.X_OFFLINE;
|
| 22 |
+
|
| 23 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process?.env?.APP_ENV;
|
| 24 |
+
|
| 25 |
+
const APP_ORIGIN = () => NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process?.env?.APP_ORIGIN;
|
| 26 |
+
|
| 27 |
+
const REPO_ORIGIN = () => NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 28 |
|
| 29 |
const app = new Hono({ strict: true });
|
| 30 |
|
src/sub-router/111movies.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/111movies");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQb_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -80,7 +81,7 @@ subRouter.post(
|
|
| 80 |
|
| 81 |
let metadata = R_;
|
| 82 |
|
| 83 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 84 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 85 |
promise: NS_scrape_post_processing.construct({
|
| 86 |
portal: "111movies",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/111movies");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQb_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 81 |
|
| 82 |
let metadata = R_;
|
| 83 |
|
| 84 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 85 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 86 |
promise: NS_scrape_post_processing.construct({
|
| 87 |
portal: "111movies",
|
src/sub-router/vidcore.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_vidcore_scraper } from "../../../../packages/lib/scraper/vidcore/exe
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/vidcore");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -68,7 +69,7 @@ subRouter.post(
|
|
| 68 |
|
| 69 |
let metadata = R_;
|
| 70 |
|
| 71 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 72 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 73 |
promise: NS_scrape_post_processing.construct({
|
| 74 |
portal: "vidcore",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/vidcore");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 69 |
|
| 70 |
let metadata = R_;
|
| 71 |
|
| 72 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 73 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 74 |
promise: NS_scrape_post_processing.construct({
|
| 75 |
portal: "vidcore",
|
src/sub-router/videasy.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_videasy_scraper } from "../../../../packages/lib/scraper/videasy/exe
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/videasy");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -68,7 +69,7 @@ subRouter.post(
|
|
| 68 |
|
| 69 |
let metadata = R_;
|
| 70 |
|
| 71 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 72 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 73 |
promise: NS_scrape_post_processing.construct({
|
| 74 |
portal: "videasy",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/videasy");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 69 |
|
| 70 |
let metadata = R_;
|
| 71 |
|
| 72 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 73 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 74 |
promise: NS_scrape_post_processing.construct({
|
| 75 |
portal: "videasy",
|
src/sub-router/vidlinkpro.ts
CHANGED
|
@@ -12,10 +12,11 @@ import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
|
| 12 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 13 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 14 |
|
| 15 |
-
const APP_ENV =
|
| 16 |
-
const
|
| 17 |
-
|
| 18 |
-
const REPO_ORIGIN =
|
|
|
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/vidlinkpro");
|
| 21 |
|
|
@@ -24,7 +25,7 @@ subRouter.post(
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -69,7 +70,7 @@ subRouter.post(
|
|
| 69 |
|
| 70 |
let metadata = R_;
|
| 71 |
|
| 72 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 73 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 74 |
promise: NS_scrape_post_processing.construct({
|
| 75 |
portal: "vidlinkpro",
|
|
|
|
| 12 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 13 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 14 |
|
| 15 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 16 |
+
const APP_ORIGIN = () =>
|
| 17 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 18 |
+
const REPO_ORIGIN = () =>
|
| 19 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 20 |
|
| 21 |
const subRouter = new Hono().basePath("/vidlinkpro");
|
| 22 |
|
|
|
|
| 25 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 26 |
async (ctx) => {
|
| 27 |
const REQ0 = ctx.req.url;
|
| 28 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 29 |
const REQ_headers = ctx.req.raw.headers;
|
| 30 |
|
| 31 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 70 |
|
| 71 |
let metadata = R_;
|
| 72 |
|
| 73 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 74 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 75 |
promise: NS_scrape_post_processing.construct({
|
| 76 |
portal: "vidlinkpro",
|
src/sub-router/vidnest.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_vidnest_scraper } from "../../../../packages/lib/scraper/vidnest/exe
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/vidnest");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -68,7 +69,7 @@ subRouter.post(
|
|
| 68 |
|
| 69 |
let metadata = R_;
|
| 70 |
|
| 71 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 72 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 73 |
promise: NS_scrape_post_processing.construct({
|
| 74 |
portal: "vidnest",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/vidnest");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 69 |
|
| 70 |
let metadata = R_;
|
| 71 |
|
| 72 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 73 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 74 |
promise: NS_scrape_post_processing.construct({
|
| 75 |
portal: "vidnest",
|
src/sub-router/vidsrc.ts
CHANGED
|
@@ -10,10 +10,11 @@ import createError from "http-errors";
|
|
| 10 |
import { hono_validator_callback } from "../lib/misc";
|
| 11 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 12 |
|
| 13 |
-
const APP_ENV =
|
| 14 |
-
const
|
| 15 |
-
|
| 16 |
-
const REPO_ORIGIN =
|
|
|
|
| 17 |
|
| 18 |
const subRouter = new Hono().basePath("/vidsrc");
|
| 19 |
|
|
@@ -22,7 +23,7 @@ subRouter.post(
|
|
| 22 |
sValidator("json", NS_vidsrc_crawl.route_schema.v, hono_validator_callback),
|
| 23 |
async (ctx) => {
|
| 24 |
const REQ0 = ctx.req.url;
|
| 25 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 26 |
const REQ_headers = ctx.req.raw.headers;
|
| 27 |
|
| 28 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 10 |
import { hono_validator_callback } from "../lib/misc";
|
| 11 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 12 |
|
| 13 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 14 |
+
const APP_ORIGIN = () =>
|
| 15 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 16 |
+
const REPO_ORIGIN = () =>
|
| 17 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/vidsrc");
|
| 20 |
|
|
|
|
| 23 |
sValidator("json", NS_vidsrc_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
src/sub-router/vidup.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_vidup_scraper } from "../../../../packages/lib/scraper/vidup/exe";
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/vidup");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -68,7 +69,7 @@ subRouter.post(
|
|
| 68 |
|
| 69 |
let metadata = R_;
|
| 70 |
|
| 71 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 72 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 73 |
promise: NS_scrape_post_processing.construct({
|
| 74 |
portal: "vidup",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/vidup");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 69 |
|
| 70 |
let metadata = R_;
|
| 71 |
|
| 72 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 73 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 74 |
promise: NS_scrape_post_processing.construct({
|
| 75 |
portal: "vidup",
|
src/sub-router/vidvault.ts
CHANGED
|
@@ -3,18 +3,16 @@ import { NS_error } from "../../../../packages/lib/helpers/client/error";
|
|
| 3 |
import { sValidator } from "@hono/standard-validator";
|
| 4 |
import { NS_promise } from "../../../../packages/lib/helpers/client/promise";
|
| 5 |
import { NS_vidvault_streamify_helper } from "../../../../packages/lib/scraper/vidvault/exe";
|
| 6 |
-
import { NS_dl_vidsrc_crawl } from "../../../../packages/lib/validator/dl-vidsrc-crawl";
|
| 7 |
import { NS_general_crawl } from "../../../../packages/lib/validator/general-crawl";
|
| 8 |
-
import { NS_routes_c } from "../../../../packages/lib/helpers/client/route";
|
| 9 |
-
import createError from "http-errors";
|
| 10 |
import { hono_validator_callback } from "../lib/misc";
|
| 11 |
|
| 12 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/vidvault");
|
| 20 |
|
|
@@ -23,7 +21,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = new URL(ctx.req.url);
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || REQ0.origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 3 |
import { sValidator } from "@hono/standard-validator";
|
| 4 |
import { NS_promise } from "../../../../packages/lib/helpers/client/promise";
|
| 5 |
import { NS_vidvault_streamify_helper } from "../../../../packages/lib/scraper/vidvault/exe";
|
|
|
|
| 6 |
import { NS_general_crawl } from "../../../../packages/lib/validator/general-crawl";
|
|
|
|
|
|
|
| 7 |
import { hono_validator_callback } from "../lib/misc";
|
| 8 |
|
| 9 |
import { NS_runtime } from "../../../../packages/lib/env.runtime";
|
| 10 |
|
| 11 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 12 |
+
const APP_ORIGIN = () =>
|
| 13 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 14 |
+
const REPO_ORIGIN = () =>
|
| 15 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 16 |
|
| 17 |
const subRouter = new Hono().basePath("/vidvault");
|
| 18 |
|
|
|
|
| 21 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 22 |
async (ctx) => {
|
| 23 |
const REQ0 = new URL(ctx.req.url);
|
| 24 |
+
const REQ_ORIGIN = APP_ORIGIN() || REQ0.origin;
|
| 25 |
const REQ_headers = ctx.req.raw.headers;
|
| 26 |
|
| 27 |
const req_signal = ctx.req.raw.signal;
|
src/sub-router/xpass.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { NS_xpass_scraper } from "../../../../packages/lib/scraper/xpass/exe";
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
-
const APP_ENV =
|
| 15 |
-
const
|
| 16 |
-
|
| 17 |
-
const REPO_ORIGIN =
|
|
|
|
| 18 |
|
| 19 |
const subRouter = new Hono().basePath("/xpass");
|
| 20 |
|
|
@@ -23,7 +24,7 @@ subRouter.post(
|
|
| 23 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 24 |
async (ctx) => {
|
| 25 |
const REQ0 = ctx.req.url;
|
| 26 |
-
const REQ_ORIGIN = APP_ORIGIN || new URL(REQ0).origin;
|
| 27 |
const REQ_headers = ctx.req.raw.headers;
|
| 28 |
|
| 29 |
const req_signal = ctx.req.raw.signal;
|
|
@@ -70,7 +71,7 @@ subRouter.post(
|
|
| 70 |
|
| 71 |
let metadata = R_;
|
| 72 |
|
| 73 |
-
if (metadata && post_processing && REPO_ORIGIN && id_type === "tmdb") {
|
| 74 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 75 |
promise: NS_scrape_post_processing.construct({
|
| 76 |
portal: "xpass",
|
|
|
|
| 11 |
import { NS_scrape_post_processing } from "../../../../packages/lib/scraper/post-processing/generic";
|
| 12 |
import { T_prop_tmdb } from "../../../../packages/lib/helpers/server/streamify/lib-helper";
|
| 13 |
|
| 14 |
+
const APP_ENV = () => NS_runtime.ENV_VAR_DB?.APP_ENV || process.env.APP_ENV;
|
| 15 |
+
const APP_ORIGIN = () =>
|
| 16 |
+
NS_runtime.ENV_VAR_DB?.APP_ORIGIN || process.env.APP_ORIGIN;
|
| 17 |
+
const REPO_ORIGIN = () =>
|
| 18 |
+
NS_runtime.ENV_VAR_DB?.REPO_ORIGIN || process.env.REPO_ORIGIN;
|
| 19 |
|
| 20 |
const subRouter = new Hono().basePath("/xpass");
|
| 21 |
|
|
|
|
| 24 |
sValidator("json", NS_general_crawl.route_schema.v, hono_validator_callback),
|
| 25 |
async (ctx) => {
|
| 26 |
const REQ0 = ctx.req.url;
|
| 27 |
+
const REQ_ORIGIN = APP_ORIGIN() || new URL(REQ0).origin;
|
| 28 |
const REQ_headers = ctx.req.raw.headers;
|
| 29 |
|
| 30 |
const req_signal = ctx.req.raw.signal;
|
|
|
|
| 71 |
|
| 72 |
let metadata = R_;
|
| 73 |
|
| 74 |
+
if (metadata && post_processing && REPO_ORIGIN() && id_type === "tmdb") {
|
| 75 |
const [E__, R__] = await NS_promise.F_catch_promise({
|
| 76 |
promise: NS_scrape_post_processing.construct({
|
| 77 |
portal: "xpass",
|