8 Commits

Author SHA1 Message Date
zimplexing
4d15bec029 Add configuration file for API resources and update config path in index.ts 2025-07-04 17:27:57 +08:00
zimplexing
b811ff5ade Update version to 1.0.5, remove config.json, and modify .gitignore and vercel.json include paths 2025-07-04 17:15:34 +08:00
zimplexing
2e999f47bd 新增少儿分类&日志 2025-07-04 16:53:41 +08:00
zimplexing
b48ac069e8 Support http 2025-07-04 16:30:20 +08:00
zimplexing
ae138eb4ae Support http 2025-07-04 16:05:18 +08:00
zimplexing
24bccb9227 Merge branch 'master' of github.com:zimplexing/OrionTV 2025-07-02 15:57:46 +08:00
zimplexing
fa0f37d06b Update 2025-07-02 15:56:59 +08:00
Xin
a9b501a9ff Update README.md 2025-07-02 14:20:45 +08:00
14 changed files with 31 additions and 55 deletions

4
.gitignore vendored
View File

@@ -20,4 +20,6 @@ web-build/
expo-env.d.ts
# @end expo-cli
web/**
web/**
.bmad-core
.kilocodemodes

View File

@@ -97,24 +97,7 @@ yarn android-tv
#### [Vercel](https://vercel.com/) 部署
1. **安装 Vercel CLI**
如果您尚未安装,请全局安装 Vercel CLI
```sh
npm install -g vercel
```
2. **部署**
进入 `backend` 目录并运行 `vercel` 命令:
```sh
cd backend
vercel
```
按照 Vercel CLI 的提示完成登录和部署过程。`vercel.json` 文件已配置好所有必要的构建和路由设置。
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fzimplexing%2FOrionTV&root-directory=backend)
#### Docker 部署
@@ -122,9 +105,11 @@ yarn android-tv
2. `docker run -d -p 3001:3001 zimpel1/tv-host`
本地部署后需要配置https才行不然会无法访问
#### 使用 demo 地址
在设置中可以使用 demo 地址: https://orion-tv.vercel.app需要代理且不保证稳定和可用性。
在设置中可以使用 demo 地址: https://orion-tv.vercel.app 需要代理且不保证稳定和可用性。
## 📜 主要脚本

View File

@@ -97,7 +97,7 @@ export default function DetailScreen() {
if (error) {
return (
<ThemedView style={styles.centered}>
<ThemedText type="subtitle">Error: {error}</ThemedText>
<ThemedText type="subtitle">{error}</ThemedText>
</ThemedView>
);
}

View File

@@ -46,6 +46,7 @@ const initialCategories: Category[] = [
{ title: "热门剧集", type: "tv", tag: "热门" },
{ title: "热门电影", type: "movie", tag: "热门" },
{ title: "豆瓣 Top250", type: "movie", tag: "top250" },
{ title: "儿童", type: "movie", tag: "少儿" },
{ title: "美剧", type: "tv", tag: "美剧" },
{ title: "韩剧", type: "tv", tag: "韩剧" },
{ title: "日剧", type: "tv", tag: "日剧" },

View File

@@ -43,7 +43,11 @@ export default function SearchScreen() {
setError(null);
try {
const response = await moonTVApi.searchVideos(keyword);
setResults(response.results);
if (response.results.length > 0) {
setResults(response.results);
} else {
setError("没有找到相关内容");
}
} catch (err) {
setError("搜索失败,请稍后重试。");
console.error("Search failed:", err);

View File

@@ -1,12 +1,12 @@
{
"name": "mytv-backend",
"version": "1.0.0",
"name": "OrionTV-proxy",
"version": "1.0.1",
"description": "Backend service for MyTV application",
"main": "dist/index.js",
"scripts": {
"start": "node dist/index.js",
"build": "tsc",
"dev": "ts-node-dev --respawn --transpile-only src/index.ts"
"dev": "ts-node-dev --respawn --transpile-only src/index.docker.ts"
},
"keywords": [],
"author": "",

View File

@@ -48,7 +48,7 @@ export const API_CONFIG = {
};
// 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;
try {

View File

@@ -59,6 +59,15 @@ async function searchFromApi(
const data = await response.json();
console.log(
"apiUrl",
apiSite.name,
"response status",
response.ok,
"response data",
data.list.length
);
if (
!data ||
!data.list ||

View File

@@ -5,7 +5,7 @@
"src": "src/index.ts",
"use": "@vercel/node",
"config": {
"includeFiles": ["../config.json"]
"includeFiles": ["./config.json"]
}
}
],

View File

@@ -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"
}
}

View File

@@ -2,7 +2,7 @@
"name": "OrionTV",
"private": true,
"main": "expo-router/entry",
"version": "1.0.3",
"version": "1.0.5",
"scripts": {
"start": "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",
"lint": "expo lint",
"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/*",
"build-local": "cd android && ./gradlew assembleRelease"
},

View File

@@ -17,7 +17,7 @@
<data android:scheme="https"/>
</intent>
</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.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>

View File

@@ -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>