Skip to content

Commit dd20b29

Browse files
ArrowarFrancescoGraziosoproghack
authored
Add some fix (#383)
* Bump v3.3.0 (#375) * Aggiunta di una nuova interfaccia web per la ricerca e il download + fix hook precommit * Aggiornamento della documentazione README.md: aggiunti comandi per l'esecuzione delle migrazioni e per l'avvio del server di sviluppo. * Rifattorizzazione dell'interfaccia utente per la ricerca e i risultati: migliorata l'estetica con Tailwind CSS, aggiunti stili personalizzati per i form e implementate animazioni per una migliore esperienza utente. * Modifiche alla logica di selezione per il download: ora gestisce separatamente gli episodi per animeunity e aggiorna l'interfaccia utente per riflettere queste modifiche, nascondendo il campo stagione quando non necessario. * Aggiunta della funzione _ensure_direct_item per garantire la validità degli direct_item, ricostruendoli dal database se mancano campi chiave. Aggiornato il flusso di download per utilizzare il direct_item assicurato. * Aggiunta di normalizzazione degli spazi per stagione ed episodio, conversione del nome del sito in minuscolo e gestione del download di tutti gli episodi per animeunity se non specificato. Aggiornato il placeholder del campo episodio per migliorare l'usabilità. * Modifica del percorso di root_path in config.json per puntare alla directory Video corretta. Questo cambiamento migliora la gestione dei file di output. * Aggiunta della gestione della data di rilascio e dell'immagine di sfondo nei risultati di ricerca. Modifiche ai template per migliorare la visibilità delle opzioni selezionate e l'estetica generale. Aggiornamenti ai campi di input per la barra di ricerca veloce. * Aggiunta della vista `series_metadata` per gestire le richieste POST relative ai metadati delle serie. Implementati test unitari per verificare il comportamento della vista con diversi tipi di input e sorgenti. Aggiornato il routing per includere il nuovo endpoint. * Aggiunta del supporto per il tipo "OVA" nella gestione dei metadati delle serie. Aggiornati i test unitari per verificare il comportamento corretto con questo nuovo tipo. Modifiche ai template per nascondere le opzioni di stagione ed episodio quando il tipo è "OVA". * Modifiche agli stili CSS per migliorare le animazioni e la visibilità del testo nei selettori di stagione ed episodio. Aggiornati i parametri di animazione per una transizione più fluida e forzato il colore del testo in nero per i selettori richiesti. * ruff format * Aggiunta di gestione dei segnali per il thread principale nel downloader MP4. Ora il gestore di interruzione viene impostato solo se il codice è in esecuzione nel thread principale, migliorando la stabilità in contesti multithread. Gestita l'eccezione nel caso in cui l'impostazione del gestore di segnali fallisca. * Modifiche alla logica di gestione dei metadati: in caso di errore nel recupero, ora si nasconde completamente la selezione e si forza il download completo. Per le serie con una sola stagione, si mostra solo l'intervallo degli episodi e si imposta automaticamente la stagione a 1. --------- Co-authored-by: Francesco Grazioso <[email protected]> * Fixes for Mediaset Infinity (#376) * Fix: double word request if string_to_search equals None * Fixed public_id since watchlist always return empy entry list (any value seems to work) * username and password for infinity to generate the beToken (if missing, the beToken itself will be taken as before) --------- Co-authored-by: None <[email protected]> * Fix issue #377 * Add file_type to "get_video_duration" * Add version pyinstaller * Fix issue #379 * Final fix "output_path" for DASH download * Update README.md * Delete .github/.site/guide.md * Update config --------- Co-authored-by: Francesco Grazioso <[email protected]> Co-authored-by: proghack <[email protected]>
1 parent 2a5929e commit dd20b29

File tree

25 files changed

+748
-208
lines changed

25 files changed

+748
-208
lines changed

.github/.domain/domains.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"cb01new": {
3+
"domain": "quest",
4+
"full_url": "https://cb01net.quest/",
5+
"old_domain": "pics",
6+
"time_change": "2025-09-01 20:20:23"
7+
},
8+
"animeunity": {
9+
"domain": "so",
10+
"full_url": "https://www.animeunity.so/",
11+
"old_domain": "so",
12+
"time_change": "2025-07-08 13:59:31"
13+
},
14+
"animeworld": {
15+
"domain": "ac",
16+
"full_url": "https://www.animeworld.ac/",
17+
"old_domain": "ac",
18+
"time_change": "2025-03-21 12:20:27"
19+
},
20+
"guardaserie": {
21+
"domain": "sale",
22+
"full_url": "https://guardaserietv.sale/",
23+
"old_domain": "app",
24+
"time_change": "2025-08-20 07:20:06"
25+
},
26+
"streamingwatch": {
27+
"domain": "org",
28+
"full_url": "https://www.streamingwatch.org/",
29+
"old_domain": "org",
30+
"time_change": "2025-04-29 12:30:30"
31+
},
32+
"altadefinizione": {
33+
"domain": "center",
34+
"full_url": "https://altadefinizionegratis.center/",
35+
"old_domain": "free",
36+
"time_change": "2025-09-04 14:18:54"
37+
},
38+
"streamingcommunity": {
39+
"domain": "bid",
40+
"full_url": "https://streamingcommunityz.bid/",
41+
"old_domain": "chat",
42+
"time_change": "2025-09-01 15:20:03"
43+
},
44+
"altadefinizionegratis": {
45+
"domain": "center",
46+
"full_url": "https://altadefinizionegratis.center/",
47+
"old_domain": "cool",
48+
"time_change": "2025-08-25 18:30:42"
49+
}
50+
}

.github/.site/guide.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
name: Build and Publish
1+
# Workflow: Build and Publish
2+
# Author: Arrowar
23

4+
name: Build and Publish
35
on:
46
workflow_dispatch:
57
inputs:
@@ -19,30 +21,24 @@ jobs:
1921
publish:
2022
if: startsWith(github.ref_name, 'v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_pypi == 'true')
2123
runs-on: ubuntu-latest
22-
2324
steps:
2425
- name: Checkout repository
2526
uses: actions/checkout@v4
2627
with:
2728
fetch-depth: 0
28-
2929
- name: Get the latest tag
3030
id: get_latest_tag
3131
run: echo "latest_tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
32-
3332
- name: Set up Python
3433
uses: actions/setup-python@v4
3534
with:
3635
python-version: '3.12'
37-
3836
- name: Install packaging dependencies
3937
run: |
4038
python -m pip install --upgrade pip
4139
python -m pip install --upgrade setuptools>=61.0.0 wheel twine build
42-
4340
- name: Build package
4441
run: python -m build
45-
4642
- name: Upload to PyPI
4743
env:
4844
TWINE_USERNAME: __token__
@@ -51,35 +47,33 @@ jobs:
5147

5248
build:
5349
if: startsWith(github.ref_name, 'v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_pypi == 'false')
54-
5550
strategy:
5651
matrix:
5752
include:
5853
- os: windows-latest
5954
artifact_name: StreamingCommunity_win
6055
executable: StreamingCommunity_win.exe
6156
separator: ';'
62-
57+
is_windows: true
6358
- os: macos-latest
6459
artifact_name: StreamingCommunity_mac
6560
executable: StreamingCommunity_mac
6661
separator: ':'
67-
62+
is_windows: false
6863
- os: ubuntu-latest
6964
artifact_name: StreamingCommunity_linux_latest
7065
executable: StreamingCommunity_linux_latest
7166
separator: ':'
72-
67+
is_windows: false
7368
- os: ubuntu-22.04
7469
artifact_name: StreamingCommunity_linux_previous
7570
executable: StreamingCommunity_linux_previous
7671
separator: ':'
77-
72+
is_windows: false
7873
runs-on: ${{ matrix.os }}
7974
defaults:
8075
run:
8176
shell: bash
82-
8377
steps:
8478
- name: Checkout repository
8579
uses: actions/checkout@v4
@@ -105,10 +99,24 @@ jobs:
10599
python -m pip install -r requirements.txt
106100
python -m pip install pyinstaller
107101
102+
- name: Create version file for Windows (inline)
103+
if: matrix.is_windows
104+
shell: bash
105+
run: |
106+
cat <<EOF > version.txt
107+
# UTF-8
108+
[Version]
109+
CompanyName=Arrowar
110+
FileDescription=StreamingCommunity by Arrowar
111+
LegalCopyright=© Arrowar
112+
ProductName=StreamingCommunity
113+
ProductVersion=3.3.1
114+
EOF
115+
108116
- name: Build executable with PyInstaller
109117
shell: bash
110118
run: |
111-
pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
119+
CMD="pyinstaller --onefile --hidden-import=pycryptodomex --hidden-import=ua_generator \
112120
--hidden-import=qbittorrentapi --hidden-import=qbittorrent \
113121
--hidden-import=bs4 --hidden-import=httpx --hidden-import=rich --hidden-import=tqdm \
114122
--hidden-import=m3u8 --hidden-import=psutil --hidden-import=unidecode \
@@ -130,8 +138,18 @@ jobs:
130138
--hidden-import=curl_cffi --hidden-import=_cffi_backend \
131139
--collect-all curl_cffi \
132140
--additional-hooks-dir=pyinstaller/hooks \
133-
--add-data "StreamingCommunity${{ matrix.separator }}StreamingCommunity" \
134-
--name=${{ matrix.artifact_name }} test_run.py
141+
--add-data \"StreamingCommunity${{ matrix.separator }}StreamingCommunity\" \
142+
--name=${{ matrix.artifact_name }}"
143+
144+
# Aggiungi il file version.txt solo su Windows
145+
if [[ "${{ matrix.is_windows }}" == "true" ]]; then
146+
CMD+=" --version-file=version.txt"
147+
fi
148+
149+
CMD+=" test_run.py"
150+
151+
echo "Running: $CMD"
152+
eval $CMD
135153
136154
- name: Upload executable
137155
uses: actions/upload-artifact@v4
@@ -146,4 +164,4 @@ jobs:
146164
tag_name: ${{ github.ref_name }}
147165
files: dist/${{ matrix.executable }}
148166
env:
149-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ venv/
4040
ENV/
4141
env.bak/
4242
venv.bak/
43+
downloaded_files/
4344

4445
# IDEs
4546
.idea

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -869,28 +869,18 @@ python3 telegram_bot.py
869869
```
870870
</details>
871871

872-
# SITE_LOGIN key
873-
To use some site, you may need a SITE_LOGIN key.
874-
See [guide.md](.github/.site/guide.md) for instructions on how to obtain it.
875-
876872
# Tutorials
877873

878874
- [Windows](https://www.youtube.com/watch?v=mZGqK4wdN-k)
879875
- [Linux](https://www.youtube.com/watch?v=0qUNXPE_mTg)
880876
- [Pypy](https://www.youtube.com/watch?v=C6m9ZKOK0p4)
881877
- [Compiled](https://www.youtube.com/watch?v=pm4lqsxkTVo)
882878

883-
# To Do
884-
885-
- To Finish [website API](https://github.com/Arrowar/StreamingCommunity/tree/test_gui_1)
886-
- To finish [website API 2](https://github.com/hydrosh/StreamingCommunity/tree/test_gui_1)
887-
888879
## Useful Project
889880

890881
### 🎯 [Unit3Dup](https://github.com/31December99/Unit3Dup)
891882
Bot in Python per la generazione e l'upload automatico di torrent su tracker basati su Unit3D.
892883

893-
894884
### 🇮🇹 [MammaMia](https://github.com/UrloMythus/MammaMia)
895885
Addon per Stremio che consente lo streaming HTTPS di film, serie, anime e TV in diretta in lingua italiana.
896886

@@ -901,4 +891,4 @@ API non ufficiale per accedere ai contenuti del sito italiano StreamingCommunity
901891

902892
This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or the use or other dealings in the software.
903893

904-
> **Note:** DASH downloads require a valid L3 CDM (Content Decryption Module) to proceed. This project does not provide, include, or facilitate obtaining any CDM. Users are responsible for ensuring compliance with all applicable laws and requirements regarding DRM and decryption modules.
894+
> **Note:** DASH downloads require a valid L3 CDM (Content Decryption Module) to proceed. This project does not provide, include, or facilitate obtaining any CDM. Users are responsible for ensuring compliance with all applicable laws and requirements regarding DRM and decryption modules.

StreamingCommunity/Api/Site/altadefinizione/__init__.py

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,39 @@ def get_user_input(string_to_search: str = None):
3838
"""
3939
Asks the user to input a search term.
4040
Handles both Telegram bot input and direct input.
41+
If string_to_search is provided, it's returned directly (after stripping).
4142
"""
42-
if string_to_search is None:
43-
if site_constant.TELEGRAM_BOT:
44-
bot = get_bot_instance()
45-
string_to_search = bot.ask(
46-
"key_search",
47-
"Enter the search term\nor type 'back' to return to the menu: ",
48-
None
49-
)
50-
51-
if string_to_search == 'back':
43+
if string_to_search is not None:
44+
return string_to_search.strip()
5245

46+
if site_constant.TELEGRAM_BOT:
47+
bot = get_bot_instance()
48+
user_response = bot.ask(
49+
"key_search", # Request type
50+
"Enter the search term\nor type 'back' to return to the menu: ",
51+
None
52+
)
53+
54+
if user_response is None:
55+
bot.send_message("Timeout: No search term entered.", None)
56+
return None
57+
58+
if user_response.lower() == 'back':
59+
bot.send_message("Returning to the main menu...", None)
60+
61+
try:
5362
# Restart the script
5463
subprocess.Popen([sys.executable] + sys.argv)
5564
sys.exit()
56-
else:
57-
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
58-
59-
return string_to_search
65+
66+
except Exception as e:
67+
bot.send_message(f"Error during restart attempt: {e}", None)
68+
return None # Return None if restart fails
69+
70+
return user_response.strip()
71+
72+
else:
73+
return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
6074

6175
def process_search_result(select_title, selections=None):
6276
"""
@@ -107,8 +121,8 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
107121
if direct_item:
108122
select_title = MediaItem(**direct_item)
109123
process_search_result(select_title, selections)
110-
return
111-
124+
return True
125+
112126
# Get the user input for the search term
113127
actual_search_query = get_user_input(string_to_search)
114128

@@ -129,6 +143,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
129143
if len_database > 0:
130144
select_title = get_select_title(table_show_manager, media_search_manager, len_database)
131145
process_search_result(select_title, selections)
146+
return True
132147

133148
else:
134149
if bot:

StreamingCommunity/Api/Site/animeunity/__init__.py

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,39 @@ def get_user_input(string_to_search: str = None):
3737
"""
3838
Asks the user to input a search term.
3939
Handles both Telegram bot input and direct input.
40+
If string_to_search is provided, it's returned directly (after stripping).
4041
"""
41-
if string_to_search is None:
42-
if site_constant.TELEGRAM_BOT:
43-
bot = get_bot_instance()
44-
string_to_search = bot.ask(
45-
"key_search",
46-
"Enter the search term\nor type 'back' to return to the menu: ",
47-
None
48-
)
49-
50-
if string_to_search == 'back':
42+
if string_to_search is not None:
43+
return string_to_search.strip()
5144

45+
if site_constant.TELEGRAM_BOT:
46+
bot = get_bot_instance()
47+
user_response = bot.ask(
48+
"key_search", # Request type
49+
"Enter the search term\nor type 'back' to return to the menu: ",
50+
None
51+
)
52+
53+
if user_response is None:
54+
bot.send_message("Timeout: No search term entered.", None)
55+
return None
56+
57+
if user_response.lower() == 'back':
58+
bot.send_message("Returning to the main menu...", None)
59+
60+
try:
5261
# Restart the script
5362
subprocess.Popen([sys.executable] + sys.argv)
5463
sys.exit()
55-
else:
56-
string_to_search = msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
57-
58-
return string_to_search
64+
65+
except Exception as e:
66+
bot.send_message(f"Error during restart attempt: {e}", None)
67+
return None # Return None if restart fails
68+
69+
return user_response.strip()
70+
71+
else:
72+
return msg.ask(f"\n[purple]Insert a word to search in [green]{site_constant.SITE_NAME}").strip()
5973

6074
def process_search_result(select_title, selections=None):
6175
"""
@@ -105,7 +119,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
105119
if direct_item:
106120
select_title = MediaItem(**direct_item)
107121
process_search_result(select_title, selections)
108-
return
122+
return True
109123

110124
# Get the user input for the search term
111125
actual_search_query = get_user_input(string_to_search)
@@ -127,6 +141,7 @@ def search(string_to_search: str = None, get_onlyDatabase: bool = False, direct_
127141
if len_database > 0:
128142
select_title = get_select_title(table_show_manager, media_search_manager, len_database)
129143
process_search_result(select_title, selections)
144+
return True
130145

131146
else:
132147
if bot:

0 commit comments

Comments
 (0)