Skip to content

Commit 4dfd739

Browse files
committed
Update github workflows
1 parent f7141a7 commit 4dfd739

File tree

28 files changed

+311
-42
lines changed

28 files changed

+311
-42
lines changed

.github/.site/js/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async function checkSiteStatus(url, siteName) {
113113
}
114114
}
115115

116-
const domainsJsonUrl = 'https://raw.githubusercontent.com/Arrowar/StreamingCommunity/refs/heads/main/.github/.domain/domains.json';
116+
const domainsJsonUrl = 'https://raw.githubusercontent.com/Arrowar/StreamingCommunity/refs/heads/main/.github/workflows/script/domains.json';
117117

118118
async function loadSiteData() {
119119
try {

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Please make sure to check the following:
1313
- [ ] You have the latest commit installed.
1414
- [ ] The issue relates to a website or a specific functionality.
1515
- [ ] If the issue is related to a website, you have verified that the URL works correctly in your browser.
16+
- [ ] If the issue is related to audio or subtitles, you have tested the downloaded file with VLC media player first.
1617
- [ ] You have searched through closed issues for similar problems or potential solutions. Issues that can be resolved by already closed topics may be automatically closed.
1718

1819
## Describe the issue
File renamed without changes.

.github/doc/site.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Services Overview
2+
3+
| Site Name | Stream Type | DRM |
4+
|--------------------|-------------|-----|
5+
| Altadefinizione | HLS ||
6+
| Animeunity | MP4 ||
7+
| Animeworld | MP4 ||
8+
| Crunchyroll | DASH ||
9+
| Discovery | DASH ||
10+
| Dmax | HLS ||
11+
| Guardaserie | HLS ||
12+
| Hd4Me | MEGA ||
13+
| Ipersphera | MEGA ||
14+
| Mediasetinfinity | DASH ||
15+
| Raiplay | DASH ||
16+
| Realtime | HLS ||
17+
| Streamingcommunity | HLS ||
18+
| Tubitv | HLS ||
19+
20+
---
21+
22+
*Last updated: 2025-12-23 10:01:45*
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# 23.12.25
2+
3+
import re
4+
from pathlib import Path
5+
from typing import List, Tuple
6+
from datetime import datetime
7+
8+
9+
def extract_service_info(init_file: Path) -> Tuple[str, str, bool, bool]:
10+
"""
11+
Extract _stream_type, _drm and _deprecate from a service __init__.py file
12+
13+
Args:
14+
init_file: Path to the __init__.py file
15+
16+
Returns:
17+
Tuple of (service_name, stream_type, drm, deprecate)
18+
"""
19+
service_name = init_file.parent.name
20+
stream_type = "N/A"
21+
drm = False
22+
deprecate = False
23+
24+
try:
25+
with open(init_file, 'r', encoding='utf-8') as f:
26+
content = f.read()
27+
28+
# Extract _stream_type
29+
stream_match = re.search(r'_stream_type\s*=\s*["\'](\w+)["\']', content)
30+
if stream_match:
31+
stream_type = stream_match.group(1)
32+
33+
# Extract _drm
34+
drm_match = re.search(r'_drm\s*=\s*(True|False)', content)
35+
if drm_match:
36+
drm = drm_match.group(1) == 'True'
37+
38+
# Extract _deprecate
39+
deprecate_match = re.search(r'_deprecate\s*=\s*(True|False)', content)
40+
if deprecate_match:
41+
deprecate = deprecate_match.group(1) == 'True'
42+
43+
except Exception as e:
44+
print(f"Error reading {init_file}: {e}")
45+
46+
return service_name, stream_type, drm, deprecate
47+
48+
49+
def find_service_files(base_path: Path) -> List[Path]:
50+
"""
51+
Find all service __init__.py files
52+
53+
Args:
54+
base_path: Base path of the project
55+
56+
Returns:
57+
List of paths to service __init__.py files
58+
"""
59+
services_path = base_path / "StreamingCommunity" / "Api" / "Service"
60+
init_files = []
61+
62+
if not services_path.exists():
63+
print(f"Services path not found: {services_path}")
64+
return init_files
65+
66+
# Iterate through service directories
67+
for service_dir in services_path.iterdir():
68+
if service_dir.is_dir() and not service_dir.name.startswith('__'):
69+
init_file = service_dir / "__init__.py"
70+
if init_file.exists():
71+
init_files.append(init_file)
72+
73+
return sorted(init_files)
74+
75+
76+
def generate_markdown_table(services: List[Tuple[str, str, bool]]) -> str:
77+
"""
78+
Generate markdown table from services data with dynamic column widths
79+
Only includes services where _deprecate = False
80+
81+
Args:
82+
services: List of (service_name, stream_type, drm) tuples
83+
84+
Returns:
85+
Markdown formatted table
86+
"""
87+
services = sorted(services, key=lambda x: x[0].lower())
88+
89+
# Prepare data with display names
90+
table_data = []
91+
for service_name, stream_type, drm in services:
92+
display_name = service_name.replace('_', ' ').title()
93+
drm_icon = "✅" if drm else "❌"
94+
table_data.append((display_name, stream_type, drm_icon))
95+
96+
# Calculate maximum width for each column
97+
col1_header = "Site Name"
98+
col2_header = "Stream Type"
99+
col3_header = "DRM"
100+
101+
# Start with header widths
102+
max_col1 = len(col1_header)
103+
max_col2 = len(col2_header)
104+
max_col3 = len(col3_header)
105+
106+
# Check all data rows
107+
for display_name, stream_type, drm_icon in table_data:
108+
max_col1 = max(max_col1, len(display_name))
109+
max_col2 = max(max_col2, len(stream_type))
110+
max_col3 = max(max_col3, len(drm_icon))
111+
112+
# Build table with dynamic widths
113+
lines = ["# Services Overview", ""]
114+
115+
# Header row
116+
header = f"| {col1_header.ljust(max_col1)} | {col2_header.ljust(max_col2)} | {col3_header.ljust(max_col3)} |"
117+
lines.append(header)
118+
119+
# Separator row
120+
separator = f"|{'-' * (max_col1 + 2)}|{'-' * (max_col2 + 2)}|{'-' * (max_col3 + 2)}|"
121+
lines.append(separator)
122+
123+
# Data rows
124+
for display_name, stream_type, drm_icon in table_data:
125+
row = f"| {display_name.ljust(max_col1)} | {stream_type.ljust(max_col2)} | {drm_icon.ljust(max_col3)} |"
126+
lines.append(row)
127+
128+
lines.append("")
129+
lines.append("---")
130+
lines.append("")
131+
lines.append(f"*Last updated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}*")
132+
lines.append("")
133+
134+
return "\n".join(lines)
135+
136+
137+
def main():
138+
script_dir = Path(__file__).parent
139+
base_path = script_dir.parent.parent.parent
140+
print(f"Base path: {base_path}")
141+
142+
# Find all service __init__.py files
143+
init_files = find_service_files(base_path)
144+
print(f"Found {len(init_files)} service files")
145+
146+
if not init_files:
147+
print("No service files found!")
148+
return
149+
150+
# Extract information from each service
151+
services = []
152+
deprecated_count = 0
153+
for init_file in init_files:
154+
service_name, stream_type, drm, deprecate = extract_service_info(init_file)
155+
156+
# Only include services that are not deprecated
157+
if not deprecate:
158+
services.append((service_name, stream_type, drm))
159+
print(f" ✓ {service_name}: {stream_type}, DRM={drm}")
160+
else:
161+
deprecated_count += 1
162+
print(f" ⚠ {service_name}: DEPRECATED (skipped)")
163+
164+
print(f"\nActive services: {len(services)}")
165+
print(f"Deprecated services: {deprecated_count}")
166+
167+
# Generate markdown table
168+
markdown_content = generate_markdown_table(services)
169+
170+
# Write to site.md
171+
output_file = base_path / ".github" / "doc" / "site.md"
172+
output_file.parent.mkdir(parents=True, exist_ok=True)
173+
174+
with open(output_file, 'w', encoding='utf-8') as f:
175+
f.write(markdown_content)
176+
177+
178+
if __name__ == "__main__":
179+
main()

.github/workflows/update_domain.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ jobs:
3535
sudo sh -c 'echo "nameserver 77.88.8.8" >> /etc/resolv.conf'
3636
3737
- name: Execute domain update script
38-
run: python .github/.domain/domain_update.py
38+
run: python .github/workflows/script/domain_update.py
3939

4040
- name: Always amend last commit
4141
run: |
4242
git config --global user.name 'github-actions[bot]'
4343
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4444
45-
if ! git diff --quiet .github/.domain/domains.json; then
45+
if ! git diff --quiet .github/workflows/script/domains.json; then
4646
echo "📝 Changes detected - amending last commit"
47-
git add .github/.domain/domains.json
47+
git add .github/workflows/script/domains.json
4848
git commit --amend --no-edit
4949
git push --force-with-lease origin main
5050
else

.github/workflows/update_site.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update Services Table
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'StreamingCommunity/Api/Service/*/__init__.py'
9+
workflow_dispatch:
10+
11+
jobs:
12+
update-table:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.x'
25+
26+
- name: Run table generator script
27+
run: python .github/workflows/script/generate_services_table.py
28+
29+
- name: Check for changes
30+
id: git-check
31+
run: |
32+
git diff --exit-code .github/doc/site.md || echo "changed=true" >> $GITHUB_OUTPUT
33+
34+
- name: Commit and push if changed
35+
if: steps.git-check.outputs.changed == 'true'
36+
run: |
37+
git config --global user.name 'github-actions[bot]'
38+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
39+
git add .github/doc/site.md
40+
git commit -m "docs: Update services table [skip ci]"
41+
git push

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
***Quick Start:** `pip install StreamingCommunity && StreamingCommunity`*
1717

18+
📺 **[Services](.github/doc/site.md)** - See all supported streaming platforms
1819
</div>
1920

2021
---
@@ -24,7 +25,7 @@
2425
- 🚀 [Quick Start](#quick-start)
2526
- 📥 [Downloaders](#downloaders)
2627
- 🛠️ [Configuration](#configuration)
27-
- 🔐 [Login](.github/.site/login.md)
28+
- 🔐 [Login](.github/doc/login.md)
2829
- 🌐 [Domain](https://arrowar.github.io/StreamingCommunity)
2930
- 💡 [Usage Examples](#usage-examples)
3031
- 🔍 [Global Search](#global-search)

0 commit comments

Comments
 (0)