Add all links for almas movie

This commit is contained in:
2026-01-15 09:02:18 +03:30
parent 0ae1356f2d
commit 1ed1cb9194
3 changed files with 14511 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ from pathlib import Path
series_links_dict = {}
movies_links_dict = {}
all_links = []
folder = Path("view/almasmovie")
@@ -66,7 +67,9 @@ for k, v in series_links_dict.items():
for link in v:
parsed_link = urlparse(link)
name = parsed_link.path.split("/")[-1]
series_text += f"- **{k}**: [{name}]({link.replace(' ', '%20')})\n\n"
line = f"- **{k}**: [{name}]({link.replace(' ', '%20')})\n\n"
all_links.append((name, line))
series_text += line
@@ -84,12 +87,29 @@ for v in sorted(movies_links_dict.values(), key=lambda x: x[0]):
url = v[1].replace(" ", "%20")
year = v[2]
movies_text += f"- **{first_letter}**: [{name}]({url})"
line = f"- **{first_letter}**: [{name}]({url})"
if year.isnumeric() and int(year) < 3000:
movies_text += f" ({year})"
line += f" ({year})"
movies_text += "\n\n"
line += "\n\n"
all_links.append((name, line))
movies_text += line
with open(folder / "movies.md", "w") as fp:
fp.write(movies_text)
all_links.sort(key=lambda x: x[0])
all_text = "# آرشیو الماس‌مووی \n\n\n"
all_text += "مرتب شده بر اساس حروف الفبا.\n\n"
all_text += "جهت جستجو از قابلیت `find in page` مرورگر خود استفاده کنید.\n\n"
all_text += "---\n"
for v in all_links:
all_text += v[1]
with open(folder / "all.md", "w") as fp:
fp.write(all_text)