mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-02-19 07:44:45 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d15bec029 | ||
|
|
b811ff5ade | ||
|
|
2e999f47bd | ||
|
|
b48ac069e8 | ||
|
|
ae138eb4ae | ||
|
|
24bccb9227 | ||
|
|
fa0f37d06b | ||
|
|
a9b501a9ff |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -20,4 +20,6 @@ web-build/
|
|||||||
|
|
||||||
expo-env.d.ts
|
expo-env.d.ts
|
||||||
# @end expo-cli
|
# @end expo-cli
|
||||||
web/**
|
web/**
|
||||||
|
.bmad-core
|
||||||
|
.kilocodemodes
|
||||||
23
README.md
23
README.md
@@ -97,24 +97,7 @@ yarn android-tv
|
|||||||
|
|
||||||
#### [Vercel](https://vercel.com/) 部署
|
#### [Vercel](https://vercel.com/) 部署
|
||||||
|
|
||||||
1. **安装 Vercel CLI**
|
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzimplexing%2FOrionTV&root-directory=backend)
|
||||||
|
|
||||||
如果您尚未安装,请全局安装 Vercel CLI:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install -g vercel
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **部署**
|
|
||||||
|
|
||||||
进入 `backend` 目录并运行 `vercel` 命令:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd backend
|
|
||||||
vercel
|
|
||||||
```
|
|
||||||
|
|
||||||
按照 Vercel CLI 的提示完成登录和部署过程。`vercel.json` 文件已配置好所有必要的构建和路由设置。
|
|
||||||
|
|
||||||
#### Docker 部署
|
#### Docker 部署
|
||||||
|
|
||||||
@@ -122,9 +105,11 @@ yarn android-tv
|
|||||||
|
|
||||||
2. `docker run -d -p 3001:3001 zimpel1/tv-host`
|
2. `docker run -d -p 3001:3001 zimpel1/tv-host`
|
||||||
|
|
||||||
|
本地部署后,需要配置https才行,不然会无法访问
|
||||||
|
|
||||||
#### 使用 demo 地址
|
#### 使用 demo 地址
|
||||||
|
|
||||||
在设置中可以使用 demo 地址: https://orion-tv.vercel.app,需要代理且不保证稳定和可用性。
|
在设置中可以使用 demo 地址: https://orion-tv.vercel.app 需要代理且不保证稳定和可用性。
|
||||||
|
|
||||||
## 📜 主要脚本
|
## 📜 主要脚本
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default function DetailScreen() {
|
|||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<ThemedView style={styles.centered}>
|
<ThemedView style={styles.centered}>
|
||||||
<ThemedText type="subtitle">Error: {error}</ThemedText>
|
<ThemedText type="subtitle">{error}</ThemedText>
|
||||||
</ThemedView>
|
</ThemedView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const initialCategories: Category[] = [
|
|||||||
{ title: "热门剧集", type: "tv", tag: "热门" },
|
{ title: "热门剧集", type: "tv", tag: "热门" },
|
||||||
{ title: "热门电影", type: "movie", tag: "热门" },
|
{ title: "热门电影", type: "movie", tag: "热门" },
|
||||||
{ title: "豆瓣 Top250", type: "movie", tag: "top250" },
|
{ title: "豆瓣 Top250", type: "movie", tag: "top250" },
|
||||||
|
{ title: "儿童", type: "movie", tag: "少儿" },
|
||||||
{ title: "美剧", type: "tv", tag: "美剧" },
|
{ title: "美剧", type: "tv", tag: "美剧" },
|
||||||
{ title: "韩剧", type: "tv", tag: "韩剧" },
|
{ title: "韩剧", type: "tv", tag: "韩剧" },
|
||||||
{ title: "日剧", type: "tv", tag: "日剧" },
|
{ title: "日剧", type: "tv", tag: "日剧" },
|
||||||
|
|||||||
@@ -43,7 +43,11 @@ export default function SearchScreen() {
|
|||||||
setError(null);
|
setError(null);
|
||||||
try {
|
try {
|
||||||
const response = await moonTVApi.searchVideos(keyword);
|
const response = await moonTVApi.searchVideos(keyword);
|
||||||
setResults(response.results);
|
if (response.results.length > 0) {
|
||||||
|
setResults(response.results);
|
||||||
|
} else {
|
||||||
|
setError("没有找到相关内容");
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError("搜索失败,请稍后重试。");
|
setError("搜索失败,请稍后重试。");
|
||||||
console.error("Search failed:", err);
|
console.error("Search failed:", err);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "mytv-backend",
|
"name": "OrionTV-proxy",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Backend service for MyTV application",
|
"description": "Backend service for MyTV application",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"dev": "ts-node-dev --respawn --transpile-only src/index.ts"
|
"dev": "ts-node-dev --respawn --transpile-only src/index.docker.ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export const API_CONFIG = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Adjust path to read from project root, not from `backend/`
|
// Adjust path to read from project root, not from `backend/`
|
||||||
const configPath = path.join(process.cwd(), "config.json");
|
const configPath = path.join(__dirname, "config.json");
|
||||||
let cachedConfig: Config;
|
let cachedConfig: Config;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -59,6 +59,15 @@ async function searchFromApi(
|
|||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"apiUrl",
|
||||||
|
apiSite.name,
|
||||||
|
"response status",
|
||||||
|
response.ok,
|
||||||
|
"response data",
|
||||||
|
data.list.length
|
||||||
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!data ||
|
!data ||
|
||||||
!data.list ||
|
!data.list ||
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"src": "src/index.ts",
|
"src": "src/index.ts",
|
||||||
"use": "@vercel/node",
|
"use": "@vercel/node",
|
||||||
"config": {
|
"config": {
|
||||||
"includeFiles": ["../config.json"]
|
"includeFiles": ["./config.json"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
19
config.json
19
config.json
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"cache_time": 3600,
|
|
||||||
"api_site": {
|
|
||||||
"ffzy": {
|
|
||||||
"key": "ffzy",
|
|
||||||
"name": "非凡资源",
|
|
||||||
"api": "http://cj.ffzy.co/api.php/provide/vod/from/ffm3u8/",
|
|
||||||
"detail": "http://www.ffzy.co"
|
|
||||||
},
|
|
||||||
"test-source": {
|
|
||||||
"key": "test-source",
|
|
||||||
"name": "示例源",
|
|
||||||
"api": "https://test-api.com/api.php"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"storage": {
|
|
||||||
"type": "localstorage"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "OrionTV",
|
"name": "OrionTV",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "expo-router/entry",
|
"main": "expo-router/entry",
|
||||||
"version": "1.0.3",
|
"version": "1.0.5",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
"start": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
||||||
"start-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
"start-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo start",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"test": "jest --watchAll",
|
"test": "jest --watchAll",
|
||||||
"lint": "expo lint",
|
"lint": "expo lint",
|
||||||
"prebuild": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo prebuild --clean",
|
"prebuild": "EXPO_USE_METRO_WORKSPACE_ROOT=1 expo prebuild --clean",
|
||||||
"prebuild-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo prebuild --clean",
|
"prebuild-tv": "EXPO_TV=1 EXPO_USE_METRO_WORKSPACE_ROOT=1 expo prebuild --clean && yarn copy-config",
|
||||||
"copy-config": "cp -r xml/* android/app/src/*",
|
"copy-config": "cp -r xml/* android/app/src/*",
|
||||||
"build-local": "cd android && ./gradlew assembleRelease"
|
"build-local": "cd android && ./gradlew assembleRelease"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<data android:scheme="https"/>
|
<data android:scheme="https"/>
|
||||||
</intent>
|
</intent>
|
||||||
</queries>
|
</queries>
|
||||||
<application android:name=".MainApplication" android:usesCleartextTraffic="true" android:networkSecurityConfig="@xml/network_security_config" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:banner="@drawable/tv_banner">
|
<application android:name=".MainApplication" android:usesCleartextTraffic="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="true" android:theme="@style/AppTheme" android:banner="@drawable/tv_banner">
|
||||||
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<network-security-config>
|
|
||||||
<domain-config cleartextTrafficPermitted="true">
|
|
||||||
<domain includeSubdomains="true">192.168.1.100</domain>
|
|
||||||
</domain-config>
|
|
||||||
</network-security-config>
|
|
||||||
Reference in New Issue
Block a user