Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 3 additions & 26 deletions airing-today-tv-show/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,7 @@
<div id="loading-bar"></div>

<!-- هدر -->
<header class="bg-gray-800 p-4 shadow-md">
<div class="container mx-auto flex justify-between items-center">
<nav class="flex items-center space-x-4">
<a href="https://freemovieir.github.io/" class="hover:text-gray-300 p-4" aria-label="خانه"><i class="fas fa-home"></i></a>
<a href="/movies.html" class="hover:text-gray-300 p-4" aria-label="فیلم‌ها"><i class="fas fa-film"></i></a>
<a href="/series.html" class="hover:text-gray-300 p-4" aria-label="سریال‌ها"><i class="fas fa-tv"></i></a>
<a href="/genres.html" class="hover:text-gray-300 p-4" aria-label="دسته‌بندی‌ها"><i class="fas fa-list"></i></a>
<a href="/watchlist" class="hover:text-gray-300" aria-label="واچ‌لیست"><i class="fas fa-bookmark"></i></a>
<a href="/search" class="hover:text-gray-300" aria-label="جستجو"><i class="fas fa-search"></i></a>
</nav>
<div>
<a href="https://freemovieir.github.io/">
<img src="https://freemovieir.github.io/logo.png" alt="لوگوی فیری مووی" class="h-10">
</a>
</div>
</div>
</header>
<div id="shared-header"></div>

<!-- بخش اصلی -->
<main class="container mx-auto py-8 flex-1">
Expand All @@ -71,17 +55,10 @@ <h1 class="text-3xl font-bold mb-8 text-center">سریال‌های در حال
</main>

<!-- فوتر -->
<footer class="bg-gray-800 p-4 mt-auto">
<div class="container mx-auto text-center">
<p>
فیری مووی - ساخته شده با 🤍
<br>
استفاده از فونت <a href="https://rastikerdar.github.io/vazir-font/" class="hover:text-gray-300">وزیرمتن</a> به یاد صابر راستی کردار
</p>
</div>
</footer>
<div id="shared-footer"></div>

<script src="/apiKeySwitcher.js" defer></script>
<script src="airing-today.js" defer></script>
<script src="/js/layout-shared.js" defer></script>
</body>
</html>
29 changes: 3 additions & 26 deletions genres/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,7 @@
<div id="loading-bar"></div>

<!-- هدر -->
<header class="bg-gray-800 p-4 shadow-md">
<div class="container mx-auto flex justify-between items-center">
<nav class="flex items-center space-x-4">
<a href="https://freemovieir.github.io/" class="hover:text-gray-300 p-4" aria-label="خانه"><i class="fas fa-home"></i></a>
<a href="/movies.html" class="hover:text-gray-300 p-4" aria-label="فیلم‌ها"><i class="fas fa-film"></i></a>
<a href="/series.html" class="hover:text-gray-300 p-4" aria-label="سریال‌ها"><i class="fas fa-tv"></i></a>
<a href="/genres.html" class="hover:text-gray-300 p-4" aria-label="دسته‌بندی‌ها"><i class="fas fa-list"></i></a>
<a href="/watchlist" class="hover:text-gray-300" aria-label="واچ‌لیست"><i class="fas fa-bookmark"></i></a>
<a href="/search" class="hover:text-gray-300" aria-label="جستجو"><i class="fas fa-search"></i></a>
</nav>
<div>
<a href="https://freemovieir.github.io/">
<img src="https://freemovieir.github.io/logo.png" alt="لوگوی فیری مووی" class="h-10">
</a>
</div>
</div>
</header>
<div id="shared-header"></div>

<!-- بخش اصلی -->
<main class="container mx-auto py-8 flex-1">
Expand All @@ -71,17 +55,10 @@ <h1 class="text-3xl font-bold mb-8 text-center">دسته‌بندی فیلم‌


<!-- فوتر -->
<footer class="bg-gray-800 p-4 mt-auto">
<div class="container mx-auto text-center">
<p>
فیری مووی - ساخته شده با 🤍
<br>
استفاده از فونت <a href="https://rastikerdar.github.io/vazir-font/" class="hover:text-gray-300">وزیرمتن</a> به یاد صابر راستی کردار
</p>
</div>
</footer>
<div id="shared-footer"></div>

<script src="/apiKeySwitcher.js" defer></script>
<script src="genres.js" defer></script>
<script src="/js/layout-shared.js" defer></script>
</body>
</html>
71 changes: 71 additions & 0 deletions js/layout-shared.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
(function () {
const headerTarget = document.getElementById('shared-header');
const footerTarget = document.getElementById('shared-footer');

const headerHtml = `
<header class="bg-gray-800 p-4 shadow-md">
<div class="container mx-auto flex flex-row justify-between items-center">
<nav class="flex items-center space-x-4">
<a href="/" class="hover:text-gray-300 p-4" aria-label="خانه"><i class="fas fa-home"></i></a>
<a href="/watchlist" class="hover:text-gray-300" aria-label="واچ‌لیست"><i class="fas fa-bookmark"></i></a>
<a href="/search" class="hover:text-gray-300" aria-label="جستجو"><i class="fas fa-search"></i></a>
<a href="/settings/index.html" class="hover:text-gray-300" aria-label="تنظیمات"><i class="fas fa-cog"></i></a>
</nav>
<div>
<a href="/">
<img src="/logo.png" alt="لوگوی فیری مووی" class="h-10">
</a>
</div>
</div>
</header>
`;

const footerHtml = `
<footer class="bg-gray-800 p-4 mt-auto">
<div class="container mx-auto text-center">
<p>
فیری مووی - ساخته شده با 🤍
<br>
استفاده از فونت <a href="https://rastikerdar.github.io/vazir-font/" class="hover:text-gray-300">وزیرمتن</a> به یاد صابر راستی کردار
</p>
<a href="/developer/">توسعه‌دهندگان</a> | <a href="/about-freemovie/">درباره فیری مووی</a>
<br>
<a href="/disclaimer/">سلب مسئولیت</a> | <a href="/disclaimer/index-en.html">DMCA</a>
<div class="social-icons mb-2">
<a class="github-button"
href="https://github.com/FreeMovieIR/web"
data-icon="octicon-star"
data-show-count="true"
aria-label="ستاره دادن به FreeMovieIR/web در گیت‌هاب"></a>
</div>
<div class="social-icons mb-2">
<a href="https://twitter.com/freemovie_ir" target="_blank" class="mx-2 hover:text-gray-300" aria-label="ما را در توییتر دنبال کنید">
<i class="fab fa-twitter"></i>
</a>
<a href="https://instagram.com/freemovie_ir" target="_blank" class="mx-2 hover:text-gray-300" aria-label="ما را در اینستاگرام دنبال کنید">
<i class="fab fa-instagram"></i>
</a>
</div>
</div>
</footer>
`;

function ensureGithubButtonScript() {
if (document.querySelector('script[data-github-buttons]')) return;
const script = document.createElement('script');
script.src = 'https://buttons.github.io/buttons.js';
script.async = true;
script.defer = true;
script.setAttribute('data-github-buttons', 'true');
document.body.appendChild(script);
}

if (headerTarget) {
headerTarget.innerHTML = headerHtml;
}

if (footerTarget) {
footerTarget.innerHTML = footerHtml;
ensureGithubButtonScript();
}
})();
26 changes: 4 additions & 22 deletions movie/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,7 @@
</head>
<body class="bg-gray-900 text-white min-h-screen flex flex-col">
<!-- هدر -->
<header class="bg-gray-800 p-4 shadow-md">
<div class="container mx-auto flex flex-row justify-between items-center">
<!-- Navigation -->
<nav class="flex items-center space-x-4">
<a href="https://freemovieir.github.io/" class="hover:text-gray-300 p-4"><i class="fas fa-home"></i></a>
<a href="/watchlist" class="hover:text-gray-300"><i class="fas fa-bookmark"></i></a>
<a href="/search" class="hover:text-gray-300"><i class="fas fa-search"></i></a>
</nav>
<!-- Logo -->
<div>
<a href="https://freemovieir.github.io/">
<img src="https://freemovieir.github.io/logo.png" alt="لوگو" class="h-10">
</a>
</div>
</div>
</header>
<div id="shared-header"></div>

<div id="general-error-message" class="container mx-auto my-4 p-4 bg-red-800 text-white rounded shadow-lg text-center hidden">
</div>
Expand Down Expand Up @@ -126,11 +111,7 @@ <h1 id="title" class="text-3xl font-bold text-center">عنوان فیلم</h1>
</main>

<!-- فوتر -->
<footer class="bg-gray-800 p-4 mt-auto">
<div class="container mx-auto text-center">
<p>فیری مووی - دانلود رایگان فیلم و سریال</p>
</div>
</footer>
<div id="shared-footer"></div>

<script src="../apiKeySwitcher.js"></script>
<script>
Expand Down Expand Up @@ -166,5 +147,6 @@ <h1 id="title" class="text-3xl font-bold text-center">عنوان فیلم</h1>
}
</script>
<script src="movie.js"></script>
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'92695d758f74804f',t:'MTc0MzAyMDU5OC4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
<script>(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'92695d758f74804f',t:'MTc0MzAyMDU5OC4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script> <script src="/js/layout-shared.js" defer></script>
</body>
</html>
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"@tailwindcss/postcss": "^4.0.15",
"postcss": "^8.5.3",
"tailwindcss": "^4.0.15"
},
"scripts": {
"generate:sitemap": "node scripts/generate-sitemap.mjs"
}
}
15 changes: 4 additions & 11 deletions player/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,7 @@
</head>
<body class="bg-gray-900 text-gray-100 min-h-screen">
<!-- هدر هوشمند -->
<header class="bg-gray-800 py-4 shadow-xl sticky top-0 z-50">
<div class="container mx-auto px-4 flex justify-between items-center">
<h1 class="text-2xl font-bold text-yellow-500">
<i class="fas fa-play-circle mr-2"></i>
FreeMovie Player
</h1>
<button id="theme-toggle" class="p-2 rounded-lg bg-gray-700 hover:bg-gray-600">
<i class="fas fa-moon"></i>
</button>
</div>
</header>
<div id="shared-header"></div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore theme toggle before player script initialization

player/index.html now swaps the static header for #shared-header, but the inline script still immediately executes document.getElementById('theme-toggle').addEventListener(...). Because the header is injected later by deferred /js/layout-shared.js, #theme-toggle is null on every page load, which throws and stops the remaining setup code (including paste auto-detect, keyboard shortcuts, and theme initialization).

Useful? React with 👍 / 👎.


<!-- بخش اصلی -->
<main class="container mx-auto px-4 py-8">
Expand Down Expand Up @@ -132,6 +122,8 @@ <h3 class="text-yellow-500 mb-2 font-semibold">
</div>
</main>

<div id="shared-footer"></div>

<script>
// تنظیمات اولیه
const videoPlayer = document.getElementById('videoPlayer');
Expand Down Expand Up @@ -264,5 +256,6 @@ <h3 class="text-yellow-500 mb-2 font-semibold">
updateThemeIcon(false);
}
</script>
<script src="/js/layout-shared.js" defer></script>
</body>
</html>
16 changes: 3 additions & 13 deletions playsho/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@
</style>
</head>
<body class="bg-gray-900 text-white min-h-screen flex flex-col">
<header class="bg-gray-800 p-4 shadow-md">
<div class="container mx-auto flex justify-between items-center">
<h1 class="text-xl font-bold">پلی‌شو - تماشای گروهی</h1>
<button onclick="showInputSection()" class="bg-indigo-600 hover:bg-indigo-700 text-white py-2 px-4 rounded-lg">
<i class="fas fa-plus ml-2"></i> فیلم جدید
</button>
</div>
</header>
<div id="shared-header"></div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep a UI trigger for returning to Playsho input mode

This header replacement removes the previous “film new” control that called showInputSection(), and after this change there is no remaining invocation in playsho/index.html (the function is only exported in playsho/script.js). In active sessions, users lose the in-page way to get back to the input form and start a new shared video without manually manipulating the URL/reloading.

Useful? React with 👍 / 👎.


<main class="container mx-auto flex-1 py-8 px-4">
<div class="flex flex-col items-center gap-6">
Expand Down Expand Up @@ -71,11 +64,8 @@ <h2 class="text-lg font-semibold mb-4 text-center">لینک اشتراک‌گذ
</div>
</main>

<footer class="bg-gray-800 p-4 mt-auto">
<div class="container mx-auto text-center text-gray-400">
پلی‌شو - تماشای همزمان ویدیو با دوستان
</div>
</footer>
<div id="shared-footer"></div>
<script src="script.js"></script>
<script src="/js/layout-shared.js" defer></script>
</body>
</html>
4 changes: 4 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
User-agent: *
Allow: /

Sitemap: https://freemovieir.github.io/sitemap.xml
78 changes: 78 additions & 0 deletions scripts/generate-sitemap.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import fs from 'node:fs/promises';

const BASE_URL = 'https://freemovieir.github.io';
const TMDB_KEY = process.env.TMDB_API_KEY || '1dc4cbf81f0accf4fa108820d551dafc';

const staticPaths = [
'/',
'/search/index.html',
'/watchlist/index.html',
'/settings/index.html',
'/about-freemovie/',
'/developer/',
'/disclaimer/',
'/disclaimer/index-en.html',
'/changelog/',
'/genres/index.html',
'/upcoming/index.html',
'/airing-today-tv-show/index.html',
'/series-top-rated/index.html'
];

async function fetchTmdb(path) {
const url = `https://api.themoviedb.org/3${path}${path.includes('?') ? '&' : '?'}api_key=${TMDB_KEY}&language=fa`;
const res = await fetch(url);
if (!res.ok) throw new Error(`TMDB request failed: ${res.status} ${path}`);
return res.json();
}

async function loadDynamicUrls() {
const [trendingMovie, trendingTv, upcomingMovie, topTv] = await Promise.all([
fetchTmdb('/trending/movie/week'),
fetchTmdb('/trending/tv/week'),
fetchTmdb('/movie/upcoming?page=1'),
fetchTmdb('/tv/top_rated?page=1')
]);

const movieIds = new Set([
...(trendingMovie.results || []).map((i) => i.id),
...(upcomingMovie.results || []).map((i) => i.id)
]);
const tvIds = new Set([
...(trendingTv.results || []).map((i) => i.id),
...(topTv.results || []).map((i) => i.id)
]);

return [
...[...movieIds].map((id) => `/movie/index.html?id=${id}`),
...[...tvIds].map((id) => `/series/index.html?id=${id}`)
];
}

function xmlUrl(loc, priority = '0.70') {
const now = new Date().toISOString();
return `<url><loc>${loc}</loc><lastmod>${now}</lastmod><priority>${priority}</priority></url>`;
}

async function main() {
let dynamicPaths = [];
try {
dynamicPaths = await loadDynamicUrls();
} catch (error) {
console.warn('Could not fetch TMDB dynamic URLs, generating sitemap with static paths only.');
}
const allPaths = [...new Set([...staticPaths, ...dynamicPaths])];

const xml = `<?xml version="1.0" encoding="UTF-8"?>\n` +
`<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n` +
allPaths.map((path) => xmlUrl(`${BASE_URL}${path}`, path === '/' ? '1.00' : '0.70')).join('\n') +
`\n</urlset>\n`;

await fs.writeFile('sitemap.xml', xml, 'utf8');
console.log(`sitemap.xml generated with ${allPaths.length} URLs`);
}

main().catch((err) => {
console.error(err);
process.exit(1);
});
Loading