Skip to content

Commit 01ea7a2

Browse files
Fix movie images and API loading without VPN
1 parent 37ea716 commit 01ea7a2

11 files changed

Lines changed: 102 additions & 8 deletions

File tree

.DS_Store

8 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: گزارش لینک خراب
3+
about: لینک دانلود کار نمی‌کند
4+
title: "broken-link: [عنوان فیلم/سریال]"
5+
labels: broken-link
6+
assignees: m4tinbeigi-official
7+
8+
---
9+
10+
**عنوان:**
11+
**سال:**
12+
**IMDb:**
13+
**TMDb:**
14+
**سرور:**
15+
**لینک خراب:**
16+
**صفحه:**
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Update Broken Links
2+
3+
on:
4+
issues:
5+
types: [closed]
6+
7+
jobs:
8+
update-broken-links:
9+
# فقط وقتی issue با label broken-link بسته می‌شه و با "won't fix" یا "fixed" نیست
10+
if: contains(github.event.issue.labels.*.name, 'broken-link') && github.event.issue.state_reason != 'not_planned'
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Parse issue and update broken-links.json
20+
uses: actions/github-script@v7
21+
with:
22+
script: |
23+
const fs = require('fs');
24+
const path = 'data/broken-links.json';
25+
const issue = context.payload.issue;
26+
const body = issue.body || '';
27+
28+
// پارس بدنه issue
29+
function parseField(label) {
30+
const regex = new RegExp(`\\*\\*${label}:\\*\\*\\s*(.+)`);
31+
const match = body.match(regex);
32+
return match ? match[1].trim() : '';
33+
}
34+
35+
const brokenUrl = parseField('لینک خراب');
36+
const imdbId = parseField('IMDb');
37+
const tmdbId = parseField('TMDb');
38+
const server = parseField('سرور');
39+
40+
if (!brokenUrl) {
41+
console.log('لینک خراب پیدا نشد، رد می‌شه');
42+
return;
43+
}
44+
45+
// خواندن یا ساخت فایل
46+
let data = { updated_at: '', broken: [] };
47+
if (fs.existsSync(path)) {
48+
data = JSON.parse(fs.readFileSync(path, 'utf8'));
49+
}
50+
if (!Array.isArray(data.broken)) data.broken = [];
51+
52+
// جلوگیری از تکرار
53+
const alreadyExists = data.broken.some(e => e.url === brokenUrl);
54+
if (!alreadyExists) {
55+
data.broken.push({
56+
url: brokenUrl,
57+
imdbId,
58+
tmdbId,
59+
server,
60+
reportedAt: new Date().toISOString(),
61+
issueNumber: issue.number
62+
});
63+
data.updated_at = new Date().toISOString();
64+
65+
fs.mkdirSync('data', { recursive: true });
66+
fs.writeFileSync(path, JSON.stringify(data, null, 2));
67+
console.log(`لینک اضافه شد: ${brokenUrl}`);
68+
} else {
69+
console.log(`لینک قبلاً وجود داشت: ${brokenUrl}`);
70+
}
71+
72+
- name: Commit and push
73+
run: |
74+
git config user.name "github-actions[bot]"
75+
git config user.email "github-actions[bot]@users.noreply.github.com"
76+
git add data/broken-links.json
77+
git diff --staged --quiet || git commit -m "chore: mark broken link from issue #${{ github.event.issue.number }}"
78+
git push

code/id-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const apiKey = '1dc4cbf81f0accf4fa108820d551dafc'; // TMDb API key
2-
const baseImageUrl = 'https://image.tmdb.org/t/p/w500';
2+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw500';
33
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie.png';
44
const apiClient = window.FreeMovieApi;
55

js/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
tmdbApiKey: '1dc4cbf81f0accf4fa108820d551dafc',
44
defaultLanguage: 'fa-IR',
55
proxyBaseUrl: 'https://odd-disk-9903.armin-apple816467.workers.dev/',
6-
imageBaseUrl: 'https://image.tmdb.org/t/p/',
6+
imageBaseUrl: 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2F',
77
defaultPoster: 'https://freemovieir.github.io/images/default-freemovie.png',
88
defaultPosterSmall: 'https://freemovieir.github.io/images/default-freemovie-300.png',
99
requestTimeoutMs: 12000,

movie/movie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// --- Configuration Constants ---
33
const apiKey = '1dc4cbf81f0accf4fa108820d551dafc'; // TMDb API key (Replace with your key)
44
const language = 'fa-IR';
5-
const baseImageUrl = 'https://image.tmdb.org/t/p/'; // Base URL for TMDB images
5+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2F'; // Base URL for TMDB images
66
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie.png'; // Default poster fallback
77
const defaultBackdrop = 'https://freemovieir.github.io/images/default-freemovie.png'; // Default backdrop fallback
88
const movieId = new URLSearchParams(window.location.search).get('id');

script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const defaultApiKey = '1dc4cbf81f0accf4fa108820d551dafc'; // کلید پیش‌
33
const userTmdbToken = localStorage.getItem('userTmdbToken'); // توکن کاربر
44
const apiKey = userTmdbToken || defaultApiKey; // اولویت با توکن کاربر
55
const language = 'fa';
6-
const baseImageUrl = 'https://image.tmdb.org/t/p/w500';
6+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw500';
77
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie-300.png';
88
const apiClient = window.FreeMovieApi;
99

search-pro/search-pro.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// search-pro.js
22
const apiKey = '1dc4cbf81f0accf4fa108820d551dafc';
33
const language = 'fa-IR';
4-
const baseImageUrl = 'https://image.tmdb.org/t/p/w500';
4+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw500';
55
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie.png';
66
const apiClient = window.FreeMovieApi;
77

search/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// --- Configuration ---
44
const tmdbApiKey = '1dc4cbf81f0accf4fa108820d551dafc'; // TMDb API key
55
const language = 'fa-IR';
6-
const baseImageUrl = 'https://image.tmdb.org/t/p/w500'; // Base URL for TMDb images ( fallback if OMDB fails )
6+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2Fw500'; // Base URL for TMDb images ( fallback if OMDB fails )
77
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie.png';
88
const minQueryLength = 3;
99
const apiClient = window.FreeMovieApi;

series/series.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const apiKey = '1dc4cbf81f0accf4fa108820d551dafc';
22
const language = 'fa-IR';
3-
const baseImageUrl = 'https://image.tmdb.org/t/p/';
3+
const baseImageUrl = 'https://odd-disk-9903.armin-apple816467.workers.dev/?url=https%3A%2F%2Fimage.tmdb.org%2Ft%2Fp%2F';
44
const defaultPoster = 'https://freemovieir.github.io/images/default-freemovie-300.png';
55
const defaultBackdrop = 'https://freemovieir.github.io/images/default-freemovie-300.png';
66
const seriesId = new URLSearchParams(window.location.search).get('id');

0 commit comments

Comments
 (0)