Skip to content

Commit 989d9f5

Browse files
committed
Buon natale a tutti ❤️
1 parent d7ceca0 commit 989d9f5

File tree

6 files changed

+35
-22
lines changed

6 files changed

+35
-22
lines changed

.github/workflows/update_domain.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,59 @@ on:
77
jobs:
88
update-domains:
99
runs-on: ubuntu-latest
10-
1110
permissions:
1211
contents: write
13-
12+
1413
steps:
1514
- name: Checkout code
1615
uses: actions/checkout@v4
1716
with:
18-
fetch-depth: 0 # Serve per l'amend
17+
fetch-depth: 0
1918
token: ${{ secrets.GITHUB_TOKEN }}
2019

2120
- name: Setup Python
2221
uses: actions/setup-python@v5
2322
with:
2423
python-version: '3.12'
25-
24+
2625
- name: Install dependencies
2726
run: |
2827
pip install httpx tldextract ua-generator dnspython
2928
pip install --upgrade pip setuptools wheel
30-
29+
3130
- name: Configure DNS
3231
run: |
3332
sudo sh -c 'echo "nameserver 208.67.220.220" > /etc/resolv.conf'
3433
sudo sh -c 'echo "nameserver 208.67.222.222" >> /etc/resolv.conf'
3534
sudo sh -c 'echo "nameserver 77.88.8.8" >> /etc/resolv.conf'
36-
35+
3736
- name: Execute domain update script
3837
run: python .github/workflows/script/domain_update.py
3938

40-
- name: Always amend last commit
39+
- name: Check for changes and amend/commit
4140
run: |
4241
git config --global user.name 'github-actions[bot]'
4342
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4443
4544
if ! git diff --quiet .github/workflows/script/domains.json; then
46-
echo "📝 Changes detected - amending last commit"
45+
echo "📝 Changes detected in domains.json"
4746
git add .github/workflows/script/domains.json
48-
git commit --amend --no-edit
49-
git push --force-with-lease origin main
47+
48+
if git rev-parse HEAD >/dev/null 2>&1; then
49+
if git log origin/main..HEAD --oneline | grep -q .; then
50+
echo "🔄 Amending unpushed commit"
51+
git commit --amend --no-edit
52+
else
53+
echo "✨ Creating new commit (last commit already pushed)"
54+
git commit -m "🔄 Update domains.json [$(date +'%Y-%m-%d %H:%M:%S')]"
55+
fi
56+
else
57+
echo "✨ Creating first commit"
58+
git commit -m "🔄 Update domains.json [$(date +'%Y-%m-%d %H:%M:%S')]"
59+
fi
60+
61+
git push --force-with-lease origin main || git push origin main
62+
echo "✅ Changes pushed successfully"
5063
else
5164
echo "✅ No changes to domains.json"
5265
fi
@@ -55,5 +68,5 @@ jobs:
5568
if: failure()
5669
run: |
5770
echo "❌ Something went wrong. Repository state:"
58-
git log --oneline -5
71+
git log --oneline -5 || echo "No commits yet"
5972
git status

StreamingCommunity/Lib/DASH/downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .parser import MPD_Parser
2121
from .segments import MPD_Segments
2222
from .decrypt import decrypt_with_mp4decrypt
23-
from .cdm_helpher import get_widevine_keys, map_keys_to_representations
23+
from .extractor import get_widevine_keys, map_keys_to_representations
2424

2525

2626
# FFmpeg functions
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 24.12.25
2+
3+
from .ex_widevine import get_widevine_keys, map_keys_to_representations
4+
5+
__all__ = [
6+
'get_widevine_keys',
7+
'map_keys_to_representations'
8+
]

StreamingCommunity/Lib/DASH/cdm_helpher.py renamed to StreamingCommunity/Lib/DASH/extractor/ex_widevine.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
console = Console()
1717

1818

19-
2019
def get_widevine_keys(pssh: str, license_url: str, cdm_device_path: str, headers: dict = None, query_params: dict =None, key: str=None):
2120
"""
2221
Extract Widevine CONTENT keys (KID/KEY) from a license using pywidevine.
@@ -173,15 +172,9 @@ def get_info_wvd(cdm_device_path):
173172

174173
# Extract client info
175174
info = {ci.name: ci.value for ci in device.client_id.client_info}
176-
caps = device.client_id.client_capabilities
177-
178-
company = info.get("company_name", "N/A")
179175
model = info.get("model_name", "N/A")
180-
181176
device_name = info.get("device_name", "").lower()
182177
build_info = info.get("build_info", "").lower()
183-
184-
# Extract device type
185178
is_emulator = any(x in device_name for x in [
186179
"generic", "sdk", "emulator", "x86"
187180
]) or "test-keys" in build_info or "userdebug" in build_info
@@ -196,6 +189,5 @@ def get_info_wvd(cdm_device_path):
196189
console.print(
197190
f"[cyan]Load WVD: "
198191
f"[red]L{device.security_level} [cyan]| [red]{dev_type} [cyan]| "
199-
f"[red]{company} {model} [cyan]| API [red]{caps.oem_crypto_api_version} [cyan]| "
200192
f"[cyan]SysID: [red]{device.system_id}"
201193
)

StreamingCommunity/Lib/HLS/segments.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# External
3333
from ..MP4 import MP4_Downloader
34-
from ..DASH.cdm_helpher import get_widevine_keys
34+
from ..DASH.extractor import get_widevine_keys
3535
from ..DASH.decrypt import decrypt_with_mp4decrypt
3636

3737

StreamingCommunity/Util/os.py

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

1616
# Internal utilities
1717
from .installer import check_ffmpeg, check_mp4decrypt, check_device_wvd_path, check_megatools
18-
from StreamingCommunity.Lib.DASH.cdm_helpher import get_info_wvd
18+
from StreamingCommunity.Lib.DASH.extractor.ex_widevine import get_info_wvd
1919

2020

2121
# Variable

0 commit comments

Comments
 (0)